CI 提速:主链路覆盖率改为可选参数

This commit is contained in:
2026-03-03 17:54:40 +08:00
parent 91dcb735cd
commit 8ab8557ef1
Vendored
+3 -1
View File
@@ -7,6 +7,7 @@ pipeline {
parameters {
booleanParam(name: 'RUN_FULL_E2E', defaultValue: false, description: '是否在部署后额外执行全量 E2E(失败仅标记 UNSTABLE')
booleanParam(name: 'RUN_COVERAGE', defaultValue: false, description: '是否在主链路执行覆盖率测试(关闭可提速)')
}
environment {
@@ -86,8 +87,9 @@ pipeline {
rm -rf playwright-report test-results
cid=$(docker create --ipc=host \
-e HOME=/tmp \
-e RUN_COVERAGE=${RUN_COVERAGE} \
${CI_DEPS_IMAGE} \
sh -lc 'set -e; cd /workspace; npx prisma generate; npm run lint; npx tsc --noEmit; npm run test:coverage; npm run test:e2e:smoke')
sh -lc 'set -e; cd /workspace; npx prisma generate; npm run lint; npx tsc --noEmit; if [ "$RUN_COVERAGE" = "true" ]; then npm run test:coverage; else npm run test; fi; npm run test:e2e:smoke')
cleanup() {
docker rm -f "$cid" >/dev/null 2>&1 || true
}