From edbaf79f4a650630d41870b16a205a4a6690d21e Mon Sep 17 00:00:00 2001 From: Connor Tsui Date: Fri, 20 Mar 2026 14:45:34 -0400 Subject: [PATCH] kill `vortex-test-e2e` Signed-off-by: Connor Tsui --- Cargo.lock | 9 ------ Cargo.toml | 2 -- vortex-btrblocks/src/sample.rs | 33 +++++++++++++++++-- vortex-test/e2e/Cargo.toml | 24 -------------- vortex-test/e2e/src/lib.rs | 58 ---------------------------------- 5 files changed, 31 insertions(+), 95 deletions(-) delete mode 100644 vortex-test/e2e/Cargo.toml delete mode 100644 vortex-test/e2e/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index d3ca1f48c16..20182ebbd76 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10553,15 +10553,6 @@ dependencies = [ "vortex", ] -[[package]] -name = "vortex-test-e2e" -version = "0.1.0" -dependencies = [ - "futures", - "tokio", - "vortex", -] - [[package]] name = "vortex-test-e2e-cuda" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 1f21bdf4f21..0d6853627a8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,7 +33,6 @@ members = [ "vortex-python", "vortex-tui", "vortex-test/compat-gen", - "vortex-test/e2e", "vortex-test/e2e-cuda", "xtask", # Encodings @@ -292,7 +291,6 @@ vortex-compat = { path = "./vortex-test/compat-gen" } vortex-cuda = { path = "./vortex-cuda", default-features = false } vortex-cuda-macros = { path = "./vortex-cuda/macros" } vortex-duckdb = { path = "./vortex-duckdb", default-features = false } -vortex-test-e2e = { path = "./vortex-test/e2e", default-features = false } vortex-test-e2e-cuda = { path = "./vortex-test/e2e-cuda", default-features = false } vortex-tui = { path = "./vortex-tui" } diff --git a/vortex-btrblocks/src/sample.rs b/vortex-btrblocks/src/sample.rs index 25ff4d0f527..4967f45f9c9 100644 --- a/vortex-btrblocks/src/sample.rs +++ b/vortex-btrblocks/src/sample.rs @@ -55,7 +55,7 @@ pub(crate) fn sample_count_approx_one_percent(len: usize) -> u32 { ) } -pub fn stratified_slices( +fn stratified_slices( length: usize, sample_size: u32, sample_count: u32, @@ -88,7 +88,7 @@ pub fn stratified_slices( /// Split a range of array indices into as-equal-as-possible slices. If the provided `num_partitions` doesn't /// evenly divide into `length`, then the first `(length % num_partitions)` slices will have an extra element. -pub fn partition_indices(length: usize, num_partitions: u32) -> Vec<(usize, usize)> { +fn partition_indices(length: usize, num_partitions: u32) -> Vec<(usize, usize)> { let num_long_parts = length % num_partitions as usize; let short_step = length / num_partitions as usize; let long_step = short_step + 1; @@ -104,3 +104,32 @@ pub fn partition_indices(length: usize, num_partitions: u32) -> Vec<(usize, usiz ) .collect() } + +#[cfg(test)] +mod tests { + use vortex_array::IntoArray; + use vortex_array::arrays::PrimitiveArray; + use vortex_array::assert_arrays_eq; + use vortex_array::validity::Validity; + use vortex_buffer::Buffer; + use vortex_error::VortexResult; + + use super::*; + + #[test] + fn sample_is_deterministic() -> VortexResult<()> { + // Create a deterministic array with linear-with-noise pattern + let values: Vec = (0i64..100_000).map(|i| i + (i * 7 + 3) % 11).collect(); + + let array = + PrimitiveArray::new(Buffer::from_iter(values), Validity::NonNullable).into_array(); + + let first = sample(&array, SAMPLE_SIZE, SAMPLE_COUNT); + for _ in 0..10 { + let again = sample(&array, SAMPLE_SIZE, SAMPLE_COUNT); + assert_eq!(first.nbytes(), again.nbytes()); + assert_arrays_eq!(&first, &again); + } + Ok(()) + } +} diff --git a/vortex-test/e2e/Cargo.toml b/vortex-test/e2e/Cargo.toml deleted file mode 100644 index e0a914a19a2..00000000000 --- a/vortex-test/e2e/Cargo.toml +++ /dev/null @@ -1,24 +0,0 @@ -[package] -name = "vortex-test-e2e" -authors = { workspace = true } -description = "End-to-end tests for Vortex" -edition = { workspace = true } -homepage = { workspace = true } -include = { workspace = true } -keywords = { workspace = true } -license = { workspace = true } -publish = false -repository = { workspace = true } -rust-version = { workspace = true } -version = { workspace = true } - -[lints] -workspace = true - -[features] -unstable_encodings = ["vortex/unstable_encodings"] - -[dependencies] -futures = { workspace = true } -tokio = { workspace = true, features = ["rt", "macros"] } -vortex = { workspace = true, features = ["files", "tokio"] } diff --git a/vortex-test/e2e/src/lib.rs b/vortex-test/e2e/src/lib.rs deleted file mode 100644 index d5a03f1fb90..00000000000 --- a/vortex-test/e2e/src/lib.rs +++ /dev/null @@ -1,58 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: Copyright the Vortex contributors - -//! End-to-end tests for Vortex. - -#[cfg(test)] -mod tests { - use vortex::VortexSessionDefault; - use vortex::array::IntoArray; - use vortex::array::arrays::PrimitiveArray; - use vortex::array::validity::Validity; - use vortex::buffer::Buffer; - use vortex::buffer::ByteBufferMut; - use vortex::error::VortexResult; - use vortex::file::WriteOptionsSessionExt; - use vortex::session::VortexSession; - - /// Test that compression produces deterministic results. - #[tokio::test] - async fn test_compression_determinism() -> VortexResult<()> { - // Create a deterministic array with linear-with-noise pattern - let values: Vec = (0i64..100_000).map(|i| i + (i * 7 + 3) % 11).collect(); - - let array = - PrimitiveArray::new(Buffer::from_iter(values), Validity::NonNullable).into_array(); - - // Write concurrently and verify all sizes match expected - let futures: Vec<_> = (0..5) - .map(|_| { - let array = array.clone(); - async move { - let session = VortexSession::default(); - let mut buf = ByteBufferMut::empty(); - session - .write_options() - .write(&mut buf, array.to_array_stream()) - .await?; - VortexResult::Ok(buf.len()) - } - }) - .collect(); - - #[cfg(feature = "unstable_encodings")] - const EXPECTED_SIZE: usize = 216004; - #[cfg(not(feature = "unstable_encodings"))] - const EXPECTED_SIZE: usize = 215972; - - let sizes = futures::future::try_join_all(futures).await?; - for (i, size) in sizes.iter().enumerate() { - assert_eq!( - *size, EXPECTED_SIZE, - "Run {i} compressed the array to {size} bytes instead of the expected {EXPECTED_SIZE}." - ); - } - - Ok(()) - } -}