Skip to content

Fix flaky tests (#2457) #249

Fix flaky tests (#2457)

Fix flaky tests (#2457) #249

name: mutation-tests
on:
push:
branches: [ main, release/* ]
pull_request:
branches: [ main, release/* ]
workflow_dispatch:
env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
DOTNET_NOLOGO: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: 1
NUGET_XMLDOC_MODE: skip
TERM: xterm
permissions:
contents: read
jobs:
mutations:
name: 'mutations-${{ matrix.name }}'
runs-on: windows-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- name: core
target: Core
- name: extensions
target: Extensions
- name: legacy
target: Legacy
- name: ratelimiting
target: RateLimiting
- name: testing
target: Testing
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Setup .NET SDKs
uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # v4.2.0
with:
dotnet-version: |
6.0.x
8.0.x
- name: Setup .NET SDK
uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # v4.2.0
- name: Run mutation tests for ${{ matrix.target }}
shell: pwsh
env:
MUTATION_TARGET: 'MutationTests${{ matrix.target }}'
SKIP_POLLY_ANALYZERS: 'true'
run: ./build.ps1 -Target ${env:MUTATION_TARGET}
- name: Upload Mutation Report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: mutation-report-${{ matrix.name }}
path: ./artifacts/mutation-report
mutation-tests:
needs: [ mutations ]
if: ${{ always() }}
runs-on: ubuntu-latest
env:
MUTATIONS_SUCCESS: ${{ !contains(needs.*.result, 'failure') }}
steps:
- run: |
if [ "$MUTATIONS_SUCCESS" == "true" ]
then
echo 'Mutation tests successful ✅'
else
echo 'One or more mutation test runs failed ❌'
exit 1
fi