Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

feat: initial testing with cargo mutants v2 #2

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/actions/bitcoin-int-tests/Dockerfile.mutation-tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM rust:bullseye

# Set the working directory in the container
WORKDIR /src

# Copy all the files into the container
COPY . .

# Update rustup and build the project
RUN rustup update && \
cargo build

# Install cargo-mutagen
RUN cargo install cargo-mutagen

# Remove old log folders (TODO: check if to delete)
# RUN rm -rf mutants.out mutants.out.old/

# Make a directory for mutants
RUN mkdir -p mutants

# Run mutants for different packages
RUN cargo mutants --package clarity --output mutants/clarity && \
cargo mutants --package libsigner --output mutants/libsigner && \
cargo mutants --package libstackerdb --output mutants/libstackerdb && \
cargo mutants --package pox-locking --output mutants/pox-locking && \
cargo mutants --package stacks-common --output mutants/stacks-common && \
cargo mutants --package stx-genesis --output mutants/stx-genesis

# Comment out the commands for 'stacks-node' and 'stackslib' following the mutants.sh script
# RUN cargo mutants --package stacks-signer --output mutants/stacks-signer
# RUN cargo mutants --package stacks-node --output mutants/stacks-node
# RUN cargo mutants --package stackslib --output mutants/stackslib
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pip-log.txt
.coverage
.tox
nosetests.xml
mutants.out*

# Translations
*.mo
Expand Down
32 changes: 32 additions & 0 deletions build-scripts/mutants.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

# Create mutants directory
mkdir mutants

# Run mutation testing for clarity package
cargo mutants --package clarity --output mutants/clarity

# Run mutation testing for libsigner package
cargo mutants --package libsigner --output mutants/libsigner

# Run mutation testing for libstackerdb package
cargo mutants --package libstackerdb --output mutants/libstackerdb

# Run mutation testing for pox-locking package
cargo mutants --package pox-locking --output mutants/pox-locking

# Run mutation testing for stacks-common package
cargo mutants --package stacks-common --output mutants/stacks-common

# Run mutation testing for stx-genesis package
cargo mutants --package stx-genesis --output mutants/stx-genesis


# Run mutation testing for stacks-signer package - working, 10 min approx.
# cargo mutants --package stacks-signer --output mutants/stacks-signer

# Commented out mutation testing for stacks-node package due to test errors and long compile/testing time
# cargo mutants --package stacks-node --output mutants/stacks-node

# Commented out mutation testing for stackslib package due to long compile/testing time
# cargo mutants --package stackslib --output mutants/stackslib
Loading