aboutsummaryrefslogtreecommitdiff
path: root/tests/bcr/MODULE.bazel
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bcr/MODULE.bazel')
-rw-r--r--tests/bcr/MODULE.bazel42
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/bcr/MODULE.bazel b/tests/bcr/MODULE.bazel
new file mode 100644
index 00000000..b774feb4
--- /dev/null
+++ b/tests/bcr/MODULE.bazel
@@ -0,0 +1,42 @@
+module(
+ name = "rules_go_bcr_tests",
+ # Test that the default SDK is registered by not registering one from the test module.
+ version = "1.2.3",
+)
+
+# Keep this dep first so that its toolchain takes precedence over the default SDK registered by
+# rules_go.
+bazel_dep(name = "other_module", version = "")
+local_path_override(
+ module_name = "other_module",
+ path = "other_module",
+)
+
+bazel_dep(name = "rules_go", version = "", repo_name = "my_rules_go")
+local_path_override(
+ module_name = "rules_go",
+ path = "../..",
+)
+
+bazel_dep(name = "gazelle", version = "0.26.0")
+bazel_dep(name = "protobuf", version = "3.19.6")
+
+go_sdk = use_extension("@my_rules_go//go:extensions.bzl", "go_sdk")
+go_sdk.download(version = "1.19.5")
+
+# Request an invalid SDK to verify that it isn't fetched since the first tag takes precedence.
+go_sdk.host(version = "3.0.0")
+
+# Bring the default SDK into scope to verify that it exists.
+use_repo(go_sdk, "go_default_sdk")
+
+# Bring the selected host compatible SDK into scope to verify that it exists.
+use_repo(go_sdk, "go_host_compatible_sdk_label")
+
+go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
+go_deps.module(
+ path = "google.golang.org/grpc",
+ sum = "h1:fPVVDxY9w++VjTZsYvXWqEf9Rqar/e+9zYfxKK+W+YU=",
+ version = "v1.50.0",
+)
+use_repo(go_deps, "org_golang_google_grpc")