From e485a80cf7bb81101d3eb3bb50418d38bbbaa1c7 Mon Sep 17 00:00:00 2001 From: David Laehnemann Date: Tue, 20 Jun 2023 20:50:23 +0200 Subject: [PATCH 01/18] fix: update deprecated alias `--all` to new argument `--workspace` --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 798e181be..8874e17a3 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -131,7 +131,7 @@ jobs: use-tool-cache: true - name: Coverage with tarpaulin - run: cargo tarpaulin --all --all-features --timeout 600 --out Lcov -- --test-threads 1 + run: cargo tarpaulin --workspace --all-features --timeout 600 --out Lcov -- --test-threads 1 - name: Upload coverage uses: coverallsapp/github-action@master From c0b251d775da898e14e444666bb40acb1c7cc37b Mon Sep 17 00:00:00 2001 From: David Laehnemann Date: Tue, 20 Jun 2023 20:53:51 +0200 Subject: [PATCH 02/18] fix: include `doctests` in test coverage calculation, see https://github.com/xd009642/tarpaulin/issues/538#issuecomment-675921588 --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 8874e17a3..255bee054 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -131,7 +131,7 @@ jobs: use-tool-cache: true - name: Coverage with tarpaulin - run: cargo tarpaulin --workspace --all-features --timeout 600 --out Lcov -- --test-threads 1 + run: cargo tarpaulin --workspace --all-features --run-types Tests,Doctests --timeout 600 --out Lcov -- --test-threads 1 - name: Upload coverage uses: coverallsapp/github-action@master From 052f09c262194555411b7fc670492c3ac1eb0d67 Mon Sep 17 00:00:00 2001 From: David Laehnemann Date: Mon, 26 Jun 2023 14:35:21 +0200 Subject: [PATCH 03/18] try fixing failing doctest compilation during coverage estimation by copying rust-htslib approach --- .github/workflows/rust.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 255bee054..135c1aab2 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -116,6 +116,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v2 + with: + submodules: recursive - name: Install nightly toolchain uses: actions-rs/toolchain@v1 @@ -123,18 +125,18 @@ jobs: toolchain: nightly override: true - - name: Install cargo-tarpaulin - uses: actions-rs/install@v0.1 + - uses: Swatinem/rust-cache@v1.3.0 + + - name: Install and run cargo-tarpaulin + uses: actions-rs/tarpaulin@v0.1 with: - crate: cargo-tarpaulin - version: latest + # TODO: update to latest tarpaulin once artefact download is fixed: https://github.com/actions-rs/tarpaulin/pull/23 + version: "0.22.0" use-tool-cache: true - - - name: Coverage with tarpaulin - run: cargo tarpaulin --workspace --all-features --run-types Tests,Doctests --timeout 600 --out Lcov -- --test-threads 1 + args: "--workspace --all-features --run-types Tests,Doctests --timeout 600 --out Lcov -- --test-threads 1" - name: Upload coverage - uses: coverallsapp/github-action@master + uses: coverallsapp/github-action@v1 with: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: ./lcov.info From 57f78b57fe9affab404589dd163cee987aec7bb0 Mon Sep 17 00:00:00 2001 From: David Laehnemann Date: Mon, 26 Jun 2023 22:18:36 +0200 Subject: [PATCH 04/18] make coverage CI step identical to rust-htslib setup --- .github/workflows/rust.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 135c1aab2..93b3a982b 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -125,6 +125,10 @@ jobs: toolchain: nightly override: true + - name: Install system dependencies + run: | + sudo apt-get install --yes zlib1g-dev libbz2-dev musl musl-dev musl-tools clang libc6-dev + - uses: Swatinem/rust-cache@v1.3.0 - name: Install and run cargo-tarpaulin @@ -133,7 +137,7 @@ jobs: # TODO: update to latest tarpaulin once artefact download is fixed: https://github.com/actions-rs/tarpaulin/pull/23 version: "0.22.0" use-tool-cache: true - args: "--workspace --all-features --run-types Tests,Doctests --timeout 600 --out Lcov -- --test-threads 1" + args: "--all-features --run-types Tests,Doctests --out Lcov -- --test-threads 1" - name: Upload coverage uses: coverallsapp/github-action@v1 From 046e4d053407a82af7023d9bce67ab721b671292 Mon Sep 17 00:00:00 2001 From: David Laehnemann Date: Tue, 27 Jun 2023 10:13:15 +0200 Subject: [PATCH 05/18] remove unused / inexistent tarpaulin option --- .github/workflows/rust.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 93b3a982b..b0cca734e 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -136,7 +136,6 @@ jobs: with: # TODO: update to latest tarpaulin once artefact download is fixed: https://github.com/actions-rs/tarpaulin/pull/23 version: "0.22.0" - use-tool-cache: true args: "--all-features --run-types Tests,Doctests --out Lcov -- --test-threads 1" - name: Upload coverage From 0b7a6878b3824576b25986fff823f830069bbaff Mon Sep 17 00:00:00 2001 From: David Laehnemann Date: Tue, 27 Jun 2023 10:14:04 +0200 Subject: [PATCH 06/18] try updating rust-cache action to address save-state deprecation warning --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index b0cca734e..e88604fe4 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -129,7 +129,7 @@ jobs: run: | sudo apt-get install --yes zlib1g-dev libbz2-dev musl musl-dev musl-tools clang libc6-dev - - uses: Swatinem/rust-cache@v1.3.0 + - uses: Swatinem/rust-cache@v2.5.0 - name: Install and run cargo-tarpaulin uses: actions-rs/tarpaulin@v0.1 From 7630569e1594dcc09b3fe7b927e67dfab38af7f6 Mon Sep 17 00:00:00 2001 From: David Laehnemann Date: Tue, 27 Jun 2023 10:24:31 +0200 Subject: [PATCH 07/18] add `--verbose` and `--debug` to tarpaulin, to figure out doctest failures --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index e88604fe4..f5518b5a3 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -136,7 +136,7 @@ jobs: with: # TODO: update to latest tarpaulin once artefact download is fixed: https://github.com/actions-rs/tarpaulin/pull/23 version: "0.22.0" - args: "--all-features --run-types Tests,Doctests --out Lcov -- --test-threads 1" + args: "--verbose --debug --all-features --run-types Tests,Doctests --out Lcov -- --test-threads 1" - name: Upload coverage uses: coverallsapp/github-action@v1 From f9c778c28516ec49b6f4933f2786a985e839d394 Mon Sep 17 00:00:00 2001 From: David Laehnemann Date: Wed, 28 Jun 2023 13:48:09 +0200 Subject: [PATCH 08/18] fix newick doctest --- src/io/newick.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/io/newick.rs b/src/io/newick.rs index f8d252f5c..9e5954840 100644 --- a/src/io/newick.rs +++ b/src/io/newick.rs @@ -14,7 +14,7 @@ //! use bio::io::newick; //! //! let tree = newick::from_string("(A:0.1,B:0.2,(C:0.3,D:0.4)E:0.5)F;").unwrap(); -//! for taxon in tree.raw_nodes() { +//! for taxon in tree.g.raw_nodes() { //! println!("{}", taxon.weight); //! } //! ``` From 7ba5976ffcfcb99ffd0505c683aa4f3923f5515b Mon Sep 17 00:00:00 2001 From: David Laehnemann Date: Wed, 28 Jun 2023 13:50:29 +0200 Subject: [PATCH 09/18] remove caching for coverage calculation, as this uses nightly for nightly, caching is not very useful, see: https://github.com/marketplace/actions/rust-cache#cache-effectiveness --- .github/workflows/rust.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f5518b5a3..c7d379fad 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -129,8 +129,6 @@ jobs: run: | sudo apt-get install --yes zlib1g-dev libbz2-dev musl musl-dev musl-tools clang libc6-dev - - uses: Swatinem/rust-cache@v2.5.0 - - name: Install and run cargo-tarpaulin uses: actions-rs/tarpaulin@v0.1 with: From ee7dc77194790fcccef9c68fc9554dfc8a7956c5 Mon Sep 17 00:00:00 2001 From: David Laehnemann Date: Wed, 28 Jun 2023 13:51:22 +0200 Subject: [PATCH 10/18] revert installation of deps that was only added for identical syntax with rust-htslib these are probably not needed... --- .github/workflows/rust.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index c7d379fad..9d553e0ca 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -125,10 +125,6 @@ jobs: toolchain: nightly override: true - - name: Install system dependencies - run: | - sudo apt-get install --yes zlib1g-dev libbz2-dev musl musl-dev musl-tools clang libc6-dev - - name: Install and run cargo-tarpaulin uses: actions-rs/tarpaulin@v0.1 with: From 0bbcb67e9ec4b63ed200d166f8f36eb6efd5f30c Mon Sep 17 00:00:00 2001 From: David Laehnemann Date: Wed, 28 Jun 2023 13:52:15 +0200 Subject: [PATCH 11/18] remove debugging output from tarpaulin CI step and put `--workspace` argument back in --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9d553e0ca..95c30fe93 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -130,7 +130,7 @@ jobs: with: # TODO: update to latest tarpaulin once artefact download is fixed: https://github.com/actions-rs/tarpaulin/pull/23 version: "0.22.0" - args: "--verbose --debug --all-features --run-types Tests,Doctests --out Lcov -- --test-threads 1" + args: "--workspace --all-features --run-types Tests,Doctests --out Lcov -- --test-threads 1" - name: Upload coverage uses: coverallsapp/github-action@v1 From d95dcbe4f35f002d80a0219a1a9f13f1a9d13db0 Mon Sep 17 00:00:00 2001 From: David Laehnemann Date: Wed, 28 Jun 2023 14:35:56 +0200 Subject: [PATCH 12/18] increase tarpaulin timeout for tests to 5 minutes (instead of 1 minute for default) --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 95c30fe93..990891305 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -130,7 +130,7 @@ jobs: with: # TODO: update to latest tarpaulin once artefact download is fixed: https://github.com/actions-rs/tarpaulin/pull/23 version: "0.22.0" - args: "--workspace --all-features --run-types Tests,Doctests --out Lcov -- --test-threads 1" + args: "--workspace --all-features --run-types Tests,Doctests --out Lcov --timeout 300 -- --test-threads 1" - name: Upload coverage uses: coverallsapp/github-action@v1 From e642b2e008298929f5cb870da9cfc90435a1124b Mon Sep 17 00:00:00 2001 From: David Laehnemann Date: Wed, 28 Jun 2023 14:52:05 +0200 Subject: [PATCH 13/18] increase `--timeout` back to the original 10 minutes --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 990891305..8b7ce5b17 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -130,7 +130,7 @@ jobs: with: # TODO: update to latest tarpaulin once artefact download is fixed: https://github.com/actions-rs/tarpaulin/pull/23 version: "0.22.0" - args: "--workspace --all-features --run-types Tests,Doctests --out Lcov --timeout 300 -- --test-threads 1" + args: "--workspace --all-features --run-types Tests,Doctests --out Lcov --timeout 600 -- --test-threads 1" - name: Upload coverage uses: coverallsapp/github-action@v1 From 1614643e960d8b056ef4289eb0b156e8ce58acff Mon Sep 17 00:00:00 2001 From: David Laehnemann Date: Wed, 28 Jun 2023 15:13:06 +0200 Subject: [PATCH 14/18] allow tarpaulin multithreading and increase --timeout to 15 minutes --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 8b7ce5b17..58ee01b84 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -130,7 +130,7 @@ jobs: with: # TODO: update to latest tarpaulin once artefact download is fixed: https://github.com/actions-rs/tarpaulin/pull/23 version: "0.22.0" - args: "--workspace --all-features --run-types Tests,Doctests --out Lcov --timeout 600 -- --test-threads 1" + args: "--workspace --all-features --run-types Tests,Doctests --out Lcov --timeout 900" - name: Upload coverage uses: coverallsapp/github-action@v1 From a86839506a5d4d4703c5e5b43680516001ada634 Mon Sep 17 00:00:00 2001 From: David Laehnemann Date: Wed, 28 Jun 2023 15:50:59 +0200 Subject: [PATCH 15/18] make code coverage CI step run only after successful testing, increase --timeout for it to 30 minutes --- .github/workflows/rust.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 58ee01b84..8a6637858 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -111,7 +111,7 @@ jobs: args: --all --no-fail-fast Coverage: - needs: Formatting + needs: Testing runs-on: ubuntu-latest steps: - name: Checkout repository @@ -130,7 +130,7 @@ jobs: with: # TODO: update to latest tarpaulin once artefact download is fixed: https://github.com/actions-rs/tarpaulin/pull/23 version: "0.22.0" - args: "--workspace --all-features --run-types Tests,Doctests --out Lcov --timeout 900" + args: "--workspace --all-features --run-types Tests,Doctests --out Lcov --timeout 1800" - name: Upload coverage uses: coverallsapp/github-action@v1 From c9876d2823a12dd8db6e85b07e41ec0ebb6a31f0 Mon Sep 17 00:00:00 2001 From: David Laehnemann Date: Wed, 28 Jun 2023 16:44:14 +0200 Subject: [PATCH 16/18] do not run bio::io::fastq doctests that read from stdin --- src/io/fastq.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/io/fastq.rs b/src/io/fastq.rs index 23067eadb..220cd3718 100644 --- a/src/io/fastq.rs +++ b/src/io/fastq.rs @@ -11,7 +11,7 @@ //! //! In this example, we parse a fastq file from stdin and compute some statistics //! -//! ``` +//! ```no_run //! use bio::io::fastq; //! use std::io; //! let mut reader = fastq::Reader::new(io::stdin()); @@ -31,7 +31,7 @@ //! ``` //! //! We can also use a `while` loop to iterate over records -//! ``` +//! ```no_run //! use bio::io::fastq; //! use std::io; //! let mut records = fastq::Reader::new(io::stdin()).records(); @@ -78,7 +78,7 @@ //! //! In this example we filter reads from stdin on mean quality (Phred + 33) and write them to stdout //! -//! ``` +//! ```no_run //! use bio::io::fastq; //! use bio::io::fastq::FastqRead; //! use std::io; From 17077ebbd04f894cf25d1f9a3324c1fc6bc43906 Mon Sep 17 00:00:00 2001 From: David Laehnemann Date: Wed, 28 Jun 2023 20:37:05 +0200 Subject: [PATCH 17/18] exclude all doctests that read from io::stdin() from being run (they are still compiled) --- src/io/fasta.rs | 6 +++--- src/io/gff.rs | 2 +- src/lib.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/io/fasta.rs b/src/io/fasta.rs index aa9a4591a..46667780d 100644 --- a/src/io/fasta.rs +++ b/src/io/fasta.rs @@ -11,7 +11,7 @@ //! //! In this example, we parse a fasta file from stdin and compute some statistics //! -//! ``` +//! ```no_run //! use bio::io::fasta; //! use std::io; //! @@ -34,7 +34,7 @@ //! //! We can also use a `while` loop to iterate over records. //! This is slightly faster than the `for` loop. -//! ``` +//! ```no_run //! use bio::io::fasta; //! use std::io; //! let mut records = fasta::Reader::new(io::stdin()).records(); @@ -79,7 +79,7 @@ //! //! In this example we filter reads from stdin on sequence length and write them to stdout //! -//! ``` +//! ```no_run //! use bio::io::fasta; //! use bio::io::fasta::FastaRead; //! use std::io; diff --git a/src/io/gff.rs b/src/io/gff.rs index a6654ce5e..b34b0d56f 100644 --- a/src/io/gff.rs +++ b/src/io/gff.rs @@ -11,7 +11,7 @@ //! //! # Example //! -//! ``` +//! ```no_run //! // import functions (at top of script) //! use bio::io::gff; //! use std::io; diff --git a/src/lib.rs b/src/lib.rs index fe9c09a48..e25d2d095 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -95,7 +95,7 @@ //! //! An example of using `rust-bio`: //! -//! ```rust +//! ```no_run //! // Import some modules //! use bio::alphabets; //! use bio::data_structures::bwt::{bwt, less, Occ}; From 889e87d9ffbf9f40ddb779ed72d3f8912d8ce4ba Mon Sep 17 00:00:00 2001 From: David Laehnemann Date: Wed, 28 Jun 2023 20:38:30 +0200 Subject: [PATCH 18/18] reduce tarpaulin --timeout back to 5 minutes, put needs: back to Formatting --- .github/workflows/rust.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 8a6637858..a848a1d39 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -111,7 +111,7 @@ jobs: args: --all --no-fail-fast Coverage: - needs: Testing + needs: Formatting runs-on: ubuntu-latest steps: - name: Checkout repository @@ -130,7 +130,7 @@ jobs: with: # TODO: update to latest tarpaulin once artefact download is fixed: https://github.com/actions-rs/tarpaulin/pull/23 version: "0.22.0" - args: "--workspace --all-features --run-types Tests,Doctests --out Lcov --timeout 1800" + args: "--workspace --all-features --run-types Tests,Doctests --out Lcov --timeout 300" - name: Upload coverage uses: coverallsapp/github-action@v1