From 8ab8557ef134b71df30d71b0620155cb4205205d Mon Sep 17 00:00:00 2001 From: kurihada Date: Tue, 3 Mar 2026 17:54:40 +0800 Subject: [PATCH] =?UTF-8?q?CI=20=E6=8F=90=E9=80=9F=EF=BC=9A=E4=B8=BB?= =?UTF-8?q?=E9=93=BE=E8=B7=AF=E8=A6=86=E7=9B=96=E7=8E=87=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E5=8F=AF=E9=80=89=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 }