run_tests: Stop treating non-workspace dirs as packages (#60502)
The `orchestrate` job maps changed directories to root-workspace package names, and when no mapping was found it fell back to using the raw directory name as a package. Because `tooling/lints` is a separate workspace (not a root-workspace member), a change under `tooling/lints/**` produced the filter `rdeps(lints)`, which `cargo nextest run --workspace` rejects with "operator didn't match any packages" — failing `run_tests` for any such PR. This drops that fallback so an unmapped directory falls through to the existing "no package changes → run all tests" path instead. Release Notes: - N/A
This commit is contained in:
1 parent
8d11484a35
commit
26c6d3aee6
2 files changed
+16
-6
No files matched your search
@@ -76,11 +76,16 @@ jobs:
|
||||
FILE_CHANGED_PKGS=""
|
||||
for dir in $CHANGED_DIRS; do
|
||||
pkg=$(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" ]; then
|
||||
FILE_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")
|
||||
fi
|
||||
done
|
||||
FILE_CHANGED_PKGS=$(echo "$FILE_CHANGED_PKGS" | grep -v '^$' | sort -u || true)
|
||||
|
||||
Reference in new issue
Block a user