-
Notifications
You must be signed in to change notification settings - Fork 178
RUST-395 Log skipped tests #523
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
RUST-395 Log skipped tests #523
Conversation
9cc0208
to
9229022
Compare
I've updated this to log skips in a way that's not captured by |
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 changes LGTM--great idea with log_uncaptured
! Only things missing are a few test names in the log messages. Also looks like this needs some merge conflicts to be fixed up
src/cmap/test/mod.rs
Outdated
@@ -431,7 +432,7 @@ async fn cmap_spec_tests() { | |||
|
|||
let mut options = CLIENT_OPTIONS.clone(); | |||
if options.load_balanced.unwrap_or(false) { | |||
println!("skipping due to load balanced topology"); | |||
log_uncaptured("skipping due to load balanced topology"); |
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 we add which test is being skipped here?
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.
@@ -643,7 +644,7 @@ async fn direct_connection() { | |||
|
|||
let test_client = TestClient::new().await; | |||
if !test_client.is_replica_set() { | |||
println!("Skipping due to non-replica set topology"); | |||
log_uncaptured("Skipping due to non-replica set topology"); |
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.
ditto add test name here
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.
src/test/atlas_connectivity.rs
Outdated
async fn run_test(uri_env_var: &str, resolver_config: Option<ResolverConfig>) { | ||
if std::env::var_os("MONGO_ATLAS_TESTS").is_none() { | ||
log_uncaptured("skipping test due to undefined environment variable MONGO_ATLAS_TESTS"); |
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.
ditto test name
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.
src/test/spec/connection_stepdown.rs
Outdated
@@ -31,6 +31,7 @@ async fn run_test<F: Future>( | |||
let client = EventClient::with_additional_options(Some(options), None, None, None).await; | |||
|
|||
if !client.is_replica_set() { | |||
log_uncaptured("skipping test due to not running on a replica set"); |
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.
ditto name
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.
@@ -173,6 +179,8 @@ async fn run_test(mut test_file: TestFile) { | |||
|
|||
RUNTIME.delay_for(Duration::from_millis(500)).await; | |||
} | |||
} else { | |||
log_uncaptured("skipping test due to test topology"); |
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.
think this needs test name and maybe more details about what is off about the topology
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.
83a337b
to
71eeab7
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.
LGTM! (Sorry the PR I just merged created another conflict, but besides that this should be good to go)
011681e
to
b54437e
Compare
RUST-395
This PR adds logging to test cases that are skipped and enables the
--nocapture
flag to allow the test framework to print output for skipped tests.