Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: basic mutation testing with cargo mutants #2232

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Oct 29, 2024

  1. WIP: basic mutation testing with cargo mutants

    - Update nixpkgs to get latest cargo-mutants.
    - Remove nixWithFlakes from flake.nix because it would have to be
      changed to work with the latest version of nixpkgs and I think we no
      longer need it.
    - Create a non-flaky test profile.
    - Run with `cargo mutants`.
    - Inspect output and `./mutants.out` directory
    
    For example `./mutants.out/missed.txt` looks like this
    
        contract-bindings/src/plonk_verifier_2.rs:463:13: replace plonk_verifier_2::<impl AbiEncode for PlonkVerifier2Calls>::encode -> Vec<u8> with vec![]
        hotshot-state-prover/src/mock_ledger.rs:496:57: replace + with * in gen_circuit_for_test
        hotshot-state-prover/src/mock_ledger.rs:496:53: replace * with / in gen_circuit_for_test
        hotshot-state-prover/src/mock_ledger.rs:149:9: replace MockLedger::elapse_without_block with ()
        contract-bindings/src/light_client_mock.rs:1928:21: replace == with != in light_client_mock::<impl ContractRevert for LightClientMockErrors>::valid_selector
        contract-bindings/src/erc1967_proxy.rs:319:13: replace erc1967_proxy::<impl AbiEncode for ERC1967ProxyErrors>::encode -> ::std::vec::Vec<u8> with vec![0]
        hotshot-state-prover/src/circuit.rs:236:29: replace % with / in build
    
    To make it really useful further configuration is likely necessary, such
    as marking some functions to not mutate them.
    sveitser committed Oct 29, 2024
    Configuration menu
    Copy the full SHA
    340a69e View commit details
    Browse the repository at this point in the history
  2. Add missing file

    sveitser committed Oct 29, 2024
    Configuration menu
    Copy the full SHA
    3e9ccb7 View commit details
    Browse the repository at this point in the history