Skip to content

Commit 5d27829

Browse files
authored
tests: fix example bzlmod coverage test for latest Bazel (#2119)
Bazel is changing its separate character from tilde (`~`) to plus (`+`) to address a performance issue on Windows. The test was using tilde to help match files of interest. To fix, have the test look for either tilde or plus. Fixes #2105
1 parent 825acde commit 5d27829

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/bzlmod/test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ def test_coverage_sys_path(self):
7171
first_coverage_index = None
7272
last_user_dep_index = None
7373
for i, path in enumerate(sys.path):
74-
if re.search("rules_python.*~pip~", path):
74+
if re.search("rules_python.*[~+]pip[~+]", path):
7575
last_user_dep_index = i
7676
if first_coverage_index is None and re.search(
77-
".*rules_python.*~python~.*coverage.*", path
77+
".*rules_python.*[~+]python[~+].*coverage.*", path
7878
):
7979
first_coverage_index = i
8080

@@ -85,8 +85,8 @@ def test_coverage_sys_path(self):
8585
+ f"it was not found.\nsys.path:\n{all_paths}",
8686
)
8787
self.assertIsNotNone(
88-
first_coverage_index,
89-
"Expected to find at least one uiser dep, "
88+
last_user_dep_index,
89+
"Expected to find at least one user dep, "
9090
+ "but none were found.\nsys.path:\n{all_paths}",
9191
)
9292
# we are running under the 'bazel coverage :test'

0 commit comments

Comments
 (0)