Skip to content

Commit

Permalink
Make sure bazel_rules_* tests work with --enable_workspace=false
Browse files Browse the repository at this point in the history
A part of #23087

Working towards: #23023

PiperOrigin-RevId: 660787082
Change-Id: Iad10e9795db06421c104e149bd2e695262ff225b
  • Loading branch information
meteorcloudy authored and copybara-github committed Aug 8, 2024
1 parent e377515 commit e5b8f5a
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 88 deletions.
3 changes: 2 additions & 1 deletion src/test/shell/bazel/bazel_rules_cc_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,12 @@ filegroup(name = 'yolo')
EOF

cd rules_cc_can_be_overridden || fail "couldn't cd into workspace"
bazel build --noenable_bzlmod @rules_cc//:yolo &> $TEST_log || \
bazel build --noenable_bzlmod --enable_workspace @rules_cc//:yolo &> $TEST_log || \
fail "Bazel failed to build @rules_cc"
}

function test_rules_cc_repository_builds_itself() {
add_rules_cc "MODULE.bazel"
write_default_bazelrc

# We test that a built-in @rules_cc repository is buildable.
Expand Down
4 changes: 2 additions & 2 deletions src/test/shell/bazel/bazel_rules_java_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ def rules_java_toolchains():
EOF

cd rules_java_can_be_overridden || fail "couldn't cd into workspace"
bazel build --noenable_bzlmod @rules_java//:yolo &> $TEST_log || \
bazel build --noenable_bzlmod --enable_workspace @rules_java//:yolo &> $TEST_log || \
fail "Bazel failed to build @rules_java"
}

function test_rules_java_repository_builds_itself() {
add_rules_java "MODULE.bazel"
write_default_bazelrc
setup_skylib_support

# We test that a built-in @rules_java repository is buildable.
bazel build -- @rules_java//java/... &> $TEST_log \
Expand Down
Loading

0 comments on commit e5b8f5a

Please sign in to comment.