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

CI: Also run tests with --no-default-features #819

Closed
wants to merge 2 commits into from

Conversation

mqudsi
Copy link
Contributor

@mqudsi mqudsi commented Sep 12, 2022

This patch configures CI to assert that cargo test --no-default-features also passes (in addition to the default combinatoric feature matrix).

An additional commit is included that fixes the existing errors preventing cargo test from passing under --no-default-features. The commit message explains the approach taken.

This PR targets 0.5.x as some of the fixes were to 0.5.x-only impls; I'll file a separate PR for 0.4.x after this one lands in case any changes are needed or requested.

I don't know if any of the CI matrix configurations will fail with the new test so I'm pushing this to initiate a CI run against it. If any fail, I'll revise the branch to address them accordingly.

This asserts that in addition to all tests passing with each specified
feature that the tests also pass with no features at all.
There's no pretty way of gating doctests contingent on cfg
presence/absense so this is kind of ugly.

First, a doc comment `///` is converted into its equivalent
`#[doc(...)]`, which is then converted into a conditional rust attribute
via `#[cfg_attr(...)]`. We need two of these, one to ignore the tests if
the cfg predicate isn't met and another to indicate the start of a code
block and enable testing + syntax highlighting.
@mqudsi mqudsi changed the title Test no default features Also run tests with --no-default-features Sep 12, 2022
@mqudsi mqudsi changed the title Also run tests with --no-default-features CI: Also run tests with --no-default-features Sep 12, 2022
@esheppa
Copy link
Collaborator

esheppa commented Sep 13, 2022

Thanks for this PR @mqudsi - this looks like a good complement to some work in #814, as this PR has picked up some issues with the doc tests that I missed on that PR - what do you think @djc?

@djc
Copy link
Member

djc commented Sep 13, 2022

Yes, I was thinking we should rebase it on that PR (or I should just get off my ass and review it).

@djc
Copy link
Member

djc commented Oct 13, 2022

@mqudsi would you mind rebasing this on current 0.4.x?

@pitdicker
Copy link
Collaborator

Thank you! Merged in #1059.

@djc djc closed this May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants