Skip to content

Commit 70a5884

Browse files
authored
Merge pull request #377 from cipherstash/expand-ore-order-coverage
test(integration): expand numeric ORE ordering tests with edge cases
2 parents 7cab49e + e82da17 commit 70a5884

9 files changed

Lines changed: 862 additions & 477 deletions

File tree

Cargo.lock

Lines changed: 42 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cipherstash-proxy-integration/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ tracing = { workspace = true }
2828
tracing-subscriber = { workspace = true }
2929
uuid = { version = "1.11.0", features = ["serde", "v4"] }
3030
reqwest = { version = "0.13", features = ["rustls"] }
31+
serial_test = "3"

packages/cipherstash-proxy-integration/src/common.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,26 @@ where
467467
);
468468
}
469469

470+
/// Returns indices in zigzag order so insertion is never accidentally sorted.
471+
/// For len=5: [4, 0, 3, 1, 2]
472+
pub fn interleaved_indices(len: usize) -> Vec<usize> {
473+
let mut indices = Vec::with_capacity(len);
474+
let mut lo = 0;
475+
let mut hi = len;
476+
let mut take_hi = true;
477+
while lo < hi {
478+
if take_hi {
479+
hi -= 1;
480+
indices.push(hi);
481+
} else {
482+
indices.push(lo);
483+
lo += 1;
484+
}
485+
take_hi = !take_hi;
486+
}
487+
indices
488+
}
489+
470490
///
471491
/// Configure the client TLS settings.
472492
/// These are the settings for connecting to the database with TLS.

packages/cipherstash-proxy-integration/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ mod map_params;
1717
mod map_unique_index;
1818
mod migrate;
1919
mod multitenant;
20+
mod ore_order_helpers;
2021
mod passthrough;
2122
mod pipeline;
2223
mod schema_change;

0 commit comments

Comments
 (0)