Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into windows-mount
Browse files Browse the repository at this point in the history
  • Loading branch information
sourcefrog committed Oct 21, 2024
2 parents ef27f3a + 2d631fb commit 8bee9c1
Show file tree
Hide file tree
Showing 35 changed files with 1,180 additions and 513 deletions.
32 changes: 16 additions & 16 deletions .cargo/mutants.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,6 @@ exclude_re = [
"replace <impl Iterator for IterStitchedIndexHunks>::next -> Option<Self::Item> with Some\\(Default::default\\(\\)\\)",
]

# examine_globs = [
# # "src/backup.rs",
# # "src/bandid.rs",
# "src/blockdir.rs",
# "src/blockhash.rs",
# "src/bin/conserve.rs",
# "src/change.rs",
# "src/counters.rs",
# "src/jsonio.rs",
# "src/restore.rs",
# "src/stitch.rs",
# # "src/transport.rs",
# "src/transport/local.rs",
# ]

# Include only files that are currently well-tested; most of the others should
# be tested eventually (https://github.com/sourcefrog/conserve/issues/241.
#
Expand All @@ -34,9 +19,24 @@ exclude_re = [
# text format might change.
#
# I test for mutants on Unix so skip Windows code.
examine_globs = [
"src/apath.rs",
"src/bandid.rs",
"src/blockdir.rs",
"src/blockhash.rs",
"src/change.rs",
"src/counters.rs",
"src/jsonio.rs",
"src/stitch.rs",
# "src/restore.rs", # really close but not quite covered
# # "src/backup.rs",
# "src/bin/conserve.rs",
"src/transport.rs",
# "src/transport/local.rs",
]

exclude_globs = [
"backup.rs", # almost well tested but some gaps
"bandid.rs", # almost well tested but some gaps
"metric_recorder.rs",
"progress.rs",
"src/hunk_index.rs", # not well tested yet?
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/install.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Check install from crates.io works, both with and without --locked.
#
# This is mostly to check for loose dependencies that might have broken
# the build after it was released.

on:
push:
paths:
Expand All @@ -16,4 +21,4 @@ jobs:
steps:
- name: cargo-install
run: |
cargo install cargo-mutants ${{ matrix.locked }} --features=${{ matrix.features }}
cargo install cargo-mutants ${{ matrix.locked }} --features=${{ matrix.features }}
65 changes: 0 additions & 65 deletions .github/workflows/mutants.yml

This file was deleted.

80 changes: 61 additions & 19 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,34 @@ env:
# TODO: Add -D warnings when that's clean on Windows.

jobs:
# Run tests just on Ubuntu to establish that things basically work,
# before launching mutants etc
quick-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: swatinem/rust-cache@v2
- name: Show version
run: |
rustup show
cargo --version
rustc --version
- name: Test
run: >
cargo test --features fail/failpoints
tests:
needs: [quick-test]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
features: ["", "s3"]
version: [stable, nightly, "1.76"]
version: [stable, nightly, "1.79"]

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -79,7 +99,7 @@ jobs:

# S3 integration tests can't run from CI because they need credentials, but we
# can at least make sure that they compile.
build-large-tests:
build-all-features:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -88,22 +108,9 @@ jobs:
toolchain: stable
- uses: swatinem/rust-cache@v2
- name: cargo build
run: cargo build --all-targets --features s3,s3-integration-test
run: cargo build --all-targets --all-features

clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: swatinem/rust-cache@v2
- name: clippy
run: cargo clippy --all-targets -- --deny clippy::all

# Not all features can be run: s3 integration tests require credentials.
# But all of them should compile.
check-all-features:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -117,7 +124,7 @@ jobs:
pr-mutants:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
needs: [tests]
needs: [quick-test]
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -136,11 +143,46 @@ jobs:
tool: cargo-mutants
- name: Mutants in diff
run: >
cargo mutants --no-shuffle -vV --in-diff git.diff -- --features
cargo mutants --no-shuffle -vV --in-diff git.diff --in-place -- --features
fail/failpoints
- name: Archive mutants.out
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: mutants-incremental.out
path: mutants.out

cargo-mutants:
runs-on: ubuntu-latest
needs: [quick-test]
strategy:
# We want to see all the missed mutants so don't fail fast.
fail-fast: false
matrix:
shard: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: taiki-e/install-action@v2
name: Install cargo-mutants using install-action
with:
tool: cargo-mutants
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: swatinem/rust-cache@v2
- name: Run mutant tests
# Don't use the S3 features because they require AWS credentials for realistic
# testing.
run: |
cargo mutants --no-shuffle -vV --cargo-arg=--no-default-features \
--in-place \
--baseline=skip --shard ${{ matrix.shard }}/10 \
-- \
--features fail/failpoints
- name: Archive results
uses: actions/upload-artifact@v4
if: always()
with:
name: mutants-${{ matrix.shard }}.out
path: mutants.out
Loading

0 comments on commit 8bee9c1

Please sign in to comment.