Skip to content

Commit 58a177b

Browse files
authored
Fix broken build netsdk 10.0.200, fix green builds on failure (#1657)
* Fix broken build on .NET SDK v10.0.200 Fixes occurrences of the following errors: error IDE0370: Suppression is unnecessary (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0370) * Fix GHA: Overall build was reported Green if jobs have failures * Test: build failure must abort the job and report outcome Red * Revert "Test: build failure must abort the job and report outcome Red" This reverts commit 9ee4528. * Test: test failure must upload results and report outcome Red * Revert "Test: test failure must upload results and report outcome Red" This reverts commit e20a39c. * Test: report failure must abort the job and report outcome Red * Revert "Test: report failure must abort the job and report outcome Red" This reverts commit 5009453.
1 parent 407af87 commit 58a177b

4 files changed

Lines changed: 10 additions & 7 deletions

File tree

.github/workflows/Steeltoe.All.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ jobs:
4141
- os: macos-latest
4242
skipIntegrationTests: true
4343
runs-on: ${{ matrix.os }}
44-
continue-on-error: true
4544

4645
services:
4746
eurekaServer:
@@ -91,13 +90,15 @@ jobs:
9190
run: dotnet build ${{ env.SOLUTION_FILE }} --no-restore --configuration Release --verbosity minimal
9291

9392
- name: Test
93+
id: test
9494
run: dotnet test ${{ env.SOLUTION_FILE }} --filter "${{ matrix.skipIntegrationTests == true && 'Category!=MemoryDumps&Category!=Integration' || 'Category!=MemoryDumps' }}" ${{ env.COMMON_TEST_ARGS }}
9595

9696
- name: Test (memory dumps)
97+
id: test-memory-dumps
9798
run: dotnet test src/Management/test/Endpoint.Test --filter "Category=MemoryDumps" ${{ env.COMMON_TEST_ARGS }}
9899

99100
- name: Upload crash/hang dumps (on failure)
100-
if: ${{ failure() }}
101+
if: ${{ !cancelled() && (steps.test.outcome == 'failure' || steps.test-memory-dumps.outcome == 'failure') }}
101102
uses: actions/upload-artifact@v5
102103
with:
103104
name: FailedTestOutput-${{ matrix.os }}
@@ -107,7 +108,7 @@ jobs:
107108
if-no-files-found: ignore
108109

109110
- name: Report test results
110-
if: ${{ !cancelled() }}
111+
if: ${{ !cancelled() && (steps.test.outcome != 'skipped' || steps.test-memory-dumps.outcome != 'skipped') }}
111112
uses: dorny/test-reporter@v2
112113
with:
113114
name: ${{ matrix.os }} test results

.github/workflows/component-shared-workflow.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,16 @@ jobs:
8181
run: dotnet build ${{ env.SOLUTION_FILE }} --no-restore --configuration Release --verbosity minimal
8282

8383
- name: Test
84+
id: test
8485
run: dotnet test ${{ env.SOLUTION_FILE }} --filter "Category!=MemoryDumps" ${{ env.COMMON_TEST_ARGS }}
8586

8687
- name: Test (memory dumps)
88+
id: test-memory-dumps
8789
if: ${{ inputs.component == 'Management' }}
8890
run: dotnet test src/Management/test/Endpoint.Test --filter "Category=MemoryDumps" ${{ env.COMMON_TEST_ARGS }}
8991

9092
- name: Upload crash/hang dumps (on failure)
91-
if: ${{ failure() }}
93+
if: ${{ !cancelled() && (steps.test.outcome == 'failure' || steps.test-memory-dumps.outcome == 'failure') }}
9294
uses: actions/upload-artifact@v5
9395
with:
9496
name: FailedTestOutput-${{ inputs.OS }}-latest
@@ -98,7 +100,7 @@ jobs:
98100
if-no-files-found: ignore
99101

100102
- name: Report test results
101-
if: ${{ !cancelled() }}
103+
if: ${{ !cancelled() && (steps.test.outcome != 'skipped' || steps.test-memory-dumps.outcome != 'skipped') }}
102104
uses: dorny/test-reporter@v2
103105
with:
104106
name: ${{ inputs.OS }}-latest test results

src/Connectors/test/Connectors.Test/CosmosDb/CosmosDbHealthContributorTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public async Task Canceled_Throws()
105105
cosmosClientMock.Setup(client => client.ReadAccountAsync()).Returns(async () =>
106106
{
107107
await Task.Delay(3.Seconds(), TestContext.Current.CancellationToken);
108-
return null!;
108+
return null;
109109
});
110110

111111
await using ServiceProvider serviceProvider = CreateServiceProvider(serviceName, connectionString, cosmosClientMock.Object);

src/Discovery/test/Eureka.Test/PostConfigureEurekaInstanceOptionsTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ public async Task Adds_random_number_to_instance_ID_when_ports_are_zero()
329329
EurekaInstanceOptions instanceOptions = optionsMonitor.CurrentValue;
330330

331331
instanceOptions.InstanceId.Should().NotBeNull();
332-
string[] parts = instanceOptions.InstanceId!.Split(':');
332+
string[] parts = instanceOptions.InstanceId.Split(':');
333333
parts.Should().HaveCount(3);
334334

335335
int.TryParse(parts[2], CultureInfo.InvariantCulture, out int number).Should().BeTrue();

0 commit comments

Comments
 (0)