From 463e97dfd93ded28808e835777935598db52ac96 Mon Sep 17 00:00:00 2001 From: Peter Wurzinger Date: Sun, 24 Apr 2022 22:52:39 +0200 Subject: [PATCH] Merge fix for stryker dashboard reporter (#3) * Runs the stryker dashbaord reporter on - a baseline comparison for Pull requests - against the full ref name (e.g. refs/heads/main) for a normal run obviously adapt the Badge * Revert the idea of pushing the full git ref instead of only the name, as for Pull request only the ref name (the branch name) is available. * Enable dashboard as baseline provider * Append "refs/heads/" for pull requests to support a proper git diff * Remove dashboard provider for basline * Add Stryker config to solution * Revert changes & enable trace verbosity * Fetching other branches as well when checking out repo for mutation tests * Remove trace verbosity from stryker CLI --- .github/workflows/everything.yml | 9 ++++++++- AuthOida.sln | 1 + test/stryker-config.json | 5 ++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/everything.yml b/.github/workflows/everything.yml index d1fcd01..6b02ce5 100644 --- a/.github/workflows/everything.yml +++ b/.github/workflows/everything.yml @@ -34,12 +34,19 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Restore Tools working-directory: ./test run: dotnet tool restore - name: Run mutation tests working-directory: ./test - run: dotnet stryker --reporter "dashboard" --dashboard-api-key ${{ secrets.STRYKER_DASHBOARD_API_KEY }} + run: dotnet stryker --reporter dashboard --with-baseline:${{ github.base_ref }} --dashboard-api-key ${{ secrets.STRYKER_DASHBOARD_API_KEY }} --version ${{ github.head_ref }} + if: github.event_name == 'pull_request' + - name: Run mutation tests + working-directory: ./test + run: dotnet stryker --reporter dashboard --dashboard-api-key ${{ secrets.STRYKER_DASHBOARD_API_KEY }} --version ${{ github.ref_name }} + if: github.event_name != 'pull_request' package: needs: test runs-on: ubuntu-latest diff --git a/AuthOida.sln b/AuthOida.sln index 5626e97..ba68317 100644 --- a/AuthOida.sln +++ b/AuthOida.sln @@ -26,6 +26,7 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{04AFCA1B-D813-4E6E-AC58-A485B03B151E}" ProjectSection(SolutionItems) = preProject test\Directory.Build.props = test\Directory.Build.props + test\stryker-config.json = test\stryker-config.json test\test.runsettings = test\test.runsettings EndProjectSection EndProject diff --git a/test/stryker-config.json b/test/stryker-config.json index d23e31d..021a0e5 100644 --- a/test/stryker-config.json +++ b/test/stryker-config.json @@ -3,6 +3,9 @@ "test-projects": [ "AuthOida.Microsoft.Identity.Groups.Tests/AuthOida.Microsoft.Identity.Groups.Tests.csproj" ], "ignore-methods": [ "ConfigureAwait" // Ignores mutations of ConfigureAwait(false) - ] + ], + "baseline": { + "provider": "Dashboard" + } } } \ No newline at end of file