diff --git a/.github/workflows/python-mutation-tests.yml b/.github/workflows/python-mutation-tests.yml index 38a60e1c8..2324d85ee 100644 --- a/.github/workflows/python-mutation-tests.yml +++ b/.github/workflows/python-mutation-tests.yml @@ -7,11 +7,11 @@ on: # Todo; remove the push, they take to long push: branches: - - add-mutation-testing-with-cosmic-ray + - add-mutation-testing jobs: - tests: - name: Python mutation tests + cosmic-ray: + name: Python mutation tests - Cosmic Ray runs-on: ubuntu-latest strategy: @@ -37,7 +37,6 @@ jobs: - name: Run mutation tests run: | - # Todo: Can we make it faster in GitHub Actions # Todo: Drop the --force, it just here for easy local copy and paste poetry run cosmic-ray init setup.cfg cosmic-ray.sqlite --force echo "Initialised" @@ -46,5 +45,36 @@ jobs: - name: Report results # Todo: Only show failures https://github.com/sixty-north/cosmic-ray/issues/561 run: poetry run cr-report cosmic-ray.sqlite --show-diff - env: - PYTHON_VERSION: ${{ matrix.python-version }} + + mutmut: + name: Python mutation tests - mutmut + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + python-version: ["3.12"] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Display Python version + run: python --version + + - name: Install dependencies + run: | + pip install poetry + poetry install + + - name: Run mutation tests + run: | + poetry run mutmut run + + - name: Report results + # Todo: Only show failures https://github.com/sixty-north/cosmic-ray/issues/561 + run: poetry run mutmut results diff --git a/pytest.ini b/pytest.ini index 59117759d..7b1fb739e 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,9 +1,9 @@ [pytest] env = AWS_DEFAULT_REGION=eu-west-2 -addopts = --tb=short --numprocesses auto --dist loadgroup +; addopts = --tb=short --numprocesses auto --dist loadgroup ; You may need to use the addopts setting below to unbreak debugging in your IDE -; addopts = --tb=short +addopts = --tb=short filterwarnings = ignore::UserWarning:moto.cloudformation.parsing.* diff --git a/setup.cfg b/setup.cfg index 204e5d129..7df75fb6d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,19 +1,23 @@ [cosmic-ray] -module-path = "utils" +module-path = utils timeout = 10.0 excluded-modules = ["**/node_modules/**/*"] -test-command = "poetry run pytest tests/utils" +test-command = poetry run pytest tests/utils [cosmic-ray.distributor] name = "local" ; name = "http" [cosmic-ray.distributor.http] -worker-urls = ["http://localhost:9876","http://localhost:9877","http://localhost:9878","http://localhost:9879"] +worker-urls = + http://localhost:9876 + http://localhost:9877 + http://localhost:9878 + http://localhost:9879 [mutmut] -paths_to_mutate = "utils/" -runner="poetry run pytest tests/utils" -tests_dir = "tests/utils" +paths_to_mutate = utils +runner= poetry run pytest tests/utils +tests_dir = tests/utils also_copy= - "dbt_platform_helper" + dbt_platform_helper