Skip to content

Commit 7206849

Browse files
committed
ci: Add a way to run libm tests that would otherwise be skipped
Introduce a new directive `ci: test-libm` to ensure tests run.
1 parent c8f4d50 commit 7206849

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ci/ci-util.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,14 @@ class PrCfg:
8989
# spending huge amounts of CI time.
9090
allow_many_extensive: bool = False
9191

92+
# Run tests for `libm` that may otherwise be skipped due to no changed files.
93+
always_test_libm: bool = False
94+
9295
# String values of directive names
9396
DIR_ALLOW_REGRESSIONS: str = "allow-regressions"
9497
DIR_SKIP_EXTENSIVE: str = "skip-extensive"
9598
DIR_ALLOW_MANY_EXTENSIVE: str = "allow-many-extensive"
99+
DIR_TEST_LIBM: str = "test-libm"
96100

97101
# Default threshold
98102
MANY_EXTENSIVE_THRESHOLD: int = 20
@@ -107,6 +111,8 @@ def __init__(self, body: str):
107111
self.skip_extensive = True
108112
elif name == self.DIR_ALLOW_MANY_EXTENSIVE:
109113
self.allow_many_extensive = True
114+
elif name == self.DIR_TEST_LIBM:
115+
self.always_test_libm = True
110116
else:
111117
eprint(f"Found unexpected directive `{name}`")
112118
exit(1)
@@ -256,6 +262,10 @@ def may_skip_libm_ci(self) -> bool:
256262
eprint("Is a PR but couldn't load PrInfo")
257263
exit(1)
258264

265+
# Allow opting in to libm tests
266+
if pr.cfg.always_test_libm:
267+
return True
268+
259269
# By default, run if there are any changed files matching the pattern
260270
return all(not re.match(TRIGGER_LIBM_CI_FILE_PAT, str(f)) for f in self.changed)
261271

0 commit comments

Comments
 (0)