From ddb1113f5e4e1b0ddfffb4df839a976b16a3f93f Mon Sep 17 00:00:00 2001 From: joss Date: Sat, 11 Nov 2023 11:28:19 +0000 Subject: [PATCH 01/21] Adding mutation tests to pipeline --- .github/workflows/cicd.yaml | 25 ++++++++++++++++++++++++- requirements-dev.txt | 3 ++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index 743b076..23bcea5 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -31,4 +31,27 @@ jobs: - name: ☂️ Upload coverage reports to Codecov uses: codecov/codecov-action@v3 env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + - name: 📥 Download Mutation Testing Cache + uses: actions/download-artifact@v2 + with: + name: mutmut-cache + continue-on-error: true + + - name: 🦠 Run Mutation Tests + run: | + mutmut run + mutmut html + + - name: 📤 Upload Mutation Test Report + uses: actions/upload-artifact@v2 + with: + name: mutmut-html-report + path: html/bookshelf + + - name: 📤 Upload Mutation Test Cache + uses: actions/upload-artifact@v2 + with: + name: mutmut-cache + path: .mutmut-cache \ No newline at end of file diff --git a/requirements-dev.txt b/requirements-dev.txt index 0445f91..8750e5b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,4 +4,5 @@ assertpy~=1.1.0 pytest==7.4.3 pytest-cov==4.1.0 setuptools==68.2.2 -flake8~=6.1.0 \ No newline at end of file +flake8~=6.1.0 +mutmut~=2.4.4 \ No newline at end of file From 49f015a6b32eab5468329eb3400080a0b9971f6b Mon Sep 17 00:00:00 2001 From: joss Date: Sat, 11 Nov 2023 11:28:54 +0000 Subject: [PATCH 02/21] Updating gitignore for mutmut files --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 489eb25..05eeb9a 100644 --- a/.gitignore +++ b/.gitignore @@ -180,4 +180,7 @@ docs/.env docs/.env.production # macOS-specific files -docs/.DS_Store \ No newline at end of file +docs/.DS_Store + +html/ +.mutmut-cache \ No newline at end of file From 6511e4a4f29d8260d101e27fad7bb651001f37ca Mon Sep 17 00:00:00 2001 From: joss Date: Sat, 11 Nov 2023 11:33:02 +0000 Subject: [PATCH 03/21] Updating mutmut to not show progress during pipeline run --- .github/workflows/cicd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index 23bcea5..c45935c 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -41,7 +41,7 @@ jobs: - name: 🦠 Run Mutation Tests run: | - mutmut run + mutmut run --no-progress mutmut html - name: 📤 Upload Mutation Test Report From 056f385a57681f1deac547551c2dd039a1b68fd4 Mon Sep 17 00:00:00 2001 From: joss Date: Sat, 11 Nov 2023 11:35:57 +0000 Subject: [PATCH 04/21] Updating mutmut to use CI options --- .github/workflows/cicd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index c45935c..b2c8241 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -41,7 +41,7 @@ jobs: - name: 🦠 Run Mutation Tests run: | - mutmut run --no-progress + mutmut run --no-progress --CI mutmut html - name: 📤 Upload Mutation Test Report From 2fdc2ee1e974346194ddffd35b48ced46a797573 Mon Sep 17 00:00:00 2001 From: joss Date: Sat, 11 Nov 2023 11:40:17 +0000 Subject: [PATCH 05/21] Setting pipeline to be 3.11 --- .github/workflows/cicd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index b2c8241..39bd0f2 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -17,7 +17,7 @@ jobs: - name: 🐍 Set up Python uses: actions/setup-python@v2 with: - python-version: 3.x # Specify your desired Python version + python-version: 3.11 - name: 📦 Install dependencies run: pip install -r requirements-dev.txt # Replace with your requirements file From a4eb9c5f01eed8261cb162a5c82b47ef16a23d51 Mon Sep 17 00:00:00 2001 From: Joss Moffatt Date: Sat, 11 Nov 2023 11:54:24 +0000 Subject: [PATCH 06/21] Update action versions to v4 --- .github/workflows/cicd.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index 39bd0f2..97700fb 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -12,10 +12,10 @@ jobs: steps: - name: 🔄 Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: 🐍 Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.11 @@ -54,4 +54,4 @@ jobs: uses: actions/upload-artifact@v2 with: name: mutmut-cache - path: .mutmut-cache \ No newline at end of file + path: .mutmut-cache From 9ef0e258be808993fc8f125ef8de003bc2c990f6 Mon Sep 17 00:00:00 2001 From: Joss Moffatt Date: Sat, 11 Nov 2023 13:00:24 +0000 Subject: [PATCH 07/21] Using cache action to access across build --- .github/workflows/cicd.yaml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index 97700fb..492d6f9 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -34,10 +34,11 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - name: 📥 Download Mutation Testing Cache - uses: actions/download-artifact@v2 + uses: actions/cache/restore@v3 + id: cache with: - name: mutmut-cache - continue-on-error: true + path: path/to/dependencies + key: ${{ runner.os }}-${{ hashFiles('**/.mutmut-cache') }} - name: 🦠 Run Mutation Tests run: | @@ -50,8 +51,8 @@ jobs: name: mutmut-html-report path: html/bookshelf - - name: 📤 Upload Mutation Test Cache - uses: actions/upload-artifact@v2 + - name: 📤 Cache Mutation Test Cache + uses: actions/cache/save@v3 with: - name: mutmut-cache path: .mutmut-cache + key: ${{ runner.os }}-${{ hashFiles('**/.mutmut-cache') }} From 1b0433432d8bc7f362f59056558030ad7d36023c Mon Sep 17 00:00:00 2001 From: Joss Moffatt Date: Sat, 11 Nov 2023 13:03:49 +0000 Subject: [PATCH 08/21] Updating cache emoji --- .github/workflows/cicd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index 492d6f9..992b0eb 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -45,7 +45,7 @@ jobs: mutmut run --no-progress --CI mutmut html - - name: 📤 Upload Mutation Test Report + - name: 🗄️ Upload Mutation Test Report uses: actions/upload-artifact@v2 with: name: mutmut-html-report From b4424a6c429b09894e98b32368e9a605f62fd407 Mon Sep 17 00:00:00 2001 From: Joss Moffatt Date: Sat, 11 Nov 2023 13:18:04 +0000 Subject: [PATCH 09/21] Fixing caching actions --- .github/workflows/cicd.yaml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index 992b0eb..360c235 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -33,19 +33,27 @@ jobs: env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - - name: 📥 Download Mutation Testing Cache + - name: 🗃️ Uncache PR Mutation Testing Cache uses: actions/cache/restore@v3 - id: cache + id: cache-pr with: path: path/to/dependencies - key: ${{ runner.os }}-${{ hashFiles('**/.mutmut-cache') }} + key: ${{ runner.os }}-mutmut-cache-${{ env.BRANCH_NAME }} + + - name: 🗃️ Uncache Main Mutation Testing Cache + if: steps.cache.outputs.cache-hit != 'true' + uses: actions/cache/restore@v3 + id: cache-main + with: + path: .mutmut-cache + key: ${{ runner.os }}-mutmut-cache-main - name: 🦠 Run Mutation Tests run: | mutmut run --no-progress --CI mutmut html - - name: 🗄️ Upload Mutation Test Report + - name: 📤 Upload Mutation Test Report uses: actions/upload-artifact@v2 with: name: mutmut-html-report @@ -55,4 +63,4 @@ jobs: uses: actions/cache/save@v3 with: path: .mutmut-cache - key: ${{ runner.os }}-${{ hashFiles('**/.mutmut-cache') }} + key: ${{ runner.os }}-mutmut-cache-${{ env.BRANCH_NAME }} From 5750c6e92220fe4dddc995bcec4fe2b36520d44d Mon Sep 17 00:00:00 2001 From: Joss Moffatt Date: Sat, 11 Nov 2023 13:30:35 +0000 Subject: [PATCH 10/21] Fixing branch name --- .github/workflows/cicd.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index 360c235..db103ae 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -38,7 +38,7 @@ jobs: id: cache-pr with: path: path/to/dependencies - key: ${{ runner.os }}-mutmut-cache-${{ env.BRANCH_NAME }} + key: ${{ runner.os }}-mutmut-cache-${{GITHUB_HEAD_REF}} - name: 🗃️ Uncache Main Mutation Testing Cache if: steps.cache.outputs.cache-hit != 'true' @@ -63,4 +63,4 @@ jobs: uses: actions/cache/save@v3 with: path: .mutmut-cache - key: ${{ runner.os }}-mutmut-cache-${{ env.BRANCH_NAME }} + key: ${{ runner.os }}-mutmut-cache-${{GITHUB_HEAD_REF}} From 096528cd688d3421b5d9eb5494e92aa72a2b98e4 Mon Sep 17 00:00:00 2001 From: Joss Moffatt Date: Sat, 11 Nov 2023 13:37:19 +0000 Subject: [PATCH 11/21] Fixing typo --- .github/workflows/cicd.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index db103ae..1bb2922 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -38,7 +38,7 @@ jobs: id: cache-pr with: path: path/to/dependencies - key: ${{ runner.os }}-mutmut-cache-${{GITHUB_HEAD_REF}} + key: ${{ runner.os }}-mutmut-cache-${{env.GITHUB_HEAD_REF}} - name: 🗃️ Uncache Main Mutation Testing Cache if: steps.cache.outputs.cache-hit != 'true' @@ -63,4 +63,4 @@ jobs: uses: actions/cache/save@v3 with: path: .mutmut-cache - key: ${{ runner.os }}-mutmut-cache-${{GITHUB_HEAD_REF}} + key: ${{ runner.os }}-mutmut-cache-${{env.GITHUB_HEAD_REF}} From 140ca2cad2766ef7cc295ea1eb6238af9c8772b5 Mon Sep 17 00:00:00 2001 From: Joss Moffatt Date: Sat, 11 Nov 2023 13:42:27 +0000 Subject: [PATCH 12/21] Trying different environment variable --- .github/workflows/cicd.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index 1bb2922..b98d146 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -38,7 +38,7 @@ jobs: id: cache-pr with: path: path/to/dependencies - key: ${{ runner.os }}-mutmut-cache-${{env.GITHUB_HEAD_REF}} + key: ${{ runner.os }}-mutmut-cache-${{ github.head_ref }} - name: 🗃️ Uncache Main Mutation Testing Cache if: steps.cache.outputs.cache-hit != 'true' @@ -63,4 +63,4 @@ jobs: uses: actions/cache/save@v3 with: path: .mutmut-cache - key: ${{ runner.os }}-mutmut-cache-${{env.GITHUB_HEAD_REF}} + key: ${{ runner.os }}-mutmut-cache-${{ github.head_ref }} From f410b28081c0dca8a701a535ee00af14b9a31a0f Mon Sep 17 00:00:00 2001 From: Joss Moffatt Date: Sat, 11 Nov 2023 13:50:39 +0000 Subject: [PATCH 13/21] Update emoji --- .github/workflows/cicd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index b98d146..788d69c 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -59,7 +59,7 @@ jobs: name: mutmut-html-report path: html/bookshelf - - name: 📤 Cache Mutation Test Cache + - name: 🗃️ Cache Mutation Test Cache uses: actions/cache/save@v3 with: path: .mutmut-cache From 65280db3366a7073e97f15934ac189ac603e7adb Mon Sep 17 00:00:00 2001 From: Joss Moffatt Date: Sat, 11 Nov 2023 14:03:24 +0000 Subject: [PATCH 14/21] Fixing key path --- .github/workflows/cicd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index 788d69c..b3ee706 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -37,7 +37,7 @@ jobs: uses: actions/cache/restore@v3 id: cache-pr with: - path: path/to/dependencies + path: .mutmut-cache key: ${{ runner.os }}-mutmut-cache-${{ github.head_ref }} - name: 🗃️ Uncache Main Mutation Testing Cache From 49dfab2f0bc50687d6a9b369c1e7498216a32b22 Mon Sep 17 00:00:00 2001 From: Joss Moffatt Date: Sat, 11 Nov 2023 14:10:12 +0000 Subject: [PATCH 15/21] Using hash of files for cache key --- .github/workflows/cicd.yaml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index b3ee706..5f93849 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -38,15 +38,7 @@ jobs: id: cache-pr with: path: .mutmut-cache - key: ${{ runner.os }}-mutmut-cache-${{ github.head_ref }} - - - name: 🗃️ Uncache Main Mutation Testing Cache - if: steps.cache.outputs.cache-hit != 'true' - uses: actions/cache/restore@v3 - id: cache-main - with: - path: .mutmut-cache - key: ${{ runner.os }}-mutmut-cache-main + key: ${{ runner.os }}-mutmut-cache-${{ hashFiles('**/bookshelf') }} - name: 🦠 Run Mutation Tests run: | @@ -63,4 +55,4 @@ jobs: uses: actions/cache/save@v3 with: path: .mutmut-cache - key: ${{ runner.os }}-mutmut-cache-${{ github.head_ref }} + key: ${{ runner.os }}-mutmut-cache-${{ hashFiles('**/bookshelf') }} From 6cd96131808c28d8ef3dee40662da668b7547892 Mon Sep 17 00:00:00 2001 From: Joss Moffatt Date: Sat, 11 Nov 2023 14:44:12 +0000 Subject: [PATCH 16/21] Fixing hash path --- .github/workflows/cicd.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index 5f93849..8a4b79d 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -38,7 +38,7 @@ jobs: id: cache-pr with: path: .mutmut-cache - key: ${{ runner.os }}-mutmut-cache-${{ hashFiles('**/bookshelf') }} + key: ${{ runner.os }}-mutmut-cache-${{ hashFiles('**/bookshelf/bookshelf') }} - name: 🦠 Run Mutation Tests run: | @@ -55,4 +55,4 @@ jobs: uses: actions/cache/save@v3 with: path: .mutmut-cache - key: ${{ runner.os }}-mutmut-cache-${{ hashFiles('**/bookshelf') }} + key: ${{ runner.os }}-mutmut-cache-${{ hashFiles('**/bookshelf/bookshelf') }} From 54db47832c1cbf7a8a4eac7796efcbc336c88e18 Mon Sep 17 00:00:00 2001 From: Joss Moffatt Date: Sat, 11 Nov 2023 14:49:37 +0000 Subject: [PATCH 17/21] Fixing save path From a3c176558bca90610dc40542bc4f58595f72ab6d Mon Sep 17 00:00:00 2001 From: Joss Moffatt Date: Sat, 11 Nov 2023 15:30:35 +0000 Subject: [PATCH 18/21] Update cicd.yaml --- .github/workflows/cicd.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index 8a4b79d..0efb133 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -38,7 +38,7 @@ jobs: id: cache-pr with: path: .mutmut-cache - key: ${{ runner.os }}-mutmut-cache-${{ hashFiles('**/bookshelf/bookshelf') }} + key: ${{ runner.os }}-mutmut-cache-${{ hashFiles('~/bookshelf') }} - name: 🦠 Run Mutation Tests run: | @@ -55,4 +55,4 @@ jobs: uses: actions/cache/save@v3 with: path: .mutmut-cache - key: ${{ runner.os }}-mutmut-cache-${{ hashFiles('**/bookshelf/bookshelf') }} + key: ${{ runner.os }}-mutmut-cache-${{ hashFiles('~/bookshelf') }} From 0be5d7b81814b53e53496acfa521081c7aa11658 Mon Sep 17 00:00:00 2001 From: Joss Moffatt Date: Sat, 11 Nov 2023 15:34:20 +0000 Subject: [PATCH 19/21] Update cicd.yaml --- .github/workflows/cicd.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index 0efb133..2fe48bb 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -38,7 +38,7 @@ jobs: id: cache-pr with: path: .mutmut-cache - key: ${{ runner.os }}-mutmut-cache-${{ hashFiles('~/bookshelf') }} + key: ${{ runner.os }}-mutmut-cache-${{ hashFiles('bookshelf') }} - name: 🦠 Run Mutation Tests run: | @@ -55,4 +55,4 @@ jobs: uses: actions/cache/save@v3 with: path: .mutmut-cache - key: ${{ runner.os }}-mutmut-cache-${{ hashFiles('~/bookshelf') }} + key: ${{ runner.os }}-mutmut-cache-${{ hashFiles('bookshelf') }} From 8e75e84096b924d84b80063f871082ade653bc97 Mon Sep 17 00:00:00 2001 From: Joss Moffatt Date: Sat, 11 Nov 2023 16:11:35 +0000 Subject: [PATCH 20/21] Update cicd.yaml --- .github/workflows/cicd.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index 2fe48bb..29da59f 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -38,7 +38,7 @@ jobs: id: cache-pr with: path: .mutmut-cache - key: ${{ runner.os }}-mutmut-cache-${{ hashFiles('bookshelf') }} + key: ${{ runner.os }}-mutmut-cache-${{ hashFiles('bookshelf/*.py') }} - name: 🦠 Run Mutation Tests run: | @@ -55,4 +55,4 @@ jobs: uses: actions/cache/save@v3 with: path: .mutmut-cache - key: ${{ runner.os }}-mutmut-cache-${{ hashFiles('bookshelf') }} + key: ${{ runner.os }}-mutmut-cache-${{ hashFiles('bookshelf/*.py') }} From 5b3e9b17baa7b13dcae65c6268d25f5dcbcd56e8 Mon Sep 17 00:00:00 2001 From: Joss Moffatt Date: Sat, 11 Nov 2023 16:18:05 +0000 Subject: [PATCH 21/21] Rename mutation testing stage --- .github/workflows/cicd.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index 29da59f..6dfc4bf 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -33,9 +33,8 @@ jobs: env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - - name: 🗃️ Uncache PR Mutation Testing Cache + - name: 🗃️ Uncache Mutation Testing Artifacts uses: actions/cache/restore@v3 - id: cache-pr with: path: .mutmut-cache key: ${{ runner.os }}-mutmut-cache-${{ hashFiles('bookshelf/*.py') }}