Skip to content

Commit c761106

Browse files
committed
Fix CBM_SKIP_PERF to only skip incremental delta tests, not tool tests
CBM_SKIP_PERF=1 now skips only phases 2-7 (incremental delta, stress, perf regression) inside the suite. Phase 1 (initial index) and phases 8-30 (135 tool integration tests) always run. This keeps ~2672 tests on CI vs the full ~2692 locally. Also fix Windows build: guard symlink() with #ifndef _WIN32.
1 parent 8349f81 commit c761106

2 files changed

Lines changed: 39 additions & 42 deletions

File tree

tests/test_incremental.c

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2771,40 +2771,48 @@ SUITE(incremental) {
27712771
return;
27722772
}
27732773

2774-
/* Phase 1: Full index baseline + performance */
2774+
int skip_perf = (getenv("CBM_SKIP_PERF") != NULL &&
2775+
getenv("CBM_SKIP_PERF")[0] != '0' &&
2776+
getenv("CBM_SKIP_PERF")[0] != '\0');
2777+
2778+
/* Phase 1: Full index baseline (needed for tool tests below) */
27752779
RUN_TEST(incr_full_index);
27762780
RUN_TEST(incr_full_has_functions);
27772781
RUN_TEST(incr_full_edge_types);
27782782

2779-
/* Phase 2: Noop */
2780-
RUN_TEST(incr_noop_reindex);
2781-
2782-
/* Phase 3: Incremental deltas */
2783-
RUN_TEST(incr_modify_file);
2784-
RUN_TEST(incr_formatter_run);
2785-
RUN_TEST(incr_add_file);
2786-
RUN_TEST(incr_delete_file);
2787-
RUN_TEST(incr_simultaneous_changes);
2788-
2789-
/* Phase 4: Adversarial */
2790-
RUN_TEST(incr_empty_file);
2791-
RUN_TEST(incr_syntax_error);
2792-
RUN_TEST(incr_huge_single_function);
2793-
RUN_TEST(incr_binary_content);
2794-
RUN_TEST(incr_large_generated);
2795-
RUN_TEST(incr_new_subdir);
2796-
2797-
/* Phase 5: Stress */
2798-
RUN_TEST(incr_rapid_reindex);
2799-
RUN_TEST(incr_replace_file_content);
2800-
RUN_TEST(incr_batch_add_delete);
2801-
2802-
/* Phase 6: Recovery + accuracy */
2803-
RUN_TEST(incr_db_deleted_recovery);
2804-
RUN_TEST(incr_accuracy_vs_full);
2805-
2806-
/* Phase 7: Performance regression */
2807-
RUN_TEST(incr_perf_single_file_fast);
2783+
if (!skip_perf) {
2784+
/* Phase 2: Noop */
2785+
RUN_TEST(incr_noop_reindex);
2786+
2787+
/* Phase 3: Incremental deltas */
2788+
RUN_TEST(incr_modify_file);
2789+
RUN_TEST(incr_formatter_run);
2790+
RUN_TEST(incr_add_file);
2791+
RUN_TEST(incr_delete_file);
2792+
RUN_TEST(incr_simultaneous_changes);
2793+
2794+
/* Phase 4: Adversarial */
2795+
RUN_TEST(incr_empty_file);
2796+
RUN_TEST(incr_syntax_error);
2797+
RUN_TEST(incr_huge_single_function);
2798+
RUN_TEST(incr_binary_content);
2799+
RUN_TEST(incr_large_generated);
2800+
RUN_TEST(incr_new_subdir);
2801+
2802+
/* Phase 5: Stress */
2803+
RUN_TEST(incr_rapid_reindex);
2804+
RUN_TEST(incr_replace_file_content);
2805+
RUN_TEST(incr_batch_add_delete);
2806+
2807+
/* Phase 6: Recovery + accuracy */
2808+
RUN_TEST(incr_db_deleted_recovery);
2809+
RUN_TEST(incr_accuracy_vs_full);
2810+
2811+
/* Phase 7: Performance regression */
2812+
RUN_TEST(incr_perf_single_file_fast);
2813+
} else {
2814+
printf(" [phases 2-7 SKIPPED — CBM_SKIP_PERF=1]\n");
2815+
}
28082816

28092817
/* Phase 8: list_projects + index_status + schema */
28102818
RUN_TEST(tool_list_projects_basic);

tests/test_main.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ int tf_skip_count = 0;
1010

1111
#include "test_framework.h"
1212
#include <sqlite3.h>
13-
#include <stdlib.h>
1413

1514
/* Forward declarations of suite functions */
1615
extern void suite_arena(void);
@@ -56,13 +55,7 @@ extern void suite_yaml(void);
5655
extern void suite_integration(void);
5756
extern void suite_incremental(void);
5857

59-
static int env_is_set(const char *name) {
60-
const char *v = getenv(name);
61-
return v && v[0] && v[0] != '0';
62-
}
63-
6458
int main(void) {
65-
int skip_perf = env_is_set("CBM_SKIP_PERF");
6659
printf("\n codebase-memory-mcp C test suite\n");
6760

6861
/* Foundation */
@@ -153,11 +146,7 @@ int main(void) {
153146

154147
/* Integration (end-to-end) */
155148
RUN_SUITE(integration);
156-
if (!skip_perf) {
157-
RUN_SUITE(incremental);
158-
} else {
159-
printf("\n=== incremental (SKIPPED — CBM_SKIP_PERF=1) ===\n");
160-
}
149+
RUN_SUITE(incremental);
161150

162151
/* Release sqlite3 internal caches so ASan doesn't report them as leaks */
163152
sqlite3_shutdown();

0 commit comments

Comments
 (0)