From 34592b172c35bd98f63480d850b11b6e2c1aa197 Mon Sep 17 00:00:00 2001 From: Pere Diaz Bou Date: Tue, 17 Jun 2025 15:44:28 +0200 Subject: [PATCH] run index tests with flags instead of ignore --- .github/workflows/long_fuzz_tests_btree.yml | 4 ++++ .github/workflows/rust.yml | 2 +- core/storage/btree.rs | 3 +++ tests/integration/common.rs | 2 ++ tests/integration/fuzz/mod.rs | 6 ++++-- tests/integration/query_processing/test_write_path.rs | 1 + 6 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/long_fuzz_tests_btree.yml b/.github/workflows/long_fuzz_tests_btree.yml index e27d8eb8a..69732c6cf 100644 --- a/.github/workflows/long_fuzz_tests_btree.yml +++ b/.github/workflows/long_fuzz_tests_btree.yml @@ -28,6 +28,10 @@ jobs: run: cargo test -- --ignored fuzz_long env: RUST_BACKTRACE: 1 + - name: Run ignored long tests with index + run: cargo test --features index_experimental -- --ignored fuzz_long + env: + RUST_BACKTRACE: 1 simple-stress-test: runs-on: blacksmith-4vcpu-ubuntu-2404 diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 5dd5745df..3bacece0a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -44,7 +44,7 @@ jobs: - name: Tests with indexes env: RUST_LOG: ${{ runner.debug && 'limbo_core::storage=trace' || '' }} - run: cargo test --verbose -p core_tester --features index_experimental -- --ignored index_scan + run: cargo test --verbose --features index_experimental timeout-minutes: 20 diff --git a/core/storage/btree.rs b/core/storage/btree.rs index 688e6f63c..8721b767d 100644 --- a/core/storage/btree.rs +++ b/core/storage/btree.rs @@ -7097,6 +7097,7 @@ mod tests { } } + #[cfg(feature = "index_experimental")] fn btree_index_insert_fuzz_run(attempts: usize, inserts: usize) { let (mut rng, seed) = if std::env::var("SEED").is_ok() { let seed = std::env::var("SEED").unwrap(); @@ -7282,6 +7283,7 @@ mod tests { } #[test] + #[cfg(feature = "index_experimental")] pub fn btree_index_insert_fuzz_run_equal_size() { btree_index_insert_fuzz_run(2, 1024); } @@ -7317,6 +7319,7 @@ mod tests { #[test] #[ignore] + #[cfg(feature = "index_experimental")] pub fn fuzz_long_btree_index_insert_fuzz_run_equal_size() { btree_index_insert_fuzz_run(2, 10_000); } diff --git a/tests/integration/common.rs b/tests/integration/common.rs index 8d0fc7830..4814c5777 100644 --- a/tests/integration/common.rs +++ b/tests/integration/common.rs @@ -283,6 +283,7 @@ mod tests { } #[test] + #[cfg(feature = "index_experimental")] fn test_unique_index_ordering() -> anyhow::Result<()> { let db = TempDatabase::new_empty(); let conn = db.connect_limbo(); @@ -323,6 +324,7 @@ mod tests { } #[test] + #[cfg(feature = "index_experimental")] fn test_large_unique_blobs() -> anyhow::Result<()> { let path = TempDir::new().unwrap().keep().join("temp_read_only"); let db = TempDatabase::new_with_existent(&path); diff --git a/tests/integration/fuzz/mod.rs b/tests/integration/fuzz/mod.rs index 9af0360d8..863f7fdfa 100644 --- a/tests/integration/fuzz/mod.rs +++ b/tests/integration/fuzz/mod.rs @@ -165,7 +165,7 @@ mod tests { } #[test] - #[ignore = "only used with feature index_experimental"] + #[cfg(feature = "index_experimental")] pub fn index_scan_fuzz() { let db = TempDatabase::new_with_rusqlite("CREATE TABLE t(x PRIMARY KEY)"); let sqlite_conn = rusqlite::Connection::open(db.path.clone()).unwrap(); @@ -213,7 +213,7 @@ mod tests { } #[test] - #[ignore = "only used with feature index_experimental"] + #[cfg(feature = "index_experimental")] /// A test for verifying that index seek+scan works correctly for compound keys /// on indexes with various column orderings. pub fn index_scan_compound_key_fuzz() { @@ -493,6 +493,7 @@ mod tests { } #[test] + #[cfg(feature = "index_experimental")] pub fn compound_select_fuzz() { let _ = env_logger::try_init(); let (mut rng, seed) = rng_from_time(); @@ -1358,6 +1359,7 @@ mod tests { } #[test] + #[cfg(feature = "index_experimental")] pub fn table_logical_expression_fuzz_run() { let _ = env_logger::try_init(); let g = GrammarGenerator::new(); diff --git a/tests/integration/query_processing/test_write_path.rs b/tests/integration/query_processing/test_write_path.rs index dd1c0d7c9..0e0597167 100644 --- a/tests/integration/query_processing/test_write_path.rs +++ b/tests/integration/query_processing/test_write_path.rs @@ -393,6 +393,7 @@ fn test_write_delete_with_index() -> anyhow::Result<()> { } #[test] +#[cfg(feature = "index_experimental")] fn test_update_with_index() -> anyhow::Result<()> { let _ = env_logger::try_init();