You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a test to verify the list of expected modules in the default lock file.
This test will help us be more aware of what transitive dependencies are introduced by `@bazel_tools`, we should keep the list of modules as small as possible because they are dependencies of all Bazel users, although fetched lazily.
PiperOrigin-RevId: 690616792
Change-Id: I50aec1fce87bae108cb2f6cb315c75c0ef0c7a4c
|| { echo"integration_test_setup.sh not found!">&2;exit 1; }
31
31
32
+
# List of expected modules in the default lock file.
33
+
# You may need to update this list if MODULE.tools changes,
34
+
# but we should keep the list as small as possible because
35
+
# they are tranitive dependencies for all Bazel users (although fetched lazily).
36
+
expected_modules=(
37
+
abseil-cpp
38
+
bazel_features
39
+
bazel_skylib
40
+
buildozer
41
+
googletest
42
+
jsoncpp
43
+
platforms
44
+
protobuf
45
+
rules_cc
46
+
rules_java
47
+
rules_jvm_external
48
+
rules_license
49
+
rules_pkg
50
+
rules_proto
51
+
rules_python
52
+
rules_shell
53
+
stardoc
54
+
zlib
55
+
)
56
+
32
57
functiontest_verify_lock_file() {
33
58
rm -f MODULE.bazel
34
59
touch MODULE.bazel
@@ -37,6 +62,10 @@ function test_verify_lock_file() {
37
62
bazel mod deps --lockfile_mode=update
38
63
diff -u $(rlocation io_bazel/src/test/tools/bzlmod/MODULE.bazel.lock) MODULE.bazel.lock || fail "Default lockfile for empty workspace is no longer in sync with MODULE.tools. Please run \"bazel run //src/test/tools/bzlmod:update_default_lock_file\""
39
64
65
+
# Verify the list of expected modules in the lock file.
diff -u <(printf '%s\n'"${expected_modules[@]}"| sort) actual_modules || fail "Expected modules in lockfile do not match the actual modules. Please update 'expected_modules' if necessary."
68
+
40
69
# Verify if python toolchain version matches Bazel's lock file to ensure it's cached in integration tests.
41
70
# Check strings like `"default_version": "3.11"`` for default python version.
0 commit comments