1

ci/test: add tests for exact expected artifacts.

Cache reuse in zig is currently quite fragile (we are using a forked
version with github.com/ziglang/zig/issues/13051), so ensure that it
does not regress when zig SDK upgrades.
This commit is contained in:
Motiejus Jakštys
2022-10-13 12:39:17 +03:00
parent eba4adbbb4
commit 7383c4984e
2 changed files with 18 additions and 2 deletions

17
ci/test
View File

@@ -1,2 +1,15 @@
#!/bin/sh
exec bazel test "$@" ...
#!/usr/bin/env bash
set -euo pipefail
bazel test "$@" ...
# /tmp/bazel-zig-cc should be empty for the test below to be valid.
# This test ensures that github.com/ziglang/zig/issues/13050 does not
# regress from a "very high"-level perspective.
find /tmp/bazel-zig-cc -name mutex_destructor.o -execdir file {} \; | \
sort | uniq -c | sort -rn > /tmp/got_cache
diff -u ci/testdata/want_cache /tmp/got_cache || {
>&2 echo "ERROR: unexpected artifacts."
>&2 echo "Was /tmp/bazel-zig-cc empty before the test?"
}