Skip to content

Commit f1dd80a

Browse files
author
Brandon Williams
committed
chore(ci): gate replay test with #[ignore] instead of test = false
Previously, `[[test]] test = false` excluded `tests/replay.rs` from `cargo check --tests` and `cargo clippy --all-targets`, so clippy and the type checker silently stopped looking at the file. With this commit, the replay test uses `#[ignore]` to stay out of default `cargo test` runs while remaining visible to lints and compilation. The replay workflow now opts in with `cargo test --test replay -- --ignored --nocapture`.
1 parent 74a71ab commit f1dd80a

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎.github/workflows/replay.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
exit 1
6868
fi
6969
- run: rustup toolchain install stable --profile minimal
70-
- run: cargo test --release --test replay -- --nocapture
70+
- run: cargo test --release --test replay -- --ignored --nocapture
7171
env:
7272
DIFFY_TEST_REPO: ${{ inputs.repo_url == '' && '.' || 'target/test-repo' }}
7373
DIFFY_TEST_COMMITS: ${{ inputs.commits }}

‎Cargo.toml‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,3 @@ snapbox = { version = "0.6.24", features = ["dir"] }
2525
[[example]]
2626
name = "patch_formatter"
2727
required-features = ["color"]
28-
29-
[[test]]
30-
name = "replay"
31-
test = false

‎tests/replay.rs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,11 @@ fn process_commit(repo: &Path, parent: &str, child: &str, mode: TestMode) -> Com
445445
}
446446
}
447447

448+
// Ignored by default so `cargo test` stays fast; CI opts in via `--ignored`.
449+
// Using `#[ignore]` instead of `test = false` keeps the file in clippy's
450+
// `--all-targets` view so lints still fire here.
448451
#[test]
452+
#[ignore = "replay test runs git subprocesses; opt in via --ignored"]
449453
fn replay() {
450454
let repo = repo_path();
451455
let selection = commit_selection();

0 commit comments

Comments
 (0)