# Hybrid search integration tests - Catch2 tests requiring full daemon with embeddings # Covers semantic search, hybrid search, RRF fusion with real infrastructure if not catch2_dep.found() message('Catch2 not found; skipping hybrid search integration tests.') else hybrid_search_integration_srcs = files( 'hybrid_search_integration_test.cpp', ) fsm_tuning_integration_srcs = files( 'fsm_tuning_benchmark_integration_test.cpp', ) corpus_relevance_srcs = files( 'corpus_relevance_test.cpp', ) dbg = (get_option('buildtype') == 'debug') if (get_option('enable-integration-tests') or dbg) # Use the shared tests/support/catch2_main.cpp (catch2_main_dep from tests/meson.build). # Meson variables are global: reassigning catch2_main_dep here to Catch2's own main used to # leak into every test executable defined after this subdir, dropping the shared main's # argument normalization and Windows CRT-report setup. hybrid_search_integration_exe = executable('yams_hybrid_search_integration', hybrid_search_integration_srcs, include_directories: incs, dependencies: [catch2_dep, catch2_main_dep, test_deps, catch2_trailing_link_deps], cpp_args: ['-DYAMS_TESTING=1'], install: false, ) test('hybrid_search_integration', hybrid_search_integration_exe, suite: ['integration', 'search', 'hybrid', 'semantic', 'catch2'], env: { 'YAMS_TEST_SAFE_SINGLE_INSTANCE': '1', 'YAMS_DISABLE_SESSION_WATCHER': '1', 'TSAN_OPTIONS': _test_tsan_options, # Note: Do NOT set YAMS_DISABLE_VECTORS - we need vector search for hybrid tests }, is_parallel: false, timeout: 300, # 5 minutes - allows time for daemon startup + embedding model load # Allow exit 0 when all tests skip (Windows daemon shutdown not yet implemented) args: ['--allow-running-no-tests'], ) # FSM Tuning integration tests (Phase 4 of yams-7ez4) fsm_tuning_integration_exe = executable('yams_fsm_tuning_integration', fsm_tuning_integration_srcs, include_directories: incs, dependencies: [catch2_dep, catch2_main_dep, test_deps, catch2_trailing_link_deps], cpp_args: ['-DYAMS_TESTING=1'], install: false, ) test('fsm_tuning_integration', fsm_tuning_integration_exe, suite: ['integration', 'search', 'fsm', 'tuning', 'benchmark', 'catch2'], env: { 'YAMS_TEST_SAFE_SINGLE_INSTANCE': '1', 'TSAN_OPTIONS': _test_tsan_options, # Some tests need embeddings for hybrid search validation }, is_parallel: false, timeout: 180, # 3 minutes - FSM tests run multiple search operations # Allow exit 0 when all tests skip (Windows daemon shutdown not yet implemented) args: ['--allow-running-no-tests'], ) # Provable multi-corpus relevance gate (FTS completeness, collection isolation, path scoping) corpus_relevance_exe = executable('yams_corpus_relevance', corpus_relevance_srcs, include_directories: incs, dependencies: [catch2_dep, catch2_main_dep, test_deps, catch2_trailing_link_deps], cpp_args: ['-DYAMS_TESTING=1'], install: false, ) test('corpus_relevance', corpus_relevance_exe, suite: ['integration', 'search', 'relevance', 'fts', 'catch2'], env: { 'YAMS_TEST_SAFE_SINGLE_INSTANCE': '1', 'YAMS_DISABLE_VECTORS': '1', # keyword/FTS + metadata scoping; no embeddings needed 'TSAN_OPTIONS': _test_tsan_options, }, is_parallel: false, timeout: 180, args: ['--allow-running-no-tests'], ) else message('hybrid_search_integration test disabled (enable with -Denable-integration-tests=true).') endif endif