-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feat/prepare findex server v7 #93
Conversation
feat: fix the bugs
test:add generic memory ADT tests test:add ccr test (fails)
fix:fix import of test fix:re-order tests fix:notyes feat: fix the bugs lol fix: fix the code fix: fix clippy ci fix: vscode folder fix: rip first test test: change async tests fix: ci
fix: review fixes monday2 fix: review fixes monday3 fix: clippy fix: clippy2 fix: clippy3
fix: last fixes test:change concurrency test fix:newline issues chore:Update src/in_memory_store.rs Co-authored-by: Théophile BRÉZOT <[email protected]> fix:review fixes fix:review fixes2 fix:review fixes3 fix:review fixes4 fix:review fixes5
feat:clean deps and adapt word typing to byte sequence test:change concurrent test signatures
0f589c4
to
33506ee
Compare
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.
Functional modifications should not include formatting modifications, this makes proofreading tedious and even less bulletproof.
Overall okay, but many details to improve: please read your diffs before publishing a MR.
Try removing the clones in your guarded_write
. I would be surprise they are necessary.
.rustfmt.toml
Outdated
version = "Two" | ||
style_edition = "2024" |
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.
Why did you change that ?
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.
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.
Update after discussion with @Manuthor
We thought of setting the rust toolchain to a stable release, notably :
[toolchain]
channel = "1.83.0"
components = ["rustfmt"]
And to format, we use cargo +nightly fmt --all
what do you think ?
Cargo.toml
Outdated
@@ -14,12 +16,26 @@ rand_core = "0.6.4" | |||
tiny-keccak = { version = "2.0.2", features = ["sha3"] } | |||
xts-mode = "0.5.1" | |||
zeroize = { version = "1.8.1", features = ["derive"] } | |||
redis = { version = "0.27.5", features = [ | |||
"aio", | |||
"ahash", |
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.
Why do you need that?
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.
"aio",
: for async operations involving connection manager
ahash
: for hashing that write script and keeping it on cache
src/findex.rs
Outdated
|
||
#[tokio::test] | ||
#[cfg(feature = "redis-store")] | ||
async fn test_redis_insert_search_delete_search() { |
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.
If correctly implemented, changing the memory should not influence the correctness of Findex. I agree though that this is in theory and testing is better than trusting. However, this test re-implements the exact same logic as the previous one : why not making the test generic instead?
Moreover, this is findex.rs
, I would rather like not seeing any memory related code there. Move this test to src/tests/findex-redis.rs
.
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.
I agree with your first paragraph. Findex should work all ways so instead of moving this I will generize it later after we fix what we already have. I delete it for now
src/memory/in_memory_store.rs
Outdated
@@ -31,6 +31,7 @@ impl<Address: Hash + Eq + Debug, Value: Clone + Eq + Debug> Default for InMemory | |||
} | |||
} | |||
|
|||
#[cfg(any(test, feature = "bench"))] |
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.
why do you need this ?
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.
compiler keeps nagging if taken off
method `clear` is never used
`#[warn(dead_code)]` on by defaultrustc
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.
can't delete test, it's needed in ovec.rs
#[cfg(feature = "test-utils")] | ||
use crate::MemoryADT; | ||
|
||
// TODO: should return a result type and proper errors |
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.
Should this be solved ?
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.
I kept that for this review to ask a question : are the tests good as they are or shall I create some " tesResult " type with proper error type ? I just want to make sure it's good this way
Tests do not pass on my machine (
|
Does not compile on my machine (
|
049dd01
to
c2a24e2
Compare
b5621d8
to
5a83afc
Compare
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.
The tests do pass now, please notify me if they still flacky
Cargo.toml
Outdated
@@ -14,12 +16,26 @@ rand_core = "0.6.4" | |||
tiny-keccak = { version = "2.0.2", features = ["sha3"] } | |||
xts-mode = "0.5.1" | |||
zeroize = { version = "1.8.1", features = ["derive"] } | |||
redis = { version = "0.27.5", features = [ | |||
"aio", | |||
"ahash", |
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.
"aio",
: for async operations involving connection manager
ahash
: for hashing that write script and keeping it on cache
src/findex.rs
Outdated
|
||
#[tokio::test] | ||
#[cfg(feature = "redis-store")] | ||
async fn test_redis_insert_search_delete_search() { |
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.
I agree with your first paragraph. Findex should work all ways so instead of moving this I will generize it later after we fix what we already have. I delete it for now
.rustfmt.toml
Outdated
version = "Two" | ||
style_edition = "2024" |
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.
Update after discussion with @Manuthor
We thought of setting the rust toolchain to a stable release, notably :
[toolchain]
channel = "1.83.0"
components = ["rustfmt"]
And to format, we use cargo +nightly fmt --all
what do you think ?
src/lib.rs
Outdated
pub use findex::Findex; | ||
#[cfg(feature = "redis-store")] | ||
pub use memory::db_stores::redis_store::RedisStore; |
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.
done, I fixed the error enum type
src/memory/in_memory_store.rs
Outdated
@@ -31,6 +31,7 @@ impl<Address: Hash + Eq + Debug, Value: Clone + Eq + Debug> Default for InMemory | |||
} | |||
} | |||
|
|||
#[cfg(any(test, feature = "bench"))] |
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.
compiler keeps nagging if taken off
method `clear` is never used
`#[warn(dead_code)]` on by defaultrustc
src/memory/in_memory_store.rs
Outdated
@@ -31,6 +31,7 @@ impl<Address: Hash + Eq + Debug, Value: Clone + Eq + Debug> Default for InMemory | |||
} | |||
} | |||
|
|||
#[cfg(any(test, feature = "bench"))] |
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.
can't delete test, it's needed in ovec.rs
#[cfg(feature = "test-utils")] | ||
use crate::MemoryADT; | ||
|
||
// TODO: should return a result type and proper errors |
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.
I kept that for this review to ask a question : are the tests good as they are or shall I create some " tesResult " type with proper error type ? I just want to make sure it's good this way
src/memory/db_stores/redis_store.rs
Outdated
|
||
#[tokio::test] | ||
#[serial] | ||
async fn test_db_flush() -> Result<(), RedisStoreError> { |
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.
* fix: cleanup deny.toml and delete docker-compose.yml * fix: remove .rustfmt.toml
Previous related PR : #92 , closed for convenience
What's new :