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

Improved "all combinations of features" testing #75

Merged
merged 10 commits into from Jul 31, 2022
Merged
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