Skip to content

Commit ec16764

Browse files
committed
fix(test): convert forbidden SKIP()s in the complexity suite to policy forms
The no-skips lint gate (scripts/check-no-test-skips.sh) rightly rejected the throughput-report test's two SKIP() calls: - CBM_SKIP_PERF=1 is deliberate operator configuration, not a hidden environment failure: reporting is off by request, so the test PASSes with a stderr note instead of skipping. - an uncreatable report dir IS an environment failure and now FAILs with the remedy in the message (set CBM_COMPLEXITY_REPORT_DIR), per the policy text. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent f95fe55 commit ec16764

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎tests/test_complexity.c‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,12 @@ TEST(complexity_shared_package_growth_stays_linear) {
609609
TEST(complexity_throughput_report_written) {
610610
const char *skip_perf = getenv("CBM_SKIP_PERF");
611611
if (skip_perf && skip_perf[0] == '1') {
612-
SKIP("CBM_SKIP_PERF: throughput rates are meaningless under CPU starvation");
612+
/* Deliberate operator config, not a hidden environment failure
613+
* (no-skips policy): rates measured under CBM_SKIP_PERF starvation
614+
* would only mislead, so reporting is OFF and there is nothing left
615+
* for this test to assert. */
616+
fprintf(stderr, " [complexity] CBM_SKIP_PERF=1: throughput report disabled by config\n");
617+
PASS();
613618
}
614619
if (cx_measure_pair() != 0) {
615620
FAIL("failed to build/run the complexity corpus pair");
@@ -619,7 +624,7 @@ TEST(complexity_throughput_report_written) {
619624
dir = "private/benchmarks";
620625
}
621626
if (th_mkdir_p(dir) != 0) {
622-
SKIP("report dir not creatable here (read-only checkout?)");
627+
FAIL("report dir not creatable (set CBM_COMPLEXITY_REPORT_DIR to a writable path)");
623628
}
624629
char path[1024];
625630
snprintf(path, sizeof(path), "%s/complexity-%lld.json", dir, (long long)time(NULL));

0 commit comments

Comments
 (0)