Skip to content

Commit

Permalink
Test with all deps
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum committed Dec 30, 2024
1 parent f733960 commit 0398bd8
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 16 deletions.
1 change: 1 addition & 0 deletions modules/googleapis-grpc-cc/0.1.0/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module(
)

bazel_dep(name = "googleapis", version = "0.0.0-20241220-5e258e33")
bazel_dep(name = "googleapis-cc", version = "0.1.0")
bazel_dep(name = "grpc", version = "1.69.0")

switched_rules = use_extension("@googleapis//private/extensions:switched_rules.bzl", "switched_rules")
Expand Down
2 changes: 1 addition & 1 deletion modules/googleapis-grpc-cc/0.1.0/source.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"integrity": "sha256-hznHbmgfkAkjuQDJ3w73XPQh05yrtUZQxLmtGbanbYU=",
"url": "https://github.com/fmeum/bazel-central-registry/releases/download/v1.0.0/empty.zip",
"overlay": {
"MODULE.bazel": "sha256-OtTzO+YModGNxMzZm53YuAcqKpIRv92mY0g/xFb4Wdc="
"MODULE.bazel": "sha256-1ZTbiLjlnPN92Io8vy6Bac58gc46ZCaPItM1FTahlU8="
}
}
1 change: 1 addition & 0 deletions modules/googleapis-grpc-java/0.1.0/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module(
)

bazel_dep(name = "googleapis", version = "0.0.0-20241220-5e258e33")
bazel_dep(name = "googleapis-java", version = "0.1.0")
bazel_dep(name = "grpc-java", version = "1.66.0")

switched_rules = use_extension("@googleapis//private/extensions:switched_rules.bzl", "switched_rules")
Expand Down
2 changes: 1 addition & 1 deletion modules/googleapis-grpc-java/0.1.0/source.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"integrity": "sha256-hznHbmgfkAkjuQDJ3w73XPQh05yrtUZQxLmtGbanbYU=",
"url": "https://github.com/fmeum/bazel-central-registry/releases/download/v1.0.0/empty.zip",
"overlay": {
"MODULE.bazel": "sha256-6OS1YB5nWgVsNnucanTpPJ9n+eF2Xy2VS/sJF53lIs0="
"MODULE.bazel": "sha256-Jt7vfm3iIYxTxHAzqYzdbQ/gaJbfvK1trB6cb+1trNQ="
}
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
load(":failure_test.bzl", "cc_proto_library_fails_with_message_test")
load(":failure_test.bzl", "php_proto_library_fails_with_message_test")

alias(
name = "bytestream_proto",
actual = "@googleapis//google/bytestream:bytestream_proto",
)

alias(
name = "bytestream_java_proto",
actual = "@googleapis//google/bytestream:bytestream_java_proto",
name = "bytestream_cc_proto",
actual = "@googleapis//google/bytestream:bytestream_cc_proto",
)

alias(
name = "bytestream_go_proto",
actual = "@googleapis//google/bytestream:bytestream_go_proto",
)

alias(
name = "bytestream_java_proto",
actual = "@googleapis//google/bytestream:bytestream_java_proto",
)

alias(
name = "date_py_proto",
actual = "@googleapis//google/type:date_py_proto",
Expand All @@ -30,7 +35,7 @@ alias(
actual = "@googleapis//google/spanner/v1:spanner_java_grpc",
)

cc_proto_library_fails_with_message_test(
name = "bytestream_cc_proto_library_fails_with_message_test",
target_under_test = "@googleapis//google/bytestream:bytestream_cc_proto",
php_proto_library_fails_with_message_test(
name = "php_proto_library_fails_with_message_test",
target_under_test = "@googleapis//google/bytestream:bytestream_php_proto",
)
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "googleapis")
bazel_dep(name = "googleapis-cc", version = "0.1.0")
bazel_dep(name = "googleapis-go", version = "0.1.0")
bazel_dep(name = "googleapis-java", version = "0.1.0")
bazel_dep(name = "googleapis-python", version = "0.1.0")
bazel_dep(name = "googleapis-grpc-cc", version = "0.1.0")
bazel_dep(name = "googleapis-grpc-java", version = "0.1.0")
# Intentionally missing a dependency on googleapis-cc to test that it doesn't result in an error.

local_path_override(
module_name = "googleapis",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
load("@bazel_skylib//lib:unittest.bzl", "analysistest", "asserts")

def _cc_proto_library_fails_with_message_test_impl(ctx):
def _php_proto_library_fails_with_message_test_impl(ctx):
env = analysistest.begin(ctx)
asserts.expect_failure(env, """Add 'bazel_dep(name = "googleapis-cc", version = "0.1.0")' to your MODULE.bazel file to use 'cc_proto_library' targets in 'googleapis'.""")
asserts.expect_failure(env, """php_proto_library targets in googleapis are not supported with Bzlmod. If you need them, please file an issue at https://github.com/bazelbuild/bazel-central-registry.""")
return analysistest.end(env)

cc_proto_library_fails_with_message_test = analysistest.make(
_cc_proto_library_fails_with_message_test_impl,
php_proto_library_fails_with_message_test = analysistest.make(
_php_proto_library_fails_with_message_test_impl,
expect_failure = True,
)
6 changes: 3 additions & 3 deletions modules/googleapis/0.0.0-20241220-5e258e33/source.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"private/extensions/fail_macro.bzl": "sha256-Ux6k9i7qKn7Y0gT1LFnHZiTGuPid7m1p3PncsnK8/iU=",
"private/extensions/switched_rules.bzl": "sha256-v8KqUuRupCid/jMiny6J/qYgbP2uRORrnC9rIWOwCTE=",
"tests/bcr/.bazelrc": "sha256-hFZT+gits3VtXcUkKuh3NCEC9FgBNGuNxaOVCuOiFPk=",
"tests/bcr/BUILD.bazel": "sha256-SyxDBwLmV0c2ssGUSaHawNu8IDOXSGL/YaWsI4pnSbk=",
"tests/bcr/MODULE.bazel": "sha256-mBed9uTWcQM8aMMq9vOzprfoj6kmef5xj/Xl7PiDE6M=",
"tests/bcr/failure_test.bzl": "sha256-QV38fwhaAPQStLQr06YGR1NDE/lsgnTs4cDjR/oDpl8="
"tests/bcr/BUILD.bazel": "sha256-KZzDURLUNDOiMsurUHrnuWYogHPFs7W+Ar9ZrilPLuE=",
"tests/bcr/MODULE.bazel": "sha256-9jtnEIcXJpG7TmZll5BFHSm3Mpq3TA8bq4nei7K1M3w=",
"tests/bcr/failure_test.bzl": "sha256-pKImfWiY7m3EB1w0n4C66/LABDBwTYr/2nqxoC+gvBc="
}
}

0 comments on commit 0398bd8

Please sign in to comment.