From 3e28fb4100dc91d215da673e567fe47059de518c Mon Sep 17 00:00:00 2001 From: "Willem-Jan L. van Rootselaar" Date: Mon, 7 Oct 2024 16:06:19 +0200 Subject: [PATCH 01/27] fix tests --- .github/workflows/tests.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 9dd378c0..dbaf2319 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -35,7 +35,9 @@ jobs: - name: ๐Ÿ— Install dependencies run: poetry install --no-interaction - name: ๐Ÿš€ Run pytest - run: poetry run pytest --cov bsblan tests + run: poetry run pytest --cov=bsblan --cov-report=xml --cov-report=term tests + # - name: ๐Ÿš€ Run pytest + # run: poetry run pytest --cov bsblan tests - name: โฌ†๏ธ Upload coverage artifact uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3 with: @@ -52,6 +54,8 @@ jobs: fetch-depth: 0 - name: โฌ‡๏ธ Download coverage data uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3 + with: + path: coverage-data - name: ๐Ÿ— Set up Poetry run: pipx install poetry - name: ๐Ÿ— Set up Python ${{ env.DEFAULT_PYTHON }} @@ -70,8 +74,12 @@ jobs: run: | poetry run coverage combine coverage*/.coverage* poetry run coverage xml -i + poetry run coverage report - name: ๐Ÿš€ Upload coverage report uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4 + with: + name: coverage-${{ matrix.python }} + path: .coverage,coverage.xml - name: SonarCloud Scan if: github.repository_owner == 'frenck' uses: SonarSource/sonarcloud-github-action@eb211723266fe8e83102bac7361f0a05c3ac1d1b # v3.0 From 1c863213c842a00d80f37dd210e63a711aaf22e5 Mon Sep 17 00:00:00 2001 From: "Willem-Jan L. van Rootselaar" Date: Mon, 7 Oct 2024 16:08:25 +0200 Subject: [PATCH 02/27] fix indents --- .github/workflows/tests.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index dbaf2319..11b1a219 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -55,7 +55,7 @@ jobs: - name: โฌ‡๏ธ Download coverage data uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3 with: - path: coverage-data + path: coverage-data - name: ๐Ÿ— Set up Poetry run: pipx install poetry - name: ๐Ÿ— Set up Python ${{ env.DEFAULT_PYTHON }} @@ -78,8 +78,8 @@ jobs: - name: ๐Ÿš€ Upload coverage report uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4 with: - name: coverage-${{ matrix.python }} - path: .coverage,coverage.xml + name: coverage-${{ matrix.python }} + path: .coverage,coverage.xml - name: SonarCloud Scan if: github.repository_owner == 'frenck' uses: SonarSource/sonarcloud-github-action@eb211723266fe8e83102bac7361f0a05c3ac1d1b # v3.0 From 966fe37e4a0b71132d54582a847411db7c783e8b Mon Sep 17 00:00:00 2001 From: "Willem-Jan L. van Rootselaar" Date: Mon, 7 Oct 2024 16:10:10 +0200 Subject: [PATCH 03/27] remove comments --- .github/workflows/tests.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 11b1a219..75b36504 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -36,8 +36,6 @@ jobs: run: poetry install --no-interaction - name: ๐Ÿš€ Run pytest run: poetry run pytest --cov=bsblan --cov-report=xml --cov-report=term tests - # - name: ๐Ÿš€ Run pytest - # run: poetry run pytest --cov bsblan tests - name: โฌ†๏ธ Upload coverage artifact uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3 with: From cef547fa2cebc2f3b52f0da3d18fc07dc21790eb Mon Sep 17 00:00:00 2001 From: "Willem-Jan L. van Rootselaar" Date: Mon, 7 Oct 2024 16:15:45 +0200 Subject: [PATCH 04/27] more fixes --- .github/workflows/tests.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 75b36504..5951e699 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -35,7 +35,10 @@ jobs: - name: ๐Ÿ— Install dependencies run: poetry install --no-interaction - name: ๐Ÿš€ Run pytest - run: poetry run pytest --cov=bsblan --cov-report=xml --cov-report=term tests + run: | + poetry run pytest --cov=bsblan --cov-report=xml --cov-report=term tests + mv .coverage .coverage.${{ matrix.python }} + - name: โฌ†๏ธ Upload coverage artifact uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3 with: @@ -53,7 +56,7 @@ jobs: - name: โฌ‡๏ธ Download coverage data uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3 with: - path: coverage-data + name: coverage - name: ๐Ÿ— Set up Poetry run: pipx install poetry - name: ๐Ÿ— Set up Python ${{ env.DEFAULT_PYTHON }} From 2b6bc2eaaca524084820a9c713b0ddd4ee0d115b Mon Sep 17 00:00:00 2001 From: "Willem-Jan L. van Rootselaar" Date: Mon, 7 Oct 2024 16:21:16 +0200 Subject: [PATCH 05/27] more fixes --- .github/workflows/tests.yaml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 5951e699..972d52f6 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -43,7 +43,9 @@ jobs: uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3 with: name: coverage-${{ matrix.python }} - path: .coverage + path: | + .coverage + coverage.xml coverage: runs-on: ubuntu-latest @@ -56,7 +58,13 @@ jobs: - name: โฌ‡๏ธ Download coverage data uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3 with: - name: coverage + name: coverage-${{ matrix.python }} + path: coverage-data + - name: Debug - List downloaded files + run: | + ls -R coverage-data + echo "Current directory:" + pwd - name: ๐Ÿ— Set up Poetry run: pipx install poetry - name: ๐Ÿ— Set up Python ${{ env.DEFAULT_PYTHON }} @@ -73,6 +81,7 @@ jobs: run: poetry install --no-interaction - name: ๐Ÿš€ Process coverage results run: | + cd coverage-data poetry run coverage combine coverage*/.coverage* poetry run coverage xml -i poetry run coverage report From 89a1fcaf9ce7388365cd1c74d1f9e95d33c9a503 Mon Sep 17 00:00:00 2001 From: "Willem-Jan L. van Rootselaar" Date: Mon, 7 Oct 2024 16:25:00 +0200 Subject: [PATCH 06/27] tweak name --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 972d52f6..55fb3856 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -58,7 +58,7 @@ jobs: - name: โฌ‡๏ธ Download coverage data uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3 with: - name: coverage-${{ matrix.python }} + name: coverage-${{ env.DEFAULT_PYTHON }} path: coverage-data - name: Debug - List downloaded files run: | From 96bf754e73033a555d62ba27f8215687d47a8705 Mon Sep 17 00:00:00 2001 From: "Willem-Jan L. van Rootselaar" Date: Mon, 7 Oct 2024 16:28:27 +0200 Subject: [PATCH 07/27] fix path --- .github/workflows/tests.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 55fb3856..7f2ac063 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -37,7 +37,8 @@ jobs: - name: ๐Ÿš€ Run pytest run: | poetry run pytest --cov=bsblan --cov-report=xml --cov-report=term tests - mv .coverage .coverage.${{ matrix.python }} + mkdir coverage_data + mv .coverage coverage_data/.coverage.${{ matrix.python }} - name: โฌ†๏ธ Upload coverage artifact uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3 From c4853efef3fa26319467307fae5dc98aec1ce5e7 Mon Sep 17 00:00:00 2001 From: "Willem-Jan L. van Rootselaar" Date: Mon, 7 Oct 2024 16:32:13 +0200 Subject: [PATCH 08/27] tweak --- .github/workflows/tests.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 7f2ac063..3b40b7c2 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -44,9 +44,7 @@ jobs: uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3 with: name: coverage-${{ matrix.python }} - path: | - .coverage - coverage.xml + path: coverage_data coverage: runs-on: ubuntu-latest From 955f29a7f36758764af5eb51960d46c0890f7347 Mon Sep 17 00:00:00 2001 From: "Willem-Jan L. van Rootselaar" Date: Mon, 7 Oct 2024 16:35:50 +0200 Subject: [PATCH 09/27] debug --- .github/workflows/tests.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 3b40b7c2..cec629e0 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -78,6 +78,14 @@ jobs: poetry config virtualenvs.in-project true - name: ๐Ÿ— Install dependencies run: poetry install --no-interaction + - name: Debug - Show coverage file contents + run: | + cd coverage_data + for file in .coverage*; do + echo "Contents of $file:" + cat "$file" + echo "-------------------" + done - name: ๐Ÿš€ Process coverage results run: | cd coverage-data From 43f0e5dc5d4babcdadd8287c622fa5160a587026 Mon Sep 17 00:00:00 2001 From: "Willem-Jan L. van Rootselaar" Date: Mon, 7 Oct 2024 16:38:35 +0200 Subject: [PATCH 10/27] debug files --- .github/workflows/tests.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index cec629e0..96c56780 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -39,6 +39,10 @@ jobs: poetry run pytest --cov=bsblan --cov-report=xml --cov-report=term tests mkdir coverage_data mv .coverage coverage_data/.coverage.${{ matrix.python }} + - name: Debug - List files after tests + run: | + ls -la + cat .coverage - name: โฌ†๏ธ Upload coverage artifact uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3 From 973c2bbedf4716d94a6350589547a3e4d6a9a7f4 Mon Sep 17 00:00:00 2001 From: "Willem-Jan L. van Rootselaar" Date: Tue, 8 Oct 2024 09:21:20 +0200 Subject: [PATCH 11/27] tweak debug steps in CI workflow for coverage data --- .github/workflows/tests.yaml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 96c56780..f3cbc02c 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -39,10 +39,10 @@ jobs: poetry run pytest --cov=bsblan --cov-report=xml --cov-report=term tests mkdir coverage_data mv .coverage coverage_data/.coverage.${{ matrix.python }} - - name: Debug - List files after tests + - name: Debug - Check coverage_data contents run: | - ls -la - cat .coverage + echo "Contents of coverage_data directory:" + ls -la coverage_data/ - name: โฌ†๏ธ Upload coverage artifact uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3 @@ -92,10 +92,20 @@ jobs: done - name: ๐Ÿš€ Process coverage results run: | - cd coverage-data - poetry run coverage combine coverage*/.coverage* + if [ -d "coverage_data" ]; then + cd coverage_data + coverage_files=$(find . -name ".coverage*") + if [ -z "$coverage_files" ]; then + echo "No coverage files found in coverage_data" + exit 1 + fi + poetry run coverage combine $coverage_files poetry run coverage xml -i poetry run coverage report + else + echo "coverage_data directory not found" + exit 1 + fi - name: ๐Ÿš€ Upload coverage report uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4 with: From 7bc1c6a75a1c9b2d86ee268d4231c5b61e292f83 Mon Sep 17 00:00:00 2001 From: "Willem-Jan L. van Rootselaar" Date: Tue, 8 Oct 2024 09:30:14 +0200 Subject: [PATCH 12/27] fix: ensure coverage data directory is created and paths are consistent --- .github/workflows/tests.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index f3cbc02c..502bae33 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -37,8 +37,10 @@ jobs: - name: ๐Ÿš€ Run pytest run: | poetry run pytest --cov=bsblan --cov-report=xml --cov-report=term tests - mkdir coverage_data + mkdir -p coverage_data mv .coverage coverage_data/.coverage.${{ matrix.python }} + echo "After moving coverage file:" + ls -la coverage_data/ - name: Debug - Check coverage_data contents run: | echo "Contents of coverage_data directory:" @@ -48,7 +50,7 @@ jobs: uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3 with: name: coverage-${{ matrix.python }} - path: coverage_data + path: coverage_data/ coverage: runs-on: ubuntu-latest @@ -62,7 +64,7 @@ jobs: uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3 with: name: coverage-${{ env.DEFAULT_PYTHON }} - path: coverage-data + path: coverage-data/ - name: Debug - List downloaded files run: | ls -R coverage-data From f37becc59f546aa3743b6f0cfc8ec46fa48f4f16 Mon Sep 17 00:00:00 2001 From: "Willem-Jan L. van Rootselaar" Date: Tue, 8 Oct 2024 09:37:12 +0200 Subject: [PATCH 13/27] fix: improve debug output for coverage data directory checks --- .github/workflows/tests.yaml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 502bae33..2a2d9e05 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -67,7 +67,7 @@ jobs: path: coverage-data/ - name: Debug - List downloaded files run: | - ls -R coverage-data + ls -R coverage-data || echo "coverage-data directory not found" echo "Current directory:" pwd - name: ๐Ÿ— Set up Poetry @@ -86,12 +86,17 @@ jobs: run: poetry install --no-interaction - name: Debug - Show coverage file contents run: | - cd coverage_data - for file in .coverage*; do - echo "Contents of $file:" - cat "$file" - echo "-------------------" - done + if [ -d "coverage_data" ]; then + cd coverage_data + for file in .coverage*; do + echo "Contents of $file:" + cat "$file" + echo "-------------------" + done + else + echo "coverage_data directory not found" + exit 1 + fi - name: ๐Ÿš€ Process coverage results run: | if [ -d "coverage_data" ]; then From 3570bd60fd3fc9b9e4a4fa8d33c3c0587adfcb8d Mon Sep 17 00:00:00 2001 From: "Willem-Jan L. van Rootselaar" Date: Tue, 8 Oct 2024 09:47:22 +0200 Subject: [PATCH 14/27] fix: move coverage.xml to coverage_data directory and enhance debug output --- .github/workflows/tests.yaml | 42 ++++++++++++++---------------------- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 2a2d9e05..f294c39d 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -39,6 +39,7 @@ jobs: poetry run pytest --cov=bsblan --cov-report=xml --cov-report=term tests mkdir -p coverage_data mv .coverage coverage_data/.coverage.${{ matrix.python }} + mv coverage.xml coverage_data/coverage.xml echo "After moving coverage file:" ls -la coverage_data/ - name: Debug - Check coverage_data contents @@ -67,9 +68,12 @@ jobs: path: coverage-data/ - name: Debug - List downloaded files run: | - ls -R coverage-data || echo "coverage-data directory not found" echo "Current directory:" pwd + echo "Directory contents:" + ls -la + echo "coverage_data contents:" + ls -la coverage_data || echo "coverage_data directory not found" - name: ๐Ÿ— Set up Poetry run: pipx install poetry - name: ๐Ÿ— Set up Python ${{ env.DEFAULT_PYTHON }} @@ -84,40 +88,26 @@ jobs: poetry config virtualenvs.in-project true - name: ๐Ÿ— Install dependencies run: poetry install --no-interaction - - name: Debug - Show coverage file contents + - name: ๐Ÿš€ Process coverage results run: | if [ -d "coverage_data" ]; then - cd coverage_data - for file in .coverage*; do - echo "Contents of $file:" - cat "$file" - echo "-------------------" - done + cd coverage_data/ + coverage_files=$(find . -name ".coverage*") + if [ -z "$coverage_files" ]; then + echo "No coverage files found in coverage_data" + exit 1 + fi + poetry run coverage combine $coverage_files + poetry run coverage xml -i + poetry run coverage report else echo "coverage_data directory not found" exit 1 fi - - name: ๐Ÿš€ Process coverage results - run: | - if [ -d "coverage_data" ]; then - cd coverage_data - coverage_files=$(find . -name ".coverage*") - if [ -z "$coverage_files" ]; then - echo "No coverage files found in coverage_data" - exit 1 - fi - poetry run coverage combine $coverage_files - poetry run coverage xml -i - poetry run coverage report - else - echo "coverage_data directory not found" - exit 1 - fi - name: ๐Ÿš€ Upload coverage report uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4 with: - name: coverage-${{ matrix.python }} - path: .coverage,coverage.xml + directory: ./coverage_data/ - name: SonarCloud Scan if: github.repository_owner == 'frenck' uses: SonarSource/sonarcloud-github-action@eb211723266fe8e83102bac7361f0a05c3ac1d1b # v3.0 From 090fa6982d8c012cea074634303688d57af8fece Mon Sep 17 00:00:00 2001 From: "Willem-Jan L. van Rootselaar" Date: Tue, 8 Oct 2024 09:52:33 +0200 Subject: [PATCH 15/27] fix: streamline coverage processing by removing unnecessary directory handling and enhancing debug output --- .github/workflows/tests.yaml | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index f294c39d..c7154e2c 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -37,11 +37,7 @@ jobs: - name: ๐Ÿš€ Run pytest run: | poetry run pytest --cov=bsblan --cov-report=xml --cov-report=term tests - mkdir -p coverage_data - mv .coverage coverage_data/.coverage.${{ matrix.python }} - mv coverage.xml coverage_data/coverage.xml - echo "After moving coverage file:" - ls -la coverage_data/ + ls -la # Debug: List files after pytest - name: Debug - Check coverage_data contents run: | echo "Contents of coverage_data directory:" @@ -51,7 +47,9 @@ jobs: uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3 with: name: coverage-${{ matrix.python }} - path: coverage_data/ + path: | + .coverage + coverage.xml coverage: runs-on: ubuntu-latest @@ -72,8 +70,6 @@ jobs: pwd echo "Directory contents:" ls -la - echo "coverage_data contents:" - ls -la coverage_data || echo "coverage_data directory not found" - name: ๐Ÿ— Set up Poetry run: pipx install poetry - name: ๐Ÿ— Set up Python ${{ env.DEFAULT_PYTHON }} @@ -90,24 +86,18 @@ jobs: run: poetry install --no-interaction - name: ๐Ÿš€ Process coverage results run: | - if [ -d "coverage_data" ]; then - cd coverage_data/ - coverage_files=$(find . -name ".coverage*") - if [ -z "$coverage_files" ]; then - echo "No coverage files found in coverage_data" - exit 1 - fi - poetry run coverage combine $coverage_files + if [ -f ".coverage" ]; then + poetry run coverage combine .coverage poetry run coverage xml -i poetry run coverage report else - echo "coverage_data directory not found" + echo ".coverage file not found" exit 1 fi - name: ๐Ÿš€ Upload coverage report uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4 with: - directory: ./coverage_data/ + files: ./coverage.xml - name: SonarCloud Scan if: github.repository_owner == 'frenck' uses: SonarSource/sonarcloud-github-action@eb211723266fe8e83102bac7361f0a05c3ac1d1b # v3.0 From 2bd0d7cf42faf4937c4206027d8b8e721d7e6b38 Mon Sep 17 00:00:00 2001 From: "Willem-Jan L. van Rootselaar" Date: Tue, 8 Oct 2024 09:54:55 +0200 Subject: [PATCH 16/27] fix: remove redundant debug step for coverage_data directory in CI workflow --- .github/workflows/tests.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index c7154e2c..8ef79abd 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -38,11 +38,6 @@ jobs: run: | poetry run pytest --cov=bsblan --cov-report=xml --cov-report=term tests ls -la # Debug: List files after pytest - - name: Debug - Check coverage_data contents - run: | - echo "Contents of coverage_data directory:" - ls -la coverage_data/ - - name: โฌ†๏ธ Upload coverage artifact uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3 with: From 482d52870a69e18c6f9e54ca47f4bde66c498fb4 Mon Sep 17 00:00:00 2001 From: "Willem-Jan L. van Rootselaar" Date: Tue, 8 Oct 2024 10:05:21 +0200 Subject: [PATCH 17/27] fix: remove path specification for coverage data in CI workflow --- .github/workflows/tests.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 8ef79abd..946b0b5c 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -58,7 +58,6 @@ jobs: uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3 with: name: coverage-${{ env.DEFAULT_PYTHON }} - path: coverage-data/ - name: Debug - List downloaded files run: | echo "Current directory:" From 1d853301f04dc1a8d7e5be110c9e10be5cf1055c Mon Sep 17 00:00:00 2001 From: "Willem-Jan L. van Rootselaar" Date: Tue, 8 Oct 2024 10:18:25 +0200 Subject: [PATCH 18/27] fix: enhance debug output for coverage processing and check .coverage file --- .github/workflows/tests.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 946b0b5c..ce3f2cae 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -64,6 +64,12 @@ jobs: pwd echo "Directory contents:" ls -la + - name: Debug - Check .coverage file + run: | + echo "First 100 bytes of .coverage file:" + head -c 100 .coverage | xxd + echo "File type of .coverage:" + file .coverage - name: ๐Ÿ— Set up Poetry run: pipx install poetry - name: ๐Ÿ— Set up Python ${{ env.DEFAULT_PYTHON }} @@ -78,9 +84,15 @@ jobs: poetry config virtualenvs.in-project true - name: ๐Ÿ— Install dependencies run: poetry install --no-interaction + - name: Debug - Check coverage version + run: poetry run coverage --version - name: ๐Ÿš€ Process coverage results run: | if [ -f ".coverage" ]; then + echo "Coverage file exists" + ls -l .coverage + poetry run coverage debug sys + poetry run coverage debug data poetry run coverage combine .coverage poetry run coverage xml -i poetry run coverage report From 3a12acd32702a6cbb69599c11808133ed9c99d5f Mon Sep 17 00:00:00 2001 From: "Willem-Jan L. van Rootselaar" Date: Tue, 8 Oct 2024 10:49:04 +0200 Subject: [PATCH 19/27] fix: simplify coverage processing by combining coverage files with append option --- .github/workflows/tests.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ce3f2cae..fd90e0d0 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -91,9 +91,7 @@ jobs: if [ -f ".coverage" ]; then echo "Coverage file exists" ls -l .coverage - poetry run coverage debug sys - poetry run coverage debug data - poetry run coverage combine .coverage + poetry run coverage combine --append .coverage poetry run coverage xml -i poetry run coverage report else From 17d4bc1477aeca5f58051ee3cadf0c4e5188894f Mon Sep 17 00:00:00 2001 From: "Willem-Jan L. van Rootselaar" Date: Tue, 8 Oct 2024 10:51:45 +0200 Subject: [PATCH 20/27] fix: update coverage processing to regenerate data and simplify steps --- .github/workflows/tests.yaml | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index fd90e0d0..5be8036a 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -86,18 +86,25 @@ jobs: run: poetry install --no-interaction - name: Debug - Check coverage version run: poetry run coverage --version - - name: ๐Ÿš€ Process coverage results + - name: Regenerate coverage data run: | - if [ -f ".coverage" ]; then - echo "Coverage file exists" - ls -l .coverage - poetry run coverage combine --append .coverage - poetry run coverage xml -i - poetry run coverage report - else - echo ".coverage file not found" - exit 1 - fi + poetry run coverage erase + poetry run coverage run -m pytest tests/ + poetry run coverage combine + poetry run coverage xml -i + poetry run coverage report + # - name: ๐Ÿš€ Process coverage results + # run: | + # if [ -f ".coverage" ]; then + # echo "Coverage file exists" + # ls -l .coverage + # poetry run coverage combine --append .coverage + # poetry run coverage xml -i + # poetry run coverage report + # else + # echo ".coverage file not found" + # exit 1 + # fi - name: ๐Ÿš€ Upload coverage report uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4 with: From e965a4d2fb039e08b7bf5a81bf31befdea999718 Mon Sep 17 00:00:00 2001 From: "Willem-Jan L. van Rootselaar" Date: Tue, 8 Oct 2024 10:56:18 +0200 Subject: [PATCH 21/27] fix: remove debug step for .coverage file and update coverage data processing --- .github/workflows/tests.yaml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 5be8036a..4c01ed83 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -64,12 +64,12 @@ jobs: pwd echo "Directory contents:" ls -la - - name: Debug - Check .coverage file - run: | - echo "First 100 bytes of .coverage file:" - head -c 100 .coverage | xxd - echo "File type of .coverage:" - file .coverage + # - name: Debug - Check .coverage file + # run: | + # echo "First 100 bytes of .coverage file:" + # head -c 100 .coverage | xxd + # echo "File type of .coverage:" + # file .coverage - name: ๐Ÿ— Set up Poetry run: pipx install poetry - name: ๐Ÿ— Set up Python ${{ env.DEFAULT_PYTHON }} @@ -86,11 +86,10 @@ jobs: run: poetry install --no-interaction - name: Debug - Check coverage version run: poetry run coverage --version - - name: Regenerate coverage data + - name: Convert and reprocess coverage data run: | - poetry run coverage erase - poetry run coverage run -m pytest tests/ - poetry run coverage combine + poetry run coverage json + poetry run coverage combine coverage.json poetry run coverage xml -i poetry run coverage report # - name: ๐Ÿš€ Process coverage results From 62ffd9a5cccc21c4117187b4fc28122540e1ee59 Mon Sep 17 00:00:00 2001 From: "Willem-Jan L. van Rootselaar" Date: Tue, 8 Oct 2024 10:58:28 +0200 Subject: [PATCH 22/27] fix: update coverage processing to include SQLite database checks and streamline result handling --- .github/workflows/tests.yaml | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 4c01ed83..d3d385ff 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -86,24 +86,22 @@ jobs: run: poetry install --no-interaction - name: Debug - Check coverage version run: poetry run coverage --version - - name: Convert and reprocess coverage data + - name: Debug SQLite database run: | - poetry run coverage json - poetry run coverage combine coverage.json - poetry run coverage xml -i - poetry run coverage report - # - name: ๐Ÿš€ Process coverage results - # run: | - # if [ -f ".coverage" ]; then - # echo "Coverage file exists" - # ls -l .coverage - # poetry run coverage combine --append .coverage - # poetry run coverage xml -i - # poetry run coverage report - # else - # echo ".coverage file not found" - # exit 1 - # fi + echo ".tables" | sqlite3 .coverage + echo "SELECT * FROM coverage_schema;" | sqlite3 .coverage + - name: ๐Ÿš€ Process coverage results + run: | + if [ -f ".coverage" ]; then + echo "Coverage file exists" + ls -l .coverage + poetry run coverage combine --append .coverage + poetry run coverage xml -i + poetry run coverage report + else + echo ".coverage file not found" + exit 1 + fi - name: ๐Ÿš€ Upload coverage report uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4 with: From 26e52e9ce274bacc2fc83ab45776747b2c8fa7ca Mon Sep 17 00:00:00 2001 From: "Willem-Jan L. van Rootselaar" Date: Tue, 8 Oct 2024 10:58:57 +0200 Subject: [PATCH 23/27] fix: update SonarCloud scan condition to reflect new repository owner --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index d3d385ff..444d8329 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -107,7 +107,7 @@ jobs: with: files: ./coverage.xml - name: SonarCloud Scan - if: github.repository_owner == 'frenck' + if: github.repository_owner == 'liudger' uses: SonarSource/sonarcloud-github-action@eb211723266fe8e83102bac7361f0a05c3ac1d1b # v3.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From af4a66c4d72bdbd59450fa1cebc5e5d19be8ff8f Mon Sep 17 00:00:00 2001 From: "Willem-Jan L. van Rootselaar" Date: Tue, 8 Oct 2024 11:09:29 +0200 Subject: [PATCH 24/27] redo config --- .github/workflows/tests.yaml | 63 +++++++++--------------------------- 1 file changed, 15 insertions(+), 48 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 444d8329..8b47ec1c 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -19,12 +19,12 @@ jobs: python: ["3.12"] steps: - name: โคต๏ธ Check out code from GitHub - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 + uses: actions/checkout@v4.2.1 - name: ๐Ÿ— Set up Poetry run: pipx install poetry - name: ๐Ÿ— Set up Python ${{ matrix.python }} id: python - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5 + uses: actions/setup-python@v5.2.0 with: python-version: ${{ matrix.python }} cache: 'poetry' @@ -35,80 +35,47 @@ jobs: - name: ๐Ÿ— Install dependencies run: poetry install --no-interaction - name: ๐Ÿš€ Run pytest - run: | - poetry run pytest --cov=bsblan --cov-report=xml --cov-report=term tests - ls -la # Debug: List files after pytest + run: poetry run pytest --cov bsblan tests - name: โฌ†๏ธ Upload coverage artifact - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3 + uses: actions/upload-artifact@v4.4.1 with: name: coverage-${{ matrix.python }} - path: | - .coverage - coverage.xml + include-hidden-files: true + path: .coverage coverage: runs-on: ubuntu-latest needs: pytest steps: - name: โคต๏ธ Check out code from GitHub - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 + uses: actions/checkout@v4.2.1 with: fetch-depth: 0 - name: โฌ‡๏ธ Download coverage data - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3 - with: - name: coverage-${{ env.DEFAULT_PYTHON }} - - name: Debug - List downloaded files - run: | - echo "Current directory:" - pwd - echo "Directory contents:" - ls -la - # - name: Debug - Check .coverage file - # run: | - # echo "First 100 bytes of .coverage file:" - # head -c 100 .coverage | xxd - # echo "File type of .coverage:" - # file .coverage + uses: actions/download-artifact@v4.1.8 - name: ๐Ÿ— Set up Poetry run: pipx install poetry - name: ๐Ÿ— Set up Python ${{ env.DEFAULT_PYTHON }} id: python - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5 + uses: actions/setup-python@v5.2.0 with: python-version: ${{ env.DEFAULT_PYTHON }} - cache: 'poetry' + cache: "poetry" - name: ๐Ÿ— Install workflow dependencies run: | poetry config virtualenvs.create true poetry config virtualenvs.in-project true - name: ๐Ÿ— Install dependencies run: poetry install --no-interaction - - name: Debug - Check coverage version - run: poetry run coverage --version - - name: Debug SQLite database - run: | - echo ".tables" | sqlite3 .coverage - echo "SELECT * FROM coverage_schema;" | sqlite3 .coverage - name: ๐Ÿš€ Process coverage results run: | - if [ -f ".coverage" ]; then - echo "Coverage file exists" - ls -l .coverage - poetry run coverage combine --append .coverage - poetry run coverage xml -i - poetry run coverage report - else - echo ".coverage file not found" - exit 1 - fi + poetry run coverage combine coverage*/.coverage* + poetry run coverage xml -i - name: ๐Ÿš€ Upload coverage report - uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4 - with: - files: ./coverage.xml + uses: codecov/codecov-action@v4.6.0 - name: SonarCloud Scan - if: github.repository_owner == 'liudger' - uses: SonarSource/sonarcloud-github-action@eb211723266fe8e83102bac7361f0a05c3ac1d1b # v3.0 + if: github.event.pull_request.head.repo.fork == false + uses: SonarSource/sonarcloud-github-action@v3.1.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} From d1373e5b5fa56421a72d8a24e4985c528ad34202 Mon Sep 17 00:00:00 2001 From: "Willem-Jan L. van Rootselaar" Date: Tue, 8 Oct 2024 11:13:44 +0200 Subject: [PATCH 25/27] fix: update SonarCloud scan condition to check repository owner --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 8b47ec1c..44dc9c4f 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -74,7 +74,7 @@ jobs: - name: ๐Ÿš€ Upload coverage report uses: codecov/codecov-action@v4.6.0 - name: SonarCloud Scan - if: github.event.pull_request.head.repo.fork == false + if: github.repository_owner == 'liudger' uses: SonarSource/sonarcloud-github-action@v3.1.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 3283520fec41030712a21941f7a5b67191662584 Mon Sep 17 00:00:00 2001 From: "Willem-Jan L. van Rootselaar" Date: Tue, 8 Oct 2024 11:26:11 +0200 Subject: [PATCH 26/27] fix: update SonarCloud scan condition to check for non-forked repositories --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 44dc9c4f..8b47ec1c 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -74,7 +74,7 @@ jobs: - name: ๐Ÿš€ Upload coverage report uses: codecov/codecov-action@v4.6.0 - name: SonarCloud Scan - if: github.repository_owner == 'liudger' + if: github.event.pull_request.head.repo.fork == false uses: SonarSource/sonarcloud-github-action@v3.1.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 4367fdb9b76b3ec1b424f5c2c8a5efbe9658100b Mon Sep 17 00:00:00 2001 From: "Willem-Jan L. van Rootselaar" Date: Tue, 8 Oct 2024 12:36:45 +0200 Subject: [PATCH 27/27] fix: update SonarCloud configuration for Python version and coverage report paths --- .github/workflows/tests.yaml | 5 +++++ sonar-project.properties | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 8b47ec1c..d0f0e697 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -79,3 +79,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + with: + args: > + -Dsonar.projectKey=liudger_python-bsblan + -Dsonar.organization=liudger + -Dsonar.python.coverage.reportPaths=coverage.xml diff --git a/sonar-project.properties b/sonar-project.properties index 9087a36d..8fda1861 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -13,5 +13,5 @@ sonar.sourceEncoding=UTF-8 sonar.sources=src sonar.tests=tests -sonar.python.version=3.10, 3.11 +sonar.python.version=3.12 sonar.python.coverage.reportPaths=coverage.xml