fix(ci): clear leftover .venv before Python 3.14 venv create (BUG-677)
Independent Staging Quality Gate / validate (push) Successful in 12m2s
Independent Staging Quality Gate / publish (push) Successful in 2m8s

Staging gate run 2594 died in Install dependencies with FileExistsError on a reused hostexecutor .venv. Remove the leftover directory and create the venv with --clear so Python 3.14 mkdir does not abort the job.
This commit is contained in:
jesse-ux
2026-09-14 09:49:25 +08:00
parent 69ffa07d6b
commit d021bca5e1
3 changed files with 27 additions and 2 deletions
@@ -227,7 +227,11 @@ test("Gitea quality gate validates before publishing an immutable ACR manifest",
assert.equal((workflow.match(/exact staging gate checkout failed after \$attempt bounded attempts/g) ?? []).length, 2);
assert.equal((workflow.match(/\[\[ "\$fetch_succeeded" == true \]\]/g) ?? []).length, 2);
assert.doesNotMatch(workflow, /http\.lowSpeedLimit=1024|http\.lowSpeedTime=30/);
assert.match(workflow, /python3 -m venv \.venv/);
// 原值: python3 -m venv .venv
// 新值: rm -rf leftover then python3 -m venv --clear .venv
// 原因: BUG-677 Python 3.14 FileExistsError on reused hostexecutor .venv
assert.match(workflow, /rm -rf -- \.venv\n\s+python3 -m venv --clear \.venv/);
assert.doesNotMatch(workflow, /python3 -m venv \.venv(?:\s|$)/);
assert.match(workflow, /PIP_INDEX_URL: https:\/\/mirrors\.aliyun\.com\/pypi\/simple\//);
assert.match(workflow, /NPM_CONFIG_REGISTRY: https:\/\/registry\.npmmirror\.com/);
for (const constraint of [
@@ -272,6 +276,8 @@ test("Gitea quality gate validates before publishing an immutable ACR manifest",
const installStep = workflow.match(
/- name: Install dependencies[\s\S]*?(?=\n\s+- name: Validate backend, package, frontend, and database contracts)/,
)?.[0] ?? "";
assert.match(installStep, /rm -rf -- \.venv/);
assert.match(installStep, /python3 -m venv --clear \.venv/);
assert.match(installStep, /workdir="\$\(pwd -P\)"/);
assert.match(installStep, /docker run --rm/);
assert.doesNotMatch(installStep, /timeout --signal=TERM --kill-after=30s 900s docker run/);