Skip to content

Commit

Permalink
WIP: Bzlmod part the one hundred thirty-fifth
Browse files Browse the repository at this point in the history
Update tests for Bazel 6 + Bzlmod

Copied the regular expression used to optionally match canonical repo
name prefixes in `buildozer` commands from bazelbuild#1622. These never failed
when building with Bzlmod and Bazel 7.4.1, but did under Bazel 6.5.0.
  • Loading branch information
mbland committed Dec 11, 2024
1 parent e89e12d commit 32fc278
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test/shell/test_scala_library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ test_scala_library_expect_failure_on_missing_direct_internal_deps() {
}

test_scala_library_expect_failure_on_missing_direct_external_deps_jar() {
dependenecy_target='@com_google_guava_guava_21_0//:com_google_guava_guava_21_0'
dependenecy_target='@[a-z_.~+-]*com_google_guava_guava_21_0//:com_google_guava_guava_21_0'
test_target='test_expect_failure/missing_direct_deps/external_deps:transitive_external_dependency_user'

test_scala_library_expect_failure_on_missing_direct_deps $dependenecy_target $test_target
}

test_scala_library_expect_failure_on_missing_direct_external_deps_file_group() {
dependenecy_target='@com_google_guava_guava_21_0_with_file//:com_google_guava_guava_21_0_with_file'
dependenecy_target='@[a-z_.~+-]*com_google_guava_guava_21_0_with_file//:com_google_guava_guava_21_0_with_file'
test_target='test_expect_failure/missing_direct_deps/external_deps:transitive_external_dependency_user_file_group'

test_scala_library_expect_failure_on_missing_direct_deps $dependenecy_target $test_target
Expand Down
2 changes: 1 addition & 1 deletion test/shell/test_strict_dependency.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ test_strict_deps_filter_excluded_target() {

test_strict_deps_filter_included_target() {
local test_target="//test_expect_failure/missing_direct_deps/filtering:b"
local expected_message="buildozer 'add deps @com_google_guava_guava_21_0//:com_google_guava_guava_21_0' ${test_target}"
local expected_message="buildozer 'add deps @[a-z_.~+-]*com_google_guava_guava_21_0//:com_google_guava_guava_21_0' ${test_target}"

test_expect_failure_or_warning_on_missing_direct_deps_with_expected_message \
"${expected_message}" ${test_target} \
Expand Down
2 changes: 1 addition & 1 deletion test/shell/test_unused_dependency.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ test_unused_deps_filter_excluded_target() {

test_unused_deps_filter_included_target() {
local test_target="//test_expect_failure/unused_dependency_checker/filtering:b"
local expected_message="buildozer 'remove deps @com_google_guava_guava_21_0//:com_google_guava_guava_21_0' ${test_target}"
local expected_message="buildozer 'remove deps @[a-z_.~+-]*com_google_guava_guava_21_0//:com_google_guava_guava_21_0' ${test_target}"

test_expect_failure_or_warning_on_missing_direct_deps_with_expected_message \
"${expected_message}" ${test_target} \
Expand Down

0 comments on commit 32fc278

Please sign in to comment.