From 68600d30e3a910c244e39abbd1ddd1aa18590bd3 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sun, 31 Jul 2022 23:34:34 +0100 Subject: [PATCH 01/10] Improved "all combinations of features" testing --- .github/workflows/ci.yml | 41 +++++++++++++--------------------------- 1 file changed, 13 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d6077b7..77bad9e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -40,42 +33,34 @@ 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 }} + - uses: engineerd/configurator@v0.0.8 + with: + name: cargo-binstall + url: https://github.com/ryankurte/cargo-binstall/releases/download/v0.11.1/cargo-binstall-x86_64-unknown-linux-musl.tgz + pathInArchive: cargo-binstall + - 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 cargo-all-featutres --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 From 816ac6af850715afdb0981526d4fa316a25ae21d Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sun, 31 Jul 2022 23:36:35 +0100 Subject: [PATCH 02/10] Change cargo-binstall path --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 77bad9e..3b155cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,7 +43,7 @@ jobs: continue-on-error: ${{ matrix.rust == 'nightly' || matrix.rust == 'beta' }} - uses: engineerd/configurator@v0.0.8 with: - name: cargo-binstall + name: /home/runner/.cargo/bin/cargo-binstall url: https://github.com/ryankurte/cargo-binstall/releases/download/v0.11.1/cargo-binstall-x86_64-unknown-linux-musl.tgz pathInArchive: cargo-binstall - name: Install "build all features" From 16fdebe3dd1201cf85681ce986e2d3e427eab104 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sun, 31 Jul 2022 23:46:37 +0100 Subject: [PATCH 03/10] Do the curl work directly --- .github/workflows/ci.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b155cc..3dad2a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,11 +41,10 @@ jobs: with: command: clippy continue-on-error: ${{ matrix.rust == 'nightly' || matrix.rust == 'beta' }} - - uses: engineerd/configurator@v0.0.8 - with: - name: /home/runner/.cargo/bin/cargo-binstall - url: https://github.com/ryankurte/cargo-binstall/releases/download/v0.11.1/cargo-binstall-x86_64-unknown-linux-musl.tgz - pathInArchive: cargo-binstall + - run: | + curl --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 - name: Install "build all features" uses: actions-rs/cargo@v1.0.3 with: From ec30ffd7f74481209543a1202f4643dd114fc591 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sun, 31 Jul 2022 23:50:05 +0100 Subject: [PATCH 04/10] Follow redirects --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3dad2a4..dbf6056 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,6 +34,10 @@ jobs: command: fmt args: -- --check if: ${{ matrix.rust == 'nightly' }} + - 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 - name: Clippy uses: actions-rs/cargo@v1.0.3 env: @@ -41,10 +45,6 @@ jobs: with: command: clippy continue-on-error: ${{ matrix.rust == 'nightly' || matrix.rust == 'beta' }} - - run: | - curl --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 - name: Install "build all features" uses: actions-rs/cargo@v1.0.3 with: From 5501cc67e1fc248097e0ad6f385b8cdab920a75f Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sun, 31 Jul 2022 23:52:21 +0100 Subject: [PATCH 05/10] Check list of commands --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dbf6056..871751d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,6 +38,7 @@ jobs: 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: Clippy uses: actions-rs/cargo@v1.0.3 env: @@ -48,7 +49,7 @@ jobs: - name: Install "build all features" uses: actions-rs/cargo@v1.0.3 with: - command: binstall cargo-all-featutres --no-confirm --version 1.7.0 + command: binstall cargo-all-features --no-confirm --version 1.7.0 - name: Build all features uses: actions-rs/cargo@v1.0.3 with: From f4069281006523f5b1f5893305875fe3302e9c20 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sun, 31 Jul 2022 23:54:52 +0100 Subject: [PATCH 06/10] Extra bits are args, not command --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 871751d..121bb3d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,7 +49,8 @@ jobs: - name: Install "build all features" uses: actions-rs/cargo@v1.0.3 with: - command: binstall cargo-all-features --no-confirm --version 1.7.0 + command: binstall + args: cargo-all-features --no-confirm --version 1.7.0 - name: Build all features uses: actions-rs/cargo@v1.0.3 with: From 3e66bde11cf973edea6ea2e7b7065df996326499 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sun, 31 Jul 2022 23:55:04 +0100 Subject: [PATCH 07/10] Skip optional features building --- serial_test/Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/serial_test/Cargo.toml b/serial_test/Cargo.toml index 23bd311..48a0f00 100644 --- a/serial_test/Cargo.toml +++ b/serial_test/Cargo.toml @@ -45,3 +45,6 @@ docsrs = ["document-features"] all-features = true # defines the configuration attribute `docsrs` rustdoc-args = ["--cfg", "docsrs"] + +[package.metadata.cargo-all-features] +skip_optional_dependencies = true \ No newline at end of file From b0a6960369f6d12156905ebfed4f6e7f8a7716c2 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sun, 31 Jul 2022 23:58:06 +0100 Subject: [PATCH 08/10] docsrs isn't a proper feature (and breaks 1.51.0) --- serial_test/Cargo.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/serial_test/Cargo.toml b/serial_test/Cargo.toml index 48a0f00..d2777e8 100644 --- a/serial_test/Cargo.toml +++ b/serial_test/Cargo.toml @@ -47,4 +47,5 @@ all-features = true rustdoc-args = ["--cfg", "docsrs"] [package.metadata.cargo-all-features] -skip_optional_dependencies = true \ No newline at end of file +skip_optional_dependencies = true +denylist = ["docsrs"] \ No newline at end of file From 3d9607cbf064fe0027b719acae65e8b4cc910c14 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Mon, 1 Aug 2022 00:02:59 +0100 Subject: [PATCH 09/10] Fix unused log::debug --- serial_test/src/code_lock.rs | 2 +- serial_test/src/lib.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/serial_test/src/code_lock.rs b/serial_test/src/code_lock.rs index 48e2128..279b3fb 100644 --- a/serial_test/src/code_lock.rs +++ b/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")] diff --git a/serial_test/src/lib.rs b/serial_test/src/lib.rs index 28e9abc..838ca9b 100644 --- a/serial_test/src/lib.rs +++ b/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 From 278f6c3b4bd8ed86d7924f20b67eac18b8bdd957 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Mon, 1 Aug 2022 00:04:14 +0100 Subject: [PATCH 10/10] Better naming/location for binstall step --- .github/workflows/ci.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 121bb3d..1a69295 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,11 +34,6 @@ jobs: command: fmt args: -- --check if: ${{ matrix.rust == 'nightly' }} - - 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: Clippy uses: actions-rs/cargo@v1.0.3 env: @@ -46,6 +41,12 @@ jobs: with: command: clippy continue-on-error: ${{ matrix.rust == 'nightly' || matrix.rust == 'beta' }} + - 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: