fix(release): stop circular dry-run in fast release gate unit test
Memind CI / Test, build, and release guards (push) Successful in 3m36s

Replace the integration spawn that re-entered run_fast_release_guards with
static script checks so fast release guards can finish reliably.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-08-15 08:34:53 +08:00
parent be8ce867ca
commit fbd68a36e9
+9 -15
View File
@@ -129,22 +129,16 @@ test('production release rejects --skip-tests before repository or network prefl
assert.doesNotMatch(`${result.stdout}\n${result.stderr}`, /103 只读预检/);
});
test('fast production release allows --skip-tests but still requires check-release-ready', () => {
const result = spawnSync(
'bash',
[
path.join(ROOT, 'scripts', 'release-portal-runtime-prod.sh'),
'--mode',
'fast',
'--skip-tests',
'--skip-build',
'--dry-run',
],
{ cwd: ROOT, encoding: 'utf8' },
test('fast production release allows --skip-tests but still requires check-release-ready', async () => {
const source = await fs.readFile(
path.join(ROOT, 'scripts', 'release-portal-runtime-prod.sh'),
'utf8',
);
assert.notEqual(result.status, 0);
assert.doesNotMatch(result.stderr, /标准发布禁止 --skip-tests/);
assert.match(`${result.stdout}\n${result.stderr}`, /快速发布:跳过额外本地测试/);
assert.match(source, /ALLOW_MAIN_RELEASE=1 bash "\$\{ROOT\}\/scripts\/check-release-ready\.sh"/);
assert.match(source, /快速发布:跳过额外本地测试/);
const skipTestsBlockEnd = source.indexOf('fi\n\nif [[ "${DRY_RUN}" -eq 0 ]]; then');
const checkReleaseIdx = source.indexOf('check-release-ready.sh');
assert.ok(skipTestsBlockEnd >= 0 && checkReleaseIdx > skipTestsBlockEnd);
});
test('fast release wrapper delegates to runtime prod script with --mode fast', async () => {