Files
novalon-website/docs/acceptance/2026-09-21-gates/chain9-lighthouse-9urls.sh
T
zhangxiang a0328a623f chore(qa): 验收台账与证据入库 + 构建/部署配置同步
- docs/acceptance/qa-tracker.md:跨周期缺陷单一真源台账(§7=第五轮)。
- 周期 1/2 + iPhone SE/axe 验收证据目录、ACCEPTANCE_REVIEW 快照入库。
- 同步 README/CONTEXT/CLAUDE/DESIGN/testing/deployment/lessons-learned 口径;
  next.config/Dockerfile/nginx/Jenkinsfile/docker-compose/sentry/prisma 对齐
  standalone 产物装配与部署形态。
2026-09-28 10:48:09 +08:00

37 lines
2.0 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# 第九轮(把 §7 覆盖缺口的 Lighthouse 半边补上后复跑):
# lighthouserc 的 collect.url 由 7 条扩到 9 条(补 /products/erp-upgrade、/about/brand),
# 同时重跑静态门禁,确认本轮改 config/docs/probe 未触碰 src 行为。
set -u
cd /Users/zhangxiang/Codes/Novalon/novalon-website || exit 1
LOG=/tmp/final-chain9.log
PORTS() { lsof -nP -iTCP:3000 -iTCP:3100 -sTCP:LISTEN 2>/dev/null | grep -c LISTEN; }
echo "=== chain9 started $(date -u +%FT%TZ) ===" > "$LOG"
while ! grep -q "chain8 done" /tmp/final-chain8.log 2>/dev/null; do sleep 20; done
echo "CHAIN8_TAIL: $(grep -aE 'EXIT_COVERAGE|SE PASSED|SE rows|EXIT_SE_AUDIT' /tmp/final-chain8.log | tr '\n' '|')" >> "$LOG"
echo "PREFLIGHT_LISTENERS=$(PORTS) $(date -u +%FT%TZ)" >> "$LOG"
for g in type-check lint test:unit check:contrast check:headings check:brand-token; do
npm run "$g" > "/tmp/c9-$(echo "$g" | tr ':' '-').log" 2>&1
echo "EXIT_$(echo "$g" | tr 'a-z-' 'A-Z')=$? $(date -u +%FT%TZ)" >> "$LOG"
done
sed -e 's/\x1b\[[0-9;]*m//g' /tmp/c9-lint.log | grep -a "problems" | tail -1 >> "$LOG"
sleep 2
echo "POST_STATIC_LISTENERS=$(PORTS)" >> "$LOG"
URLS=$(node -e 'const c=require("./config/test/lighthouserc.json");console.log(c.ci.collect.url.length)' 2>/dev/null)
echo "LIGHTHOUSE_URLS=$URLS" >> "$LOG"
{
echo
echo "===== chain9 lighthouse(9 URL × 3 次 = 27 运行,补 erp-upgrade / about-brand)$(date -u +%FT%TZ) ====="
npm run lighthouse 2>&1
} | sed -e 's/\x1b\[[0-9;]*m//g' >> docs/acceptance/2026-09-21-gates/lighthouse.txt 2>&1
echo "EXIT_LIGHTHOUSE=${PIPESTATUS[0]} $(date -u +%FT%TZ)" >> "$LOG"
awk '/chain9 lighthouse/{f=1} f' docs/acceptance/2026-09-21-gates/lighthouse.txt \
| grep -ac "not a known audit" | sed 's/^/CHAIN9_DEAD_AUDIT_WARNINGS=/' >> "$LOG"
awk '/chain9 lighthouse/{f=1} f' docs/acceptance/2026-09-21-gates/lighthouse.txt \
| grep -aE "✗|✓ \[" | tail -12 >> "$LOG"
sleep 3
echo "POST_FINAL_LISTENERS=$(PORTS)" >> "$LOG"
echo "=== chain9 done $(date -u +%FT%TZ) ===" >> "$LOG"