diff --git a/Jenkinsfile b/Jenkinsfile index 0f79b7c..14cddda 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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 }