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

chore: run tracing-subscriber's tests under --no-default-features #1537

Merged
merged 4 commits into from
Sep 4, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ jobs:

features-stable:
# Feature flag tests that run on stable Rust.
# TODO(david): once tracing's MSRV goes up to Rust 1.51, we should be able to switch to
# using cargo's V2 feature resolver (https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions)
# and avoid cd'ing into each crate's directory.
needs: check
runs-on: ubuntu-latest
steps:
Expand All @@ -230,6 +233,10 @@ jobs:
run: (cd tracing-core && cargo test --no-default-features)
- name: "Test tracing no-std support"
run: (cd tracing && cargo test --no-default-features)
# this skips running doctests under the `--no-default-features` flag,
# as rustdoc isn't aware of cargo's feature flags.
- name: "Test tracing-subscriber with all features disabled"
run: (cd tracing-subscriber && cargo test --lib --tests --no-default-features)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: i believe that if we switched the workspace to use resolver = "2", we wouldn't have to cd into each crate's directory. but, this only works on Rust 1.51+, so we would have to wait until our MSRV is 1.51 (e.g., we can't make that change today).

it might be worth leaving a TODO comment for that, though...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, another thought. while we're changing this, we may want to change this to use the github actions working-directory key, rather than (cd tracing-subscriber && ...). this is what the cargo hack checks already do:

working-directory: ${{ matrix.subcrate }}

Suggested change
run: (cd tracing-subscriber && cargo test --lib --tests --no-default-features)
run: cargo test --lib --tests --no-default-features
working-directory: tracing-subscriber

We may want to change the other runs in this CI job as well. However, we can also do this in a separate branch.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a todo assigned to myself!

style:
# Check style.
needs: check
Expand Down