Skip to content

Commit cea5db3

Browse files
authored
Fix module selection check (#2095)
1 parent ede572e commit cea5db3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

buildkite/bazel-central-registry/bcr_compatibility.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,18 +92,17 @@ def select_modules_from_env_vars():
9292

9393
def get_target_modules():
9494
"""
95-
If the `MODULE_SELECTIONS` and `SMOKE_TEST_PERCENTAGE(S)` are specified, calculate the target modules from those env vars.
96-
Otherwise, calculate target modules based on changed files from the main branch.
95+
Returns a list of selected module versions.
9796
"""
98-
if "MODULE_SELECTIONS" not in os.environ:
99-
raise ValueError("Please set MODULE_SELECTIONS env var to select modules for testing!")
97+
if "MODULE_SELECTIONS" not in os.environ and "SELECT_TOP_BCR_MODULES" not in os.environ:
98+
raise ValueError("Please set MODULE_SELECTIONS or SELECT_TOP_BCR_MODULES env var to select modules for testing!")
10099

101100
modules = select_modules_from_env_vars()
102101
if modules:
103102
bazelci.print_expanded_group("The following modules are selected:\n\n%s" % "\n".join([f"{name}@{version}" for name, version in modules]))
104103
return sorted(list(set(modules)))
105104
else:
106-
raise ValueError("MODULE_SELECTIONS env var didn't select any modules!")
105+
raise ValueError("No modules were selected, please set MODULE_SELECTIONS or SELECT_TOP_BCR_MODULES correctly!")
107106

108107

109108
def create_step_for_report_flags_results():

0 commit comments

Comments
 (0)