fix(test): pin the package.json change kind in shared-input selection tests

computePaidCaseSelection read the version-only exemption from git even when
changed files were injected, so the shared-input test failed on main and on
version-only branches. The exemption is now an optional input; the test pins
a real package.json change and covers the version-only case.
This commit is contained in:
garrytan committed 2026-09-29 14:44:17 +00:00
1 parent 99058ee3cd
commit a11b651827
2 files changed
+13 -2

No files matched your search

+9 -1
View File
@@ -13,7 +13,9 @@ const periodicIds = Object.keys(E2E_TOUCHFILES).filter(id => E2E_TIERS[id] === '
const judgeIds = Object.keys(LLM_JUDGE_TOUCHFILES).sort();
test.each(sharedInputs)('%s retains the full gate after native dependency registration', file => {
const result = computePaidCaseSelection({ profile: 'pr', env: {}, changedFiles: [file] });
// A package.json change beyond its version; the version-only exemption is
// decided from git history and would otherwise depend on the checkout.
const result = computePaidCaseSelection({ profile: 'pr', env: {}, changedFiles: [file], packageVersionOnly: false });
expect(result.coverage?.mode).toBe('full-fallback');
expect(result.selection.e2e).toEqual(gateIds);
expect(result.selection.judges).toEqual(judgeIds);
@@ -22,6 +24,12 @@ test.each(sharedInputs)('%s retains the full gate after native dependency regist
expect(result.coverage?.needsFullValidation).toBe(false);
});
test('a version-only package.json change does not restore the full gate', () => {
const result = computePaidCaseSelection({ profile: 'pr', env: {}, changedFiles: ['package.json'], packageVersionOnly: true });
expect(result.coverage?.mode).not.toBe('full-fallback');
expect(result.coverage?.reasons.join('\n')).not.toContain('Shared runtime/build inputs restore every gate case and judge: package.json');
});
test.each(sharedInputs)('%s broad policy is independent of native, judge and global maps', file => {
for (const registration of ['none', 'broad', 'fast', 'judge', 'global']) {
const maps: PrProfileMaps = {