Skip to content

Commit 94035ba

Browse files
committed
no-mistakes(test): apply changes made during test validation
1 parent 8235e46 commit 94035ba

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

‎scripts/test-ci-lane-selection.sh‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ tmp="$(mktemp -d "${DEV_SCRATCH:-${TMPDIR:-/tmp}}/ci-lane-selection.XXXXXX")"
7777
trap 'rm -rf "$tmp"' EXIT
7878
git init -q -b main "$tmp/repo" || { echo "FAIL: cannot create a throwaway repository" >&2; exit 1; }
7979
mkdir -p "$tmp/repo/scripts" "$tmp/repo/server/python" "$tmp/repo/server/typescript" "$tmp/repo/docs"
80-
cp scripts/ci-local.sh scripts/ci-select-lanes.sh scripts/ci-lane-map.txt "$tmp/repo/scripts/"
80+
cp scripts/ci-local.sh scripts/ci-select-lanes.sh scripts/ci-lane-map.txt scripts/ci-affected-ports.sh "$tmp/repo/scripts/"
8181
echo a > "$tmp/repo/server/python/a.py"; echo a > "$tmp/repo/server/typescript/a.ts"; echo a > "$tmp/repo/docs/a.md"
8282
git -C "$tmp/repo" add -A
8383
git -C "$tmp/repo" -c user.name=t -c user.email=t@example.invalid commit -q -m base
@@ -109,6 +109,19 @@ check "python ts" "$(plan | lane_blocks)" "python and ty
109109
check "yes" "$(plan | grep 'run as parallel lanes' >/dev/null && echo yes || echo no)" "several groups are announced as parallel"
110110
check "" "$(plan MO_CI_AFFECTED_BASE=HEAD~2 | lane_blocks)" "one group (typescript, the docs adds none) stays serial"
111111
check "yes" "$(plan MO_CI_AFFECTED_BASE=HEAD~2 | grep 'ts build + typecheck' >/dev/null && echo yes || echo no)" "the serial plan still lists typescript's steps"
112+
# A rename's OLD path counts too (ci-affected-ports.sh diffs with --no-renames, like
113+
# changed_paths does): moving a file OUT of a path that maps broader than its destination
114+
# must select what the old path affects, not only the new one. Before --no-renames this
115+
# printed 'java', silently dropping the ts/python/csharp lanes agent-context selects.
116+
# (Before the `map` corruption below, which widens every later selection to ALL on purpose.)
117+
mkdir -p "$tmp/repo/agent-context/skills" "$tmp/repo/server/java"
118+
echo s > "$tmp/repo/agent-context/skills/x.md"; commit shared
119+
git -C "$tmp/repo" mv agent-context/skills/x.md server/java/x.md; commit rename-into-java
120+
ports() { ( cd "$tmp/repo" && scripts/ci-affected-ports.sh "$(git rev-parse HEAD~1)" HEAD ); }
121+
check "ts java python csharp" "$(ports)" "git: a rename out of agent-context still selects every port"
122+
git -C "$tmp/repo" mv server/java/x.md server/python/x.py; commit rename-java-to-python
123+
check "java python" "$(ports)" "git: a rename between ports selects both"
124+
112125
echo b >> "$tmp/repo/scripts/ci-lane-map.txt"; commit map
113126
check "$ALL" "$(run)" "git: editing the map selects every lane"
114127
# --affected is a selector; combining it with the other selectors is refused, not guessed at.

0 commit comments

Comments
 (0)