yams/tests/integration/smoke/meson.build
Trevon 316ad040fb
Some checks failed
Fuzz Smoke / libFuzzer smoke (push) Has been cancelled
test(build): table-driven Catch2 registration and one suite vocabulary (#349)
* test(build): register standard Catch2 tests from a table

165 of the 224 test executables in tests/meson.build were the same nine-line
executable() block plus a test() call placed far away. Each one is now a row in
catch2_test_table, and one loop at the end of the file builds and registers
them. Rows keep their place, so the branches around them still gate them.

A pair was folded only when the executable used the standard kwargs, exactly one
test() used it, and both calls sat under the same if/else branch. Tests with
extra env, cpp_args or more than one registration stay hand-written.

meson introspect --tests --targets is identical before and after for Debug and
TSan (351 tests, 369 targets). It is identical for ASan (262 tests) except for
the order of meson's generated DYLD_LIBRARY_PATH entries.

Signed-off-by: trvon <me@trevon.dev>

* test(build): one suite vocabulary and a concurrency label

Suite labels were a mix of tiers, subsystems, ticket IDs (yams-3s4, pbi-009)
and spelling variants (connection_pool and connection-pool, plugin and
plugins). Ticket IDs are gone, yams-<x> is now <x>, labels are kebab-case,
and synonyms are merged.

54 tests now carry 'concurrency': their own sources start threads, spawn
coroutines or wait on condition variables. When several tests share one
executable, only those whose names point at concurrent behaviour get the
label. 47 of them run in the TSan lane.

Only labels changed. Tests, commands, env, timeouts and targets are identical
in meson introspect, and every tier suite (unit, integration, slow, bench,
stress, mobile, ...) selects the same tests under TSan and ASan.

Signed-off-by: trvon <me@trevon.dev>

---------

Signed-off-by: trvon <me@trevon.dev>
2026-10-25 20:54:44 -06:00

69 lines
2.4 KiB
Meson

# Integration smoke tests built as a small, isolated binary (Catch2-based)
integration_smoke_srcs = []
if tests_has_cli11
integration_smoke_srcs += files('cli_config_smoke_catch2_test.cpp')
else
message('CLI11 not detected; skipping cli_config_smoke from integration smoke suite.')
endif
integration_smoke_srcs += files(
'add_command_sandbox_smoke_catch2_test.cpp',
'cli_transport_fallback_smoke_catch2_test.cpp',
'daemon_embedded_streaming_smoke_catch2_test.cpp',
'graph_command_sandbox_smoke_catch2_test.cpp',
'integrity_auto_repair_smoke_catch2_test.cpp',
'search_graph_ux_smoke_catch2_test.cpp',
'smoke_link_catch2_test.cpp',
'storage_compression_policy_builder_smoke_catch2_test.cpp',
'storage_compression_smoke_catch2_test.cpp',
)
if tests_has_cli
integration_smoke_srcs += files(
'cli_subprocess_segfault_regression_smoke_catch2_test.cpp',
'daemon_cli_start_status_regression_smoke_catch2_test.cpp',
'daemon_embeddings_regression_smoke_catch2_test.cpp',
'daemon_ingestion_reliability_smoke_catch2_test.cpp',
'mcp_doctor_positive_smoke_catch2_test.cpp',
'pdf_search_smoke_catch2_test.cpp',
)
else
message('yams_cli dependency unavailable; skipping CLI-driven smoke tests.')
endif
dbg = (get_option('buildtype') == 'debug')
if (get_option('enable-integration-tests') or dbg) and integration_smoke_srcs.length() > 0 and catch2_dep.found()
smoke_test_args = []
if _test_thread_sanitizer
smoke_test_args += ['~[mcpdocopsfixture]']
endif
smoke_test_timeout = 600 * _test_timeout_scale
integ_exe = executable('yams_integration_smoke_tests',
integration_smoke_srcs + files('test_main_smoke_catch2.cpp'),
include_directories: incs,
dependencies: [catch2_dep, test_deps, dependency('yams_daemon_client_embedded')],
cpp_args: ['-DYAMS_TESTING=1', _test_timeout_cpp_arg],
install: false,
)
test('integration_smoke', integ_exe,
suite: ['integration', 'isolated', 'concurrency'],
args: smoke_test_args,
env: {
'YAMS_TEST_SAFE_SINGLE_INSTANCE': '1',
'YAMS_DISABLE_VECTORS': '1',
'TSAN_OPTIONS': _test_tsan_options,
},
is_parallel: false,
timeout: smoke_test_timeout,
)
else
if not catch2_dep.found()
message('integration_smoke suite disabled (Catch2 not found).')
else
message('integration_smoke suite disabled (enable with -Denable-integration-tests=true).')
endif
endif