Skip to content

Commit 381c512

Browse files
committed
Introduce basic incremental mutation testing
We introduce a CI job for mutation testing of PR diffs using cargo-mutants. Missed cases do not trigger a fail of this job yet as we just introduce it now for visibility. We may start enforcing stricter rules at a later stage.
1 parent 88e1b56 commit 381c512

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,3 +247,19 @@ jobs:
247247
rustup component add rustfmt
248248
- name: Run rustfmt checks
249249
run: ci/rustfmt.sh
250+
251+
incremental-mutants:
252+
runs-on: ubuntu-latest
253+
steps:
254+
- uses: actions/checkout@v3
255+
with:
256+
fetch-depth: 0
257+
- name: Relative diff
258+
run: |
259+
git branch -av
260+
git diff origin/main.. | tee git.diff
261+
- uses: Swatinem/rust-cache@v2
262+
- name: Mutants
263+
run: |
264+
cargo install cargo-mutants
265+
cargo mutants --no-shuffle -j 2 -vV --in-diff git.diff

lightning/src/ln/channel.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7522,6 +7522,8 @@ impl<SP: Deref> OutboundV1Channel<SP> where SP::Target: SignerProvider {
75227522
if !self.context.is_outbound() {
75237523
panic!("Tried to create outbound funding_created message on an inbound channel!");
75247524
}
7525+
// REMOVE ME - TRIGGER MUTANTS
7526+
if is_batch_funding {};
75257527
if !matches!(
75267528
self.context.channel_state, ChannelState::NegotiatingFunding(flags)
75277529
if flags == (NegotiatingFundingFlags::OUR_INIT_SENT | NegotiatingFundingFlags::THEIR_INIT_SENT)

0 commit comments

Comments
 (0)