Skip to content
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

Logs are not captured (hidden) for passing tests #1580

Open
SimonSapin opened this issue Aug 23, 2022 · 0 comments
Open

Logs are not captured (hidden) for passing tests #1580

SimonSapin opened this issue Aug 23, 2022 · 0 comments
Labels
component/logging enhancement An enhancement to an existing feature

Comments

@SimonSapin
Copy link
Contributor

Part of the current output for cargo test --all:

     Running unittests src/main.rs (target/debug/deps/jwt_auth-2685b1c10b4305b5)

running 8 tests
......2022-08-23T11:42:20.216299Z  INFO apollo_router::router_factory: list of plugins plugin_details=[("experimental.include_subgraph_errors", "apollo_router::plugins::include_subgraph_errors::IncludeSubgraphErrors"), ("apollo.csrf", "apollo_router::plugins::csrf::Csrf"), ("apollo.telemetry", "apollo_router::plugins::telemetry::Telemetry"), ("example.jwt", "jwt_auth::jwt::JwtAuth"), ("extra_plugins.0.apollo_router::test_harness::SubgraphServicePlugin<apollo_router::test_harness::TestHarness::build::{{closure}}::{{closure}}>", "apollo_router::test_harness::SubgraphServicePlugin<apollo_router::test_harness::TestHarness::build::{{closure}}::{{closure}}>"), ("extra_plugins.1.apollo_router::test_harness::SubgraphServicePlugin<apollo_router::test_harness::TestHarness::build::{{closure}}::{{closure}}>", "apollo_router::test_harness::SubgraphServicePlugin<apollo_router::test_harness::TestHarness::build::{{closure}}::{{closure}}>")]
..
test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 2.02s

Since --nocapture was not used, output from tests should have been captured and only shown for failing tests. Capturing is based on a thread-local internal to the Rust standard library. Is logging printed from a different thread than emitted it? Can we find some way to make passing tests less noisy?

@SimonSapin SimonSapin added the enhancement An enhancement to an existing feature label Aug 23, 2022
SimonSapin added a commit that referenced this issue Aug 25, 2022
Same as #1601 but in more places.

Fixes #1580
@abernix abernix modified the milestones: v1.0.0-alpha.1, v1.0.0-rc.X, v1.0.0-alpha.2, v1.0.0-alpha.3 Aug 31, 2022
@abernix abernix modified the milestones: v1.0.0-alpha.3, v1.0.0-alpha.4, post-v1.0 Sep 7, 2022
@abernix abernix removed this from the v1.x.x milestone Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/logging enhancement An enhancement to an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants