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

Feat/test jude pr mutants source #58

Open
wants to merge 13 commits into
base: feat/test-jude-pr-mutants
Choose a base branch
from
Open
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
118 changes: 94 additions & 24 deletions .github/workflows/pr-differences-mutants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,17 @@ jobs:
runs-on: ubuntu-latest

outputs:
run_big_packages: ${{ steps.check_packages_and_shards.outputs.run_big_packages }}
big_packages_with_shards: ${{ steps.check_packages_and_shards.outputs.big_packages_with_shards }}
run_stackslib: ${{ steps.check_packages_and_shards.outputs.run_stackslib }}
stackslib_with_shards: ${{ steps.check_packages_and_shards.outputs.stackslib_with_shards }}
run_stacks_node: ${{ steps.check_packages_and_shards.outputs.run_stacks_node }}
stacks_node_with_shards: ${{ steps.check_packages_and_shards.outputs.stacks_node_with_shards }}
run_small_packages: ${{ steps.check_packages_and_shards.outputs.run_small_packages }}
small_packages_with_shards: ${{ steps.check_packages_and_shards.outputs.small_packages_with_shards }}
run_stacks_signer: ${{ steps.check_packages_and_shards.outputs.run_stacks_signer }}

steps:
- id: check_packages_and_shards
uses: stacks-network/actions/stacks-core/mutation-testing/check-packages-and-shards@main
uses: stacks-network/actions/stacks-core/mutation-testing/check-packages-and-shards@feat/mutation-testing

# Mutation testing - Execute on PR on small packages that have functions modified (normal run, no shards)
pr-differences-mutants-small-normal:
Expand All @@ -44,9 +47,9 @@ jobs:

steps:
- name: Run mutants on diffs
uses: stacks-network/actions/stacks-core/mutation-testing/pr-differences@main
uses: stacks-network/actions/stacks-core/mutation-testing/pr-differences@feat/mutation-testing
with:
package-dimension: "small"
package: "small"

# Mutation testing - Execute on PR on small packages that have functions modified (run with strategy matrix shards)
pr-differences-mutants-small-shards:
Expand All @@ -65,18 +68,18 @@ jobs:

steps:
- name: Run mutants on diffs
uses: stacks-network/actions/stacks-core/mutation-testing/pr-differences@main
uses: stacks-network/actions/stacks-core/mutation-testing/pr-differences@feat/mutation-testing
with:
shard: ${{ matrix.shard }}
package-dimension: "small"
package: "small"

# Mutation testing - Execute on PR on big packages that have functions modified (normal run, no shards)
pr-differences-mutants-big-normal:
name: Mutation Testing - Normal, Big
# Mutation testing - Execute on PR on stackslib package (normal run, no shards)
pr-differences-mutants-stackslib-normal:
name: Mutation Testing - Normal, Stackslib

needs: check-big-packages-and-shards

if: ${{ needs.check-big-packages-and-shards.outputs.run_big_packages == 'true' && needs.check-big-packages-and-shards.outputs.big_packages_with_shards == 'false' }}
if: ${{ needs.check-big-packages-and-shards.outputs.run_stackslib == 'true' && needs.check-big-packages-and-shards.outputs.stackslib_with_shards == 'false' }}

runs-on: ubuntu-latest

Expand All @@ -85,17 +88,17 @@ jobs:
env:
BITCOIND_TEST: 1
RUST_BACKTRACE: full
uses: stacks-network/actions/stacks-core/mutation-testing/pr-differences@main
uses: stacks-network/actions/stacks-core/mutation-testing/pr-differences@feat/mutation-testing
with:
package-dimension: "big"
package: "stackslib"

# Mutation testing - Execute on PR on big packages that have functions modified (run with strategy matrix shards)
pr-differences-mutants-big-shards:
name: Mutation Testing - Shards, Big
# Mutation testing - Execute on PR on stackslib package (run with strategy matrix shards)
pr-differences-mutants-stackslib-shards:
name: Mutation Testing - Shards, Stackslib

needs: check-big-packages-and-shards

if: ${{ needs.check-big-packages-and-shards.outputs.run_big_packages == 'true' && needs.check-big-packages-and-shards.outputs.big_packages_with_shards == 'true' }}
if: ${{ needs.check-big-packages-and-shards.outputs.run_stackslib == 'true' && needs.check-big-packages-and-shards.outputs.stackslib_with_shards == 'true' }}

runs-on: ubuntu-latest

Expand All @@ -109,31 +112,98 @@ jobs:
env:
BITCOIND_TEST: 1
RUST_BACKTRACE: full
uses: stacks-network/actions/stacks-core/mutation-testing/pr-differences@main
uses: stacks-network/actions/stacks-core/mutation-testing/pr-differences@feat/mutation-testing
with:
shard: ${{ matrix.shard }}
package-dimension: "big"
package: "stackslib"

# Mutation testing - Execute on PR on stacks-node package (normal run, no shards)
pr-differences-mutants-stacks-node-normal:
name: Mutation Testing - Normal, Stacks Node

needs: check-big-packages-and-shards

if: ${{ needs.check-big-packages-and-shards.outputs.run_stacks_node == 'true' && needs.check-big-packages-and-shards.outputs.stacks_node_with_shards == 'false' }}

runs-on: ubuntu-latest

steps:
- name: Run Run mutants on diffs
env:
BITCOIND_TEST: 1
RUST_BACKTRACE: full
uses: stacks-network/actions/stacks-core/mutation-testing/pr-differences@feat/mutation-testing
with:
package: "stacks-node"

# Mutation testing - Execute on PR on stacks-node package (run with strategy matrix shards)
pr-differences-mutants-stacks-node-shards:
name: Mutation Testing - Shards, Stacks Node

needs: check-big-packages-and-shards

if: ${{ needs.check-big-packages-and-shards.outputs.run_stacks_node == 'true' && needs.check-big-packages-and-shards.outputs.stacks_node_with_shards == 'true' }}

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
shard: [0, 1, 2, 3]

steps:
- name: Run mutants on diffs
env:
BITCOIND_TEST: 1
RUST_BACKTRACE: full
uses: stacks-network/actions/stacks-core/mutation-testing/pr-differences@feat/mutation-testing
with:
shard: ${{ matrix.shard }}
package: "stacks-node"

# Mutation testing - Execute on PR on stacks-signer package (normal run, no shards)
pr-differences-mutants-stacks-signer-normal:
name: Mutation Testing - Normal, Stacks Signer

needs: check-big-packages-and-shards

if: ${{ needs.check-big-packages-and-shards.outputs.run_stacks_signer == 'true' }}

runs-on: ubuntu-latest

steps:
- name: Run Run mutants on diffs
uses: stacks-network/actions/stacks-core/mutation-testing/pr-differences@feat/mutation-testing
with:
package: "stacks-signer"

# Output the mutants and fail the workflow if there are missed/timeout/unviable mutants
output-mutants:
name: Output Mutants

runs-on: ubuntu-latest

if: always()
needs:
[
check-big-packages-and-shards,
pr-differences-mutants-small-normal,
pr-differences-mutants-small-shards,
pr-differences-mutants-big-normal,
pr-differences-mutants-big-shards,
pr-differences-mutants-stackslib-normal,
pr-differences-mutants-stackslib-shards,
pr-differences-mutants-stacks-node-normal,
pr-differences-mutants-stacks-node-shards,
pr-differences-mutants-stacks-signer-normal,
]

steps:
- name: Output Mutants
uses: stacks-network/actions/stacks-core/mutation-testing/output-pr-mutants@main
uses: stacks-network/actions/stacks-core/mutation-testing/output-pr-mutants@feat/mutation-testing
with:
big_packages: ${{ needs.check-big-packages-and-shards.outputs.run_big_packages }}
shards_for_big_packages: ${{ needs.check-big-packages-and-shards.outputs.big_packages_with_shards }}
stackslib_package: ${{ needs.check-big-packages-and-shards.outputs.run_stackslib }}
shards_for_stackslib_package: ${{ needs.check-big-packages-and-shards.outputs.stackslib_with_shards }}
stacks_node_package: ${{ needs.check-big-packages-and-shards.outputs.run_stacks_node }}
shards_for_stacks_node_package: ${{ needs.check-big-packages-and-shards.outputs.stacks_node_with_shards }}
small_packages: ${{ needs.check-big-packages-and-shards.outputs.run_small_packages }}
shards_for_small_packages: ${{ needs.check-big-packages-and-shards.outputs.small_packages_with_shards }}
stacks_signer: ${{ needs.check-big-packages-and-shards.outputs.run_stacks_signer }}
2 changes: 1 addition & 1 deletion stackslib/src/chainstate/nakamoto/coordinator/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ pub fn boot_nakamoto<'a>(
}

/// Make a replay peer, used for replaying the blockchain
fn make_replay_peer<'a>(peer: &mut TestPeer<'a>) -> TestPeer<'a> {
pub fn make_replay_peer<'a>(peer: &mut TestPeer<'a>) -> TestPeer<'a> {
let mut replay_config = peer.config.clone();
replay_config.test_name = format!("{}.replay", &peer.config.test_name);
replay_config.server_port = 0;
Expand Down
6 changes: 4 additions & 2 deletions stackslib/src/net/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,13 +411,14 @@ pub struct ConnectionOptions {
pub disable_inbound_handshakes: bool,
pub disable_stackerdb_get_chunks: bool,
pub force_disconnect_interval: Option<u64>,
pub force_nakamoto_epoch_transition: bool,
}

impl std::default::Default for ConnectionOptions {
fn default() -> ConnectionOptions {
ConnectionOptions {
inbox_maxlen: 5,
outbox_maxlen: 5,
inbox_maxlen: 1024,
outbox_maxlen: 1024,
connect_timeout: 10, // how long a socket can be in a connecting state
handshake_timeout: 30, // how long before a peer must send a handshake, after connecting
timeout: 30, // how long to wait for a reply to a request
Expand Down Expand Up @@ -503,6 +504,7 @@ impl std::default::Default for ConnectionOptions {
disable_inbound_handshakes: false,
disable_stackerdb_get_chunks: false,
force_disconnect_interval: None,
force_nakamoto_epoch_transition: false,
}
}
}
Expand Down
Loading
Loading