Skip to content

Commit fcba61a

Browse files
committed
fix: load test helpers via the shim for WORKSPACE builds
The test bzl loaded @rules_runfiles_group directly, but that repo is only defined where the feature is available (bzlmod, Bazel 9+). Route the loads through the runfiles_groups_shim like the rule code does. The flag label from the shim is canonicalized via Label() so rules_testing's transition can resolve it.
1 parent 1d1dcc2 commit fcba61a

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

tests/runfiles_groups/runfiles_groups_tests.bzl

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,16 @@
1414
"""Tests for RunfilesGroupInfo support (--runfiles_groups)."""
1515

1616
load("@rules_python_internal//:rules_python_config.bzl", rp_config = "config")
17-
load("@rules_runfiles_group//runfiles_group:lib.bzl", "runfiles_groups")
18-
load("@rules_runfiles_group//runfiles_group:providers.bzl", "RunfilesGroupInfo")
17+
18+
# Loaded via the shim, not from @rules_runfiles_group directly: the repo is
19+
# only defined for Bazel versions where the feature is available (see
20+
# runfiles_groups_shim in internal_config_repo.bzl).
21+
load(
22+
"@rules_python_internal//:runfiles_groups_shim.bzl",
23+
"ENABLED_FLAG_LABEL",
24+
"RunfilesGroupInfo",
25+
"runfiles_groups",
26+
)
1927
load("@rules_testing//lib:analysis_test.bzl", "analysis_test")
2028
load("@rules_testing//lib:test_suite.bzl", "test_suite")
2129
load("@rules_testing//lib:util.bzl", rt_util = "util")
@@ -25,7 +33,7 @@ load("//python/private:runfiles_groups.bzl", "PyRunfilesGroupsInfo") # buildifi
2533

2634
_tests = []
2735

28-
_UPSTREAM_FLAG = str(Label("@rules_runfiles_group//runfiles_group:enabled"))
36+
_UPSTREAM_FLAG = str(Label(ENABLED_FLAG_LABEL))
2937
_RULES_PYTHON_FLAG = str(Label("//python/config_settings:runfiles_groups"))
3038

3139
_ENABLED = {_UPSTREAM_FLAG: True}

0 commit comments

Comments
 (0)