Skip to content

Commit

Permalink
ci: Run cargo test without all-targets (#1118)
Browse files Browse the repository at this point in the history
Running `cargo test --all-targets` will not run doctests, as noted in the removed comments.

Another effect is that Cargo.toml instructions for not running a test are ignored. For example, benchmarks are tested, but no unit tests are inside and bins marked with `test = false` are run.

I diffed the text output of running `cargo test` and `cargo test --all-targets` and concluded that no useful test will be skipped when running just `cargo test`.
  • Loading branch information
caspermeijn authored Aug 12, 2024
1 parent 53ca327 commit d38072f
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,9 @@ jobs:
uses: ./.github/actions/setup-ninja
- uses: Swatinem/rust-cache@v2
- name: test
run: cargo test --all-targets
run: cargo test
- name: test no-default-features
run: cargo test -p prost-build -p prost-derive -p prost-types --all-targets --no-default-features
# Run doc tests separately: https://github.com/rust-lang/cargo/issues/6669
- name: test doc
run: cargo test --doc
- name: test doc no-default-features
run: cargo test -p prost-build -p prost-derive -p prost-types --doc --no-default-features
run: cargo test -p prost-build -p prost-derive -p prost-types --no-default-features

msrv:
runs-on: ubuntu-latest
Expand Down

0 comments on commit d38072f

Please sign in to comment.