diff --git a/.github/workflows/Steeltoe.All.yml b/.github/workflows/Steeltoe.All.yml index 13c8e49972..2b399806f2 100644 --- a/.github/workflows/Steeltoe.All.yml +++ b/.github/workflows/Steeltoe.All.yml @@ -41,7 +41,6 @@ jobs: - os: macos-latest skipIntegrationTests: true runs-on: ${{ matrix.os }} - continue-on-error: true services: eurekaServer: @@ -91,13 +90,15 @@ jobs: run: dotnet build ${{ env.SOLUTION_FILE }} --no-restore --configuration Release --verbosity minimal - name: Test + id: test run: dotnet test ${{ env.SOLUTION_FILE }} --filter "${{ matrix.skipIntegrationTests == true && 'Category!=MemoryDumps&Category!=Integration' || 'Category!=MemoryDumps' }}" ${{ env.COMMON_TEST_ARGS }} - name: Test (memory dumps) + id: test-memory-dumps run: dotnet test src/Management/test/Endpoint.Test --filter "Category=MemoryDumps" ${{ env.COMMON_TEST_ARGS }} - name: Upload crash/hang dumps (on failure) - if: ${{ failure() }} + if: ${{ !cancelled() && (steps.test.outcome == 'failure' || steps.test-memory-dumps.outcome == 'failure') }} uses: actions/upload-artifact@v5 with: name: FailedTestOutput-${{ matrix.os }} @@ -107,7 +108,7 @@ jobs: if-no-files-found: ignore - name: Report test results - if: ${{ !cancelled() }} + if: ${{ !cancelled() && (steps.test.outcome != 'skipped' || steps.test-memory-dumps.outcome != 'skipped') }} uses: dorny/test-reporter@v2 with: name: ${{ matrix.os }} test results diff --git a/.github/workflows/component-shared-workflow.yml b/.github/workflows/component-shared-workflow.yml index 52ca149a42..f22f44241e 100644 --- a/.github/workflows/component-shared-workflow.yml +++ b/.github/workflows/component-shared-workflow.yml @@ -81,14 +81,16 @@ jobs: run: dotnet build ${{ env.SOLUTION_FILE }} --no-restore --configuration Release --verbosity minimal - name: Test + id: test run: dotnet test ${{ env.SOLUTION_FILE }} --filter "Category!=MemoryDumps" ${{ env.COMMON_TEST_ARGS }} - name: Test (memory dumps) + id: test-memory-dumps if: ${{ inputs.component == 'Management' }} run: dotnet test src/Management/test/Endpoint.Test --filter "Category=MemoryDumps" ${{ env.COMMON_TEST_ARGS }} - name: Upload crash/hang dumps (on failure) - if: ${{ failure() }} + if: ${{ !cancelled() && (steps.test.outcome == 'failure' || steps.test-memory-dumps.outcome == 'failure') }} uses: actions/upload-artifact@v5 with: name: FailedTestOutput-${{ inputs.OS }}-latest @@ -98,7 +100,7 @@ jobs: if-no-files-found: ignore - name: Report test results - if: ${{ !cancelled() }} + if: ${{ !cancelled() && (steps.test.outcome != 'skipped' || steps.test-memory-dumps.outcome != 'skipped') }} uses: dorny/test-reporter@v2 with: name: ${{ inputs.OS }}-latest test results diff --git a/src/Connectors/test/Connectors.Test/CosmosDb/CosmosDbHealthContributorTest.cs b/src/Connectors/test/Connectors.Test/CosmosDb/CosmosDbHealthContributorTest.cs index 258f2d82c0..303f5c0c21 100644 --- a/src/Connectors/test/Connectors.Test/CosmosDb/CosmosDbHealthContributorTest.cs +++ b/src/Connectors/test/Connectors.Test/CosmosDb/CosmosDbHealthContributorTest.cs @@ -105,7 +105,7 @@ public async Task Canceled_Throws() cosmosClientMock.Setup(client => client.ReadAccountAsync()).Returns(async () => { await Task.Delay(3.Seconds(), TestContext.Current.CancellationToken); - return null!; + return null; }); await using ServiceProvider serviceProvider = CreateServiceProvider(serviceName, connectionString, cosmosClientMock.Object); diff --git a/src/Discovery/test/Eureka.Test/PostConfigureEurekaInstanceOptionsTest.cs b/src/Discovery/test/Eureka.Test/PostConfigureEurekaInstanceOptionsTest.cs index 6200afa727..2b554d1457 100644 --- a/src/Discovery/test/Eureka.Test/PostConfigureEurekaInstanceOptionsTest.cs +++ b/src/Discovery/test/Eureka.Test/PostConfigureEurekaInstanceOptionsTest.cs @@ -329,7 +329,7 @@ public async Task Adds_random_number_to_instance_ID_when_ports_are_zero() EurekaInstanceOptions instanceOptions = optionsMonitor.CurrentValue; instanceOptions.InstanceId.Should().NotBeNull(); - string[] parts = instanceOptions.InstanceId!.Split(':'); + string[] parts = instanceOptions.InstanceId.Split(':'); parts.Should().HaveCount(3); int.TryParse(parts[2], CultureInfo.InvariantCulture, out int number).Should().BeTrue();