Skip to content

Commit 5bb0458

Browse files
comiuscopybara-github
authored andcommitted
Port proto_library tests to Starlark
Upgrade bazel_features. Flipping experimental flag in a test is only supported on Bazel 8. Upgrade rules_testing to 0.9.0. basename() is only available with latest release. test_descriptor_set_output_strict_deps_default was dropped. PiperOrigin-RevId: 792567553
1 parent 15c9e9a commit 5bb0458

File tree

6 files changed

+791
-8
lines changed

6 files changed

+791
-8
lines changed

MODULE.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ bazel_dep(name = "zlib", version = "1.3.1.bcr.5")
3636
#endif // PROTO2_OPENSOURCE
3737

3838
# other dependencies
39-
bazel_dep(name = "bazel_features", version = "1.23.0", repo_name = "proto_bazel_features")
39+
bazel_dep(name = "bazel_features", version = "1.33.0", repo_name = "proto_bazel_features")
4040
bazel_dep(name = "bazel_skylib", version = "1.7.1")
4141
bazel_dep(name = "jsoncpp", version = "1.9.6")
4242
bazel_dep(name = "rules_java", version = "8.6.1")
@@ -250,7 +250,7 @@ use_repo(protobuf_maven_dev, "protobuf_maven_dev")
250250

251251
bazel_dep(name = "googletest", version = "1.15.2", dev_dependency = True)
252252
bazel_dep(name = "rules_buf", version = "0.3.0", dev_dependency = True)
253-
bazel_dep(name = "rules_testing", version = "0.8.0", dev_dependency = True)
253+
bazel_dep(name = "rules_testing", version = "0.9.0", dev_dependency = True)
254254
bazel_dep(
255255
name = "abseil-py",
256256
version = "2.1.0",

WORKSPACE

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,9 @@ protobuf_v25_deps()
311311

312312
http_archive(
313313
name = "rules_testing",
314-
sha256 = "89feaf18d6e2fc07ed7e34510058fc8d48e45e6d2ff8a817a718e8c8e4bcda0e",
315-
strip_prefix = "rules_testing-0.8.0",
316-
url = "https://github.com/bazelbuild/rules_testing/releases/download/v0.8.0/rules_testing-v0.8.0.tar.gz",
314+
sha256 = "281b69eed71e2b95cefc284ee5a1a9f7c5088141b58f2508be910eb22f13b986",
315+
strip_prefix = "rules_testing-0.9.0",
316+
url = "https://github.com/bazelbuild/rules_testing/releases/download/v0.9.0/rules_testing-v0.9.0.tar.gz",
317317
)
318318

319319
# For checking breaking changes to well-known types from the previous release version.

bazel/private/proto_bazel_features.bzl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ _PROTO_BAZEL_FEATURES = """bazel_features = struct(
1414
proto = struct(
1515
starlark_proto_info = {starlark_proto_info},
1616
),
17+
rules = struct(
18+
analysis_tests_can_transition_on_experimental_incompatible_flags = {analysis_tests_can_transition_on_experimental_incompatible_flags},
19+
),
1720
globals = struct(
1821
PackageSpecificationInfo = {PackageSpecificationInfo},
1922
ProtoInfo = getattr(getattr(native, 'legacy_globals', None), 'ProtoInfo', {ProtoInfo}),
@@ -53,6 +56,8 @@ exports_files(["features.bzl"])
5356
protobuf_on_allowlist = repr(protobuf_on_allowlist),
5457
ProtoInfo = ProtoInfo,
5558
cc_proto_aspect = cc_proto_aspect,
59+
analysis_tests_can_transition_on_experimental_incompatible_flags =
60+
"True" if major_version_int > 8 or (major_version_int == 8 and minor_version_int >= 2) else "False",
5661
))
5762

5863
proto_bazel_features = repository_rule(

bazel/tests/BUILD

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
load(":bazel_proto_library_tests.bzl", "bazel_proto_library_test_suite")
12
load(":java_proto_library_tests.bzl", "java_proto_library_test_suite")
23
load(":proto_common_check_collocated_tests.bzl", "proto_common_check_collocated_test_suite")
34
load(":proto_common_compile_tests.bzl", "proto_common_compile_test_suite")
@@ -14,4 +15,6 @@ proto_common_declare_generated_files_test_suite(name = "proto_common_declare_gen
1415

1516
proto_common_check_collocated_test_suite(name = "proto_common_check_collocated_test_suite")
1617

18+
bazel_proto_library_test_suite(name = "bazel_proto_library_test_suite")
19+
1720
java_proto_library_test_suite(name = "java_proto_library_test_suite")

0 commit comments

Comments
 (0)