Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
run_tests: Stop treating non-workspace dirs as packages (#60502)
Richard Feldman52bc5a0488d4
diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.ymlindex 1b8f416baab..319c7290dd7 100644--- a/.github/workflows/run_tests.yml+++ b/.github/workflows/run_tests.yml@@ -76,11 +76,16 @@ jobs:FILE_CHANGED_PKGS=""for dir in $CHANGED_DIRS; dopkg=$(echo "$DIR_TO_PKG" | grep "^${dir}=" | cut -d= -f2 | head -1 || true)+ # Only add directories that map to a real root-workspace package.+ # Some directories (e.g. tooling/lints) belong to a separate workspace+ # and are not root members, so they have no mapping here. Previously we+ # fell back to the raw directory name, which fabricated a bogus package+ # (e.g. "lints") and produced a nextest filter like rdeps(lints) that+ # hard-errors ("operator didn't match any packages"). Skipping such+ # directories leaves the package set empty, which falls through to the+ # "run all tests" path below.if [ -n "$pkg" ]; thenFILE_CHANGED_PKGS=$(printf '%s\n%s' "$FILE_CHANGED_PKGS" "$pkg")- else- # Fall back to directory name if no mapping found- FILE_CHANGED_PKGS=$(printf '%s\n%s' "$FILE_CHANGED_PKGS" "$dir")fidoneFILE_CHANGED_PKGS=$(echo "$FILE_CHANGED_PKGS" | grep -v '^$' | sort -u || true)diff --git a/tooling/xtask/src/tasks/workflows/run_tests.rs b/tooling/xtask/src/tasks/workflows/run_tests.rsindex 84dc6692392..62043c545aa 100644--- a/tooling/xtask/src/tasks/workflows/run_tests.rs+++ b/tooling/xtask/src/tasks/workflows/run_tests.rs@@ -222,11 +222,16 @@ fn orchestrate_impl(rules: &[&PathCondition], target: OrchestrateTarget) -> NameFILE_CHANGED_PKGS=""for dir in $CHANGED_DIRS; dopkg=$(echo "$DIR_TO_PKG" | grep "^${dir}=" | cut -d= -f2 | head -1 || true)+ # Only add directories that map to a real root-workspace package.+ # Some directories (e.g. tooling/lints) belong to a separate workspace+ # and are not root members, so they have no mapping here. Previously we+ # fell back to the raw directory name, which fabricated a bogus package+ # (e.g. "lints") and produced a nextest filter like rdeps(lints) that+ # hard-errors ("operator didn't match any packages"). Skipping such+ # directories leaves the package set empty, which falls through to the+ # "run all tests" path below.if [ -n "$pkg" ]; thenFILE_CHANGED_PKGS=$(printf '%s\n%s' "$FILE_CHANGED_PKGS" "$pkg")- else- # Fall back to directory name if no mapping found- FILE_CHANGED_PKGS=$(printf '%s\n%s' "$FILE_CHANGED_PKGS" "$dir")fidoneFILE_CHANGED_PKGS=$(echo "$FILE_CHANGED_PKGS" | grep -v '^$' | sort -u || true)