fix(release-gate): invalidate only the suite whose command file changed
Memind CI / Test, build, and release guards (push) Successful in 3m33s
Memind CI / Test, build, and release guards (push) Successful in 3m33s
A change to one run-release-gate script must not force every live and upgrade suite to rerun. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -13,9 +13,6 @@ export function commandFilesForSuite(suite) {
|
|||||||
export function suiteInvalidatedByChanges(suite, changedPaths) {
|
export function suiteInvalidatedByChanges(suite, changedPaths) {
|
||||||
const normalized = new Set((changedPaths ?? []).map((item) => String(item).replaceAll('\\', '/')));
|
const normalized = new Set((changedPaths ?? []).map((item) => String(item).replaceAll('\\', '/')));
|
||||||
if (normalized.has('release-gate/coverage.mjs')) return true;
|
if (normalized.has('release-gate/coverage.mjs')) return true;
|
||||||
if ([...normalized].some((relativePath) => relativePath.startsWith('scripts/run-release-gate-'))) {
|
|
||||||
return suite.command?.some((arg) => String(arg).includes('run-release-gate-')) ?? false;
|
|
||||||
}
|
|
||||||
return commandFilesForSuite(suite).some((filePath) => normalized.has(filePath));
|
return commandFilesForSuite(suite).some((filePath) => normalized.has(filePath));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -90,6 +90,14 @@ test('changing a suite command file invalidates that suite', () => {
|
|||||||
assert.equal(suiteInvalidatedByChanges(chatSuite, ['chat-router.test.mjs']), true);
|
assert.equal(suiteInvalidatedByChanges(chatSuite, ['chat-router.test.mjs']), true);
|
||||||
assert.equal(suiteInvalidatedByChanges(chatSuite, ['wechat-mp.mjs']), false);
|
assert.equal(suiteInvalidatedByChanges(chatSuite, ['wechat-mp.mjs']), false);
|
||||||
assert.equal(suiteInvalidatedByChanges(chatSuite, ['release-gate/coverage.mjs']), true);
|
assert.equal(suiteInvalidatedByChanges(chatSuite, ['release-gate/coverage.mjs']), true);
|
||||||
|
assert.equal(
|
||||||
|
suiteInvalidatedByChanges(liveSuite, ['scripts/run-release-gate-runtime-container.mjs']),
|
||||||
|
false,
|
||||||
|
);
|
||||||
|
assert.equal(
|
||||||
|
suiteInvalidatedByChanges(liveSuite, ['scripts/run-release-gate-page-data-scenarios.mjs']),
|
||||||
|
true,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('carryForwardScenario keeps prior evidence and marks reuse', () => {
|
test('carryForwardScenario keeps prior evidence and marks reuse', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user