From 1d0b71fb179a067cf2cd7569a9c001f5157b7fe5 Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Wed, 5 Nov 2025 10:38:28 +0100 Subject: [PATCH 1/8] Record test coverage --- .github/workflows/tests.yml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 26434d38e..6a8142eb7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -30,8 +30,15 @@ jobs: - name: Build Duplicati run: dotnet build --no-restore Duplicati.sln - - name: Run unit tests - run: dotnet test --no-build --verbosity minimal --filter "Category!=Integration" Duplicati.sln + - name: Run unit tests with coverage + run: dotnet test --no-build --verbosity minimal --filter "Category!=Integration" --collect:"XPlat Code Coverage" --results-directory TestResults/unit Duplicati.sln + + - name: Upload unit test coverage + if: ${{ always() }} + uses: actions/upload-artifact@v4 + with: + name: unit-test-coverage-${{ runner.os }} + path: TestResults/unit integration_tests: name: Integration tests @@ -56,8 +63,15 @@ jobs: - name: Build Duplicati run: dotnet build --no-restore Duplicati.sln - - name: Run integration tests - run: dotnet test --no-build --verbosity minimal --filter "Category=Integration" Duplicati.sln + - name: Run integration tests with coverage + run: dotnet test --no-build --verbosity minimal --filter "Category=Integration" --collect:"XPlat Code Coverage" --results-directory TestResults/integration Duplicati.sln + + - name: Upload integration test coverage + if: ${{ always() }} + uses: actions/upload-artifact@v4 + with: + name: integration-test-coverage-${{ runner.os }} + path: TestResults/integration # Disabled, as a new test needs to be written for the new UI # selenium: From 74b310c8c568dbb9f5b483280aa7b49af681a567 Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Fri, 7 Nov 2025 14:45:50 +0100 Subject: [PATCH 2/8] More readable config --- .github/workflows/tests.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6a8142eb7..42bea09ce 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,14 +31,20 @@ jobs: run: dotnet build --no-restore Duplicati.sln - name: Run unit tests with coverage - run: dotnet test --no-build --verbosity minimal --filter "Category!=Integration" --collect:"XPlat Code Coverage" --results-directory TestResults/unit Duplicati.sln + run: | + mkdir -p "$GITHUB_WORKSPACE/TestResults/unit" + dotnet test --no-build --verbosity minimal \ + --filter "Category!=Integration" \ + --collect:"XPlat Code Coverage" \ + --results-directory "$GITHUB_WORKSPACE/TestResults/unit" \ + Duplicati.sln - name: Upload unit test coverage if: ${{ always() }} uses: actions/upload-artifact@v4 with: name: unit-test-coverage-${{ runner.os }} - path: TestResults/unit + path: TestResults/unit/** integration_tests: name: Integration tests @@ -64,14 +70,20 @@ jobs: run: dotnet build --no-restore Duplicati.sln - name: Run integration tests with coverage - run: dotnet test --no-build --verbosity minimal --filter "Category=Integration" --collect:"XPlat Code Coverage" --results-directory TestResults/integration Duplicati.sln + run: | + mkdir -p "$GITHUB_WORKSPACE/TestResults/integration" + dotnet test --no-build --verbosity minimal \ + --filter "Category=Integration" \ + --collect:"XPlat Code Coverage" \ + --results-directory "$GITHUB_WORKSPACE/TestResults/integration" \ + Duplicati.sln - name: Upload integration test coverage if: ${{ always() }} uses: actions/upload-artifact@v4 with: name: integration-test-coverage-${{ runner.os }} - path: TestResults/integration + path: TestResults/integration/** # Disabled, as a new test needs to be written for the new UI # selenium: From bc3b5387242be70e981c4084076a915b306be771 Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Fri, 7 Nov 2025 14:46:46 +0100 Subject: [PATCH 3/8] Added coverlet collector --- Duplicati/UnitTest/Duplicati.UnitTest.csproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Duplicati/UnitTest/Duplicati.UnitTest.csproj b/Duplicati/UnitTest/Duplicati.UnitTest.csproj index a72fac4b3..812b45e3b 100644 --- a/Duplicati/UnitTest/Duplicati.UnitTest.csproj +++ b/Duplicati/UnitTest/Duplicati.UnitTest.csproj @@ -10,6 +10,10 @@ + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + From e308d8a93fe2382af784affe76d46fbf5be9ae61 Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Mon, 10 Nov 2025 12:36:00 +0100 Subject: [PATCH 4/8] Testing out codecov --- .github/workflows/tests.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 42bea09ce..d1cf4692f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -78,12 +78,17 @@ jobs: --results-directory "$GITHUB_WORKSPACE/TestResults/integration" \ Duplicati.sln - - name: Upload integration test coverage - if: ${{ always() }} - uses: actions/upload-artifact@v4 + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v5 with: - name: integration-test-coverage-${{ runner.os }} - path: TestResults/integration/** + token: ${{ secrets.CODECOV_TOKEN }} + + # - name: Upload integration test coverage + # if: ${{ always() }} + # uses: actions/upload-artifact@v4 + # with: + # name: integration-test-coverage-${{ runner.os }} + # path: TestResults/integration/** # Disabled, as a new test needs to be written for the new UI # selenium: From 5415003432befdd4fbb006c7cbbf1f677b64007d Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Mon, 10 Nov 2025 12:40:09 +0100 Subject: [PATCH 5/8] Point specifically to the coverage files --- .github/workflows/tests.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d1cf4692f..80b7697b7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,12 +39,19 @@ jobs: --results-directory "$GITHUB_WORKSPACE/TestResults/unit" \ Duplicati.sln - - name: Upload unit test coverage - if: ${{ always() }} - uses: actions/upload-artifact@v4 + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v5 with: - name: unit-test-coverage-${{ runner.os }} - path: TestResults/unit/** + token: ${{ secrets.CODECOV_TOKEN }} + files: ${{ github.workspace }}/TestResults/integration/**/coverage.cobertura.xml + flags: unittest,${{ matrix.os }} + + # - name: Upload unit test coverage + # if: ${{ always() }} + # uses: actions/upload-artifact@v4 + # with: + # name: unit-test-coverage-${{ runner.os }} + # path: TestResults/unit/** integration_tests: name: Integration tests @@ -82,8 +89,10 @@ jobs: uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} + files: ${{ github.workspace }}/TestResults/integration/**/coverage.cobertura.xml + flags: integration,${{ matrix.os }} - # - name: Upload integration test coverage + # - name: Upload integration test coverage # if: ${{ always() }} # uses: actions/upload-artifact@v4 # with: From 7b6d0af9b0caf0b0aa830a671097bd9514ccd212 Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Mon, 10 Nov 2025 12:58:41 +0100 Subject: [PATCH 6/8] Revert to single-line to work on Windows as well --- .github/workflows/tests.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 80b7697b7..c8ebdac90 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,11 +33,7 @@ jobs: - name: Run unit tests with coverage run: | mkdir -p "$GITHUB_WORKSPACE/TestResults/unit" - dotnet test --no-build --verbosity minimal \ - --filter "Category!=Integration" \ - --collect:"XPlat Code Coverage" \ - --results-directory "$GITHUB_WORKSPACE/TestResults/unit" \ - Duplicati.sln + dotnet test --no-build --verbosity minimal --filter "Category!=Integration" --collect:"XPlat Code Coverage" --results-directory "$GITHUB_WORKSPACE/TestResults/unit" Duplicati.sln - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v5 @@ -79,11 +75,7 @@ jobs: - name: Run integration tests with coverage run: | mkdir -p "$GITHUB_WORKSPACE/TestResults/integration" - dotnet test --no-build --verbosity minimal \ - --filter "Category=Integration" \ - --collect:"XPlat Code Coverage" \ - --results-directory "$GITHUB_WORKSPACE/TestResults/integration" \ - Duplicati.sln + dotnet test --no-build --verbosity minimal --filter "Category=Integration" --collect:"XPlat Code Coverage" --results-directory "$GITHUB_WORKSPACE/TestResults/integration" Duplicati.sln - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v5 From b0b566d31b93789a7106204f82e9bcf8b3deecda Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Mon, 10 Nov 2025 12:59:22 +0100 Subject: [PATCH 7/8] Removed report artefact uploads --- .github/workflows/tests.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c8ebdac90..a28cdd1f4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -42,13 +42,6 @@ jobs: files: ${{ github.workspace }}/TestResults/integration/**/coverage.cobertura.xml flags: unittest,${{ matrix.os }} - # - name: Upload unit test coverage - # if: ${{ always() }} - # uses: actions/upload-artifact@v4 - # with: - # name: unit-test-coverage-${{ runner.os }} - # path: TestResults/unit/** - integration_tests: name: Integration tests runs-on: ${{ matrix.os }} @@ -84,13 +77,6 @@ jobs: files: ${{ github.workspace }}/TestResults/integration/**/coverage.cobertura.xml flags: integration,${{ matrix.os }} - # - name: Upload integration test coverage - # if: ${{ always() }} - # uses: actions/upload-artifact@v4 - # with: - # name: integration-test-coverage-${{ runner.os }} - # path: TestResults/integration/** - # Disabled, as a new test needs to be written for the new UI # selenium: # runs-on: ubuntu-latest From f4557b58e24f2f24397815292a0c1a4f953b99b5 Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Mon, 10 Nov 2025 13:05:22 +0100 Subject: [PATCH 8/8] Pin codecov version to 5.5.1 --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a28cdd1f4..e7ff6f1c6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -36,7 +36,7 @@ jobs: dotnet test --no-build --verbosity minimal --filter "Category!=Integration" --collect:"XPlat Code Coverage" --results-directory "$GITHUB_WORKSPACE/TestResults/unit" Duplicati.sln - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v5 + uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 with: token: ${{ secrets.CODECOV_TOKEN }} files: ${{ github.workspace }}/TestResults/integration/**/coverage.cobertura.xml @@ -71,7 +71,7 @@ jobs: dotnet test --no-build --verbosity minimal --filter "Category=Integration" --collect:"XPlat Code Coverage" --results-directory "$GITHUB_WORKSPACE/TestResults/integration" Duplicati.sln - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v5 + uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 with: token: ${{ secrets.CODECOV_TOKEN }} files: ${{ github.workspace }}/TestResults/integration/**/coverage.cobertura.xml