-
Notifications
You must be signed in to change notification settings - Fork 0
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
filemanager: setup testing #75
Conversation
… making it consistent with PartialOrd
inner: ConfigLoader, | ||
} | ||
|
||
#[automock] |
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.
This creates an entirely new MockConfig
struct which has methods that allow setting expectations.
@@ -0,0 +1,246 @@ | |||
#[double] |
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.
This expands to:
#[cfg(not(test))]
use crate::clients::aws::s3::Client;
#[cfg(test)]
use crate::clients::aws::s3::MockClient as Client;
Which allows using different versions of the client in testing code compared to the main code.
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.
Very nice use of mockall and mock_double, I didn't know those crates, kudos Marko!
Do you want to go for #74 first? There might be some conflicts. |
Ok, I'll put it up for review (now it's in draft), but there's still things left to fix :_S |
# Conflicts: # lib/workload/stateful/filemanager/Cargo.lock # lib/workload/stateful/filemanager/README.md # lib/workload/stateful/filemanager/filemanager-http-lambda/src/main.rs # lib/workload/stateful/filemanager/filemanager-ingest-lambda/Cargo.toml # lib/workload/stateful/filemanager/filemanager/src/events/aws/mod.rs # lib/workload/stateful/filemanager/filemanager/src/events/s3/collect.rs # lib/workload/stateful/filemanager/filemanager/src/events/s3/s3_client.rs
c342188
to
0aee1e4
Compare
Closes #71
Changes
It should be a lot easier to test locally now just by running
cargo test
. This will mean that dev deployments are more likely to succeed if the tests pass locally. Now, if only there is way to removedocker compose up
as well. Just being able to runcargo test
directly would be the most convenient.