fix(#641): teach --files-from to expand bare suite tokens (#647)

When ci-test-scope falls back to the 'unit' sentinel (#408 intent) and
ci-prepare-test-scope writes it verbatim, run-tests --files-from received
a bare 'unit' token that was not a filename, causing exit 2 with
"requested test file(s) not found: unit".

selectExplicitFiles() now recognises any SUITES member and delegates to
the existing selectFiles() resolver before the path-existence check,
reusing the suite expansion logic rather than reimplementing it.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-06-03 10:11:52 -04:00
committed by GitHub
parent b38ae41243
commit a41d8d0cf6
2 changed files with 158 additions and 1 deletions

View File

@@ -161,7 +161,15 @@ function selectExplicitFiles(allFiles, filesValue, filesFrom) {
const selected = [];
const missing = [];
for (const file of requested) {
if (available.has(file)) {
// If the token is a bare suite name (e.g. "unit" written by ci-test-scope
// as the #408 fallback sentinel), delegate to the existing suite resolver
// rather than treating it as a filename. This prevents the
// "requested test file(s) not found: unit" crash (#641).
if (SUITES.includes(file)) {
for (const f of selectFiles(allFiles, file)) {
selected.push(f);
}
} else if (available.has(file)) {
selected.push(file);
} else {
missing.push(file);