Skip to content

Commit e769d3a

Browse files
committed
review: validate GTEST_ARCH against the allowed spellings
1 parent b4f1d18 commit e769d3a

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

‎.gitlab/scripts/run-gtest-quarantine.sh‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ case "${SANITIZER_LC}" in
4040
asan|tsan|release) ;;
4141
*) echo "SANITIZER_LC must be one of: asan, tsan, release (got '${SANITIZER_LC}')" >&2; exit 1 ;;
4242
esac
43+
# GTEST_ARCH builds the quarantine cell string; a runner-tag spelling (arm64)
44+
# or typo would match no entry and silently mute nothing on that job.
45+
case "${GTEST_ARCH}" in
46+
amd64|aarch64) ;;
47+
*) echo "GTEST_ARCH must be one of: amd64, aarch64 (got '${GTEST_ARCH}')" >&2; exit 1 ;;
48+
esac
4349

4450
HERE=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
4551
REPO_ROOT=$(cd "${HERE}/../.." && pwd)

‎.gitlab/scripts/tests/test_run_gtest_quarantine.sh‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,20 @@ else
268268
pass "T14 the rejected value never touches the results path"
269269
fi
270270

271+
# T18 — a miswired GTEST_ARCH (e.g. the runner tag's arm64) must fail loudly:
272+
# the cell string it would build matches no quarantine entry and mutes
273+
# nothing silently.
274+
OUT=$( cd "${WORK}/repo" && \
275+
env SANITIZER_LC=asan GTEST_ARCH=arm64 \
276+
bash .gitlab/scripts/run-gtest-quarantine.sh 2> "${STDERR_FILE}" )
277+
RC=$?
278+
assert_rc 1 "T18 GTEST_ARCH=arm64 exits 1"
279+
if grep -q "must be one of: amd64, aarch64" "${STDERR_FILE}"; then
280+
pass "T18 stderr names the allowed arch spellings"
281+
else
282+
fail "T18: stderr missing the arch message, got: $(cat "${STDERR_FILE}")"
283+
fi
284+
271285
# T15 — the selector must anchor on the config directory: a "release_helper"
272286
# binary parked in an asan_other directory must not be swept into the
273287
# release cell. (The counterpart — an unprefixed binary inside a release_*

0 commit comments

Comments
 (0)