Skip to content

Commit

Permalink
Merge pull request #75 from palfrey/test-all-features
Browse files Browse the repository at this point in the history
Improved "all combinations of features" testing
  • Loading branch information
palfrey committed Jul 31, 2022
2 parents 1ff7071 + 278f6c3 commit 9bee51f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 29 deletions.
43 changes: 15 additions & 28 deletions .github/workflows/ci.yml
Expand Up @@ -19,13 +19,6 @@ jobs:
- beta
- nightly
- 1.51.0
features:
- default
- no_defaults
- file_locks
include:
- rust: nightly
features: all
steps:
- uses: actions/checkout@v2.3.4
- uses: actions-rs/toolchain@v1.0.7
Expand All @@ -40,42 +33,36 @@ jobs:
with:
command: fmt
args: -- --check
if: ${{ matrix.features == 'default' && matrix.rust == 'nightly' }}
if: ${{ matrix.rust == 'nightly' }}
- name: Clippy
uses: actions-rs/cargo@v1.0.3
env:
RUSTFLAGS: -Dwarnings
with:
command: clippy
if: ${{ matrix.features == 'default' }}
continue-on-error: ${{ matrix.rust == 'nightly' || matrix.rust == 'beta' }}
- name: Build and test feature ${{ matrix.features }}
- name: Install cargo-binstall
run: |
curl --location --remote-name https://github.com/ryankurte/cargo-binstall/releases/download/v0.11.1/cargo-binstall-x86_64-unknown-linux-musl.tgz
tar -zxvf cargo-binstall-x86_64-unknown-linux-musl.tgz
mv cargo-binstall ~/.cargo/bin
ls -l ~/.cargo/bin
- name: Install "build all features"
uses: actions-rs/cargo@v1.0.3
with:
command: test
args: --features ${{ matrix.features }} -- --nocapture
env:
RUST_TEST_THREADS: 3 # So the parallel tests have enough threads
RUST_LOG: debug
if: ${{ matrix.features != 'all' && matrix.features != 'no_defaults' }}
- name: Build and test all features
command: binstall
args: cargo-all-features --no-confirm --version 1.7.0
- name: Build all features
uses: actions-rs/cargo@v1.0.3
with:
command: test
args: --all-features -- --nocapture
if: ${{ matrix.features == 'all' }}
env:
RUST_TEST_THREADS: 3 # So the parallel tests have enough threads
RUST_LOG: debug
- name: Build and test without default features
command: build-all-features
- name: Test all features
uses: actions-rs/cargo@v1.0.3
with:
command: test
args: --no-default-features -- --nocapture
if: ${{ matrix.features == 'no_defaults' }}
command: test-all-features
env:
RUST_TEST_THREADS: 3 # So the parallel tests have enough threads
RUST_LOG: debug
RUST_LOG: debug

multi-os-testing:
name: Test suite
Expand Down
4 changes: 4 additions & 0 deletions serial_test/Cargo.toml
Expand Up @@ -45,3 +45,7 @@ docsrs = ["document-features"]
all-features = true
# defines the configuration attribute `docsrs`
rustdoc-args = ["--cfg", "docsrs"]

[package.metadata.cargo-all-features]
skip_optional_dependencies = true
denylist = ["docsrs"]
2 changes: 1 addition & 1 deletion serial_test/src/code_lock.rs
@@ -1,6 +1,6 @@
use crate::rwlock::{Locks, MutexGuardWrapper};
use lazy_static::lazy_static;
#[cfg(feature = "logging")]
#[cfg(all(feature = "logging", feature = "timeout"))]
use log::debug;
use parking_lot::RwLock;
#[cfg(feature = "timeout")]
Expand Down
1 change: 1 addition & 0 deletions serial_test/src/lib.rs
@@ -1,6 +1,7 @@
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![deny(unused_variables)]
#![deny(missing_docs)]
#![deny(unused_imports)]

//! # serial_test
//! `serial_test` allows for the creation of serialised Rust tests using the [serial](macro@serial) attribute
Expand Down

0 comments on commit 9bee51f

Please sign in to comment.