-
Notifications
You must be signed in to change notification settings - Fork 1
test(integration): expand numeric ORE ordering tests with edge cases #377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
920f991
test(integration): expand numeric ORE ordering tests with edge cases
tobyhede cddf2c7
style: apply cargo fmt to ORE ordering tests
tobyhede e19d40a
fix(integration): replace 3.14 with 3.25 to avoid clippy approx_const…
tobyhede bdd5d63
test(integration): add multitenant ORE ordering tests for all tenant …
tobyhede 76d611d
refactor(integration): deduplicate ORE ordering test helpers
tobyhede f207300
fix(integration): serialize ORE ordering tests and add SortDirection …
tobyhede 63b478c
test(integration): use lexicographic edge cases in ORE text ordering …
tobyhede 29e571e
fix: bump metrics crate to 0.24.3 to fix Rust compiler error
tobyhede 637a221
fix(integration): use arrays instead of vec! for clippy useless_vec lint
tobyhede e82da17
fix: how to even alphabet
tobyhede File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these tests run with the same key every time? My guess is that they would be.
To test ORE behaviour definitively, the tests should run with many different keys.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@coderdan Not sure what you mean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When an ORE value is encrypted, it uses a key.
2 encrypted values will compare correctly if they were encrypted with the same key.
If they were encrypted with different keys then they will compare correctly 50% of the time.
I'm suggesting that the tests need to encrypt a bunch of values with key a, check that they compare correctly then do it again with a different key, b and make sure they still compare correctly.
One way to do this would be to randomly generate the key used for every test run so that we build confidence over many CI runs. Another way would be to use property testing to do many runs in a single CI run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@coderdan the Proxy tests run using a Workspace that survives across test runs - which means they would be using the same Keyset across test runs.
Given that a broken ORE integration with Proxy could false positive "pass" an assertion of a comparison op with 50/50 odds, and the ORE is deterministic with respect to the keyset material I can see that it would in principal be possible to be convinced something is working when it isn't.
But even though the key is unchanging between test runs we are encrypting multiple different values in this test and ensuring they sort correctly. I would have thought that if ORE integration was broken then the odds of a false positive would halve for every seperate value in the values being sorted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One way to do this in the proxy context would be to run the test for multiple different keysets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@coderdan @freshtonic
Added ore ordering to the multitenant test context:
packages/cipherstash-proxy-integration/src/multitenant/ore_order.rs
Runs the tests against 3 tenant keysets.
Original ORE tests remain, and they test the default keyset.