aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell/bazel/embedded_tools_deps_test.sh
diff options
context:
space:
mode:
authorGravatar Laszlo Csomor <laszlocsomor@google.com>2018-03-09 02:11:23 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2018-03-09 02:13:32 -0800
commitc14b3c6bc56a0b66d2e64f8fe7ba641119e478ae (patch)
tree18145cf2e931de279a80a2e7c82f82c969ca30d3 /src/test/shell/bazel/embedded_tools_deps_test.sh
parent9dac6736d811895a23b976d0af461cefd09afcd1 (diff)
Internal change
PiperOrigin-RevId: 188459395
Diffstat (limited to 'src/test/shell/bazel/embedded_tools_deps_test.sh')
-rwxr-xr-xsrc/test/shell/bazel/embedded_tools_deps_test.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/test/shell/bazel/embedded_tools_deps_test.sh b/src/test/shell/bazel/embedded_tools_deps_test.sh
index f609af82ca..27e13caac6 100755
--- a/src/test/shell/bazel/embedded_tools_deps_test.sh
+++ b/src/test/shell/bazel/embedded_tools_deps_test.sh
@@ -39,16 +39,17 @@ fi
# using the output of genquery //src/test/shell/bazel:embedded_tools_deps
# and removing everything under @bazel_tools because the exact contents of the
# latter depends on the bazel binary used to run the test.
+# Sort the targets for a deterministic diffing experience.
current_deps="${TEST_TMPDIR}/current_deps"
grep -v "^@bazel_tools//" \
"${TEST_SRCDIR}/io_bazel/src/test/shell/bazel/embedded_tools_deps" \
- >"${current_deps}"
+ | sort >"${current_deps}"
# Load the current allowed dependencies of //src:embedded_tools_srcs
allowed_deps=${testdata_path}/embedded_tools_srcs_deps
diff_result=$(diff -ay --suppress-common-lines ${current_deps} \
- ${allowed_deps}) || \
+ <(sort ${allowed_deps})) || \
fail "Dependencies of //src:embedded_tools_srcs are modified. The diff \
between the new dependencies and the current allowed dependencies is \
$(printf "\n${diff_result}\nThe new dependencies are ")$(cat ${current_deps})"