Skip to content

Commit d93ae1a

Browse files
committed
Run tests for all frameworks in single command, explicitly use VSTest mode
1 parent 7caaa44 commit d93ae1a

File tree

6 files changed

+26
-75
lines changed

6 files changed

+26
-75
lines changed

.github/workflows/Steeltoe.All.yml

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ env:
2121
DOTNET_NOLOGO: true
2222
SOLUTION_FILE: 'src/Steeltoe.All.sln'
2323
COMMON_TEST_ARGS: >-
24-
--no-build --configuration Release --collect "XPlat Code Coverage" --logger trx --results-directory ${{ github.workspace }}/dumps
24+
--no-build --configuration Release --collect "XPlat Code Coverage" --logger trx --results-directory ${{ github.workspace }}/TestOutput
2525
--settings coverlet.runsettings --blame-crash --blame-hang-timeout 3m
2626
2727
jobs:
@@ -36,9 +36,9 @@ jobs:
3636
- os: ubuntu-latest
3737
runDockerContainers: true
3838
- os: windows-latest
39-
skipFilter: Category!=Integration
39+
skipIntegrationTests: true
4040
- os: macos-latest
41-
skipFilter: Category!=Integration
41+
skipIntegrationTests: true
4242
runs-on: ${{ matrix.os }}
4343
continue-on-error: true
4444

@@ -89,38 +89,20 @@ jobs:
8989
- name: Build solution
9090
run: dotnet build ${{ env.SOLUTION_FILE }} --no-restore --configuration Release --verbosity minimal
9191

92-
- name: Set skip filters for tests
93-
shell: bash
94-
run: |
95-
echo SKIP_FILTER_NO_MEMORY_DUMPS="${{ matrix.skipFilter && format('{0}&Category!=MemoryDumps', matrix.skipFilter) || 'Category!=MemoryDumps' }}" >> $GITHUB_ENV
96-
echo SKIP_FILTER_WITH_MEMORY_DUMPS="${{ matrix.skipFilter && format('{0}&Category=MemoryDumps', matrix.skipFilter) || 'Category=MemoryDumps' }}" >> $GITHUB_ENV
97-
98-
- name: Test (net10.0)
99-
run: dotnet test ${{ env.SOLUTION_FILE }} --framework net10.0 --filter "${{ env.SKIP_FILTER_NO_MEMORY_DUMPS }}" ${{ env.COMMON_TEST_ARGS }}
100-
101-
- name: Test (net10.0) (memory dumps)
102-
run: dotnet test ${{ env.SOLUTION_FILE }} --framework net10.0 --filter "${{ env.SKIP_FILTER_WITH_MEMORY_DUMPS }}" ${{ env.COMMON_TEST_ARGS }}
103-
104-
- name: Test (net9.0)
105-
run: dotnet test ${{ env.SOLUTION_FILE }} --framework net9.0 --filter "${{ env.SKIP_FILTER_NO_MEMORY_DUMPS }}" ${{ env.COMMON_TEST_ARGS }}
106-
107-
- name: Test (net9.0) (memory dumps)
108-
run: dotnet test ${{ env.SOLUTION_FILE }} --framework net9.0 --filter "${{ env.SKIP_FILTER_WITH_MEMORY_DUMPS }}" ${{ env.COMMON_TEST_ARGS }}
109-
110-
- name: Test (net8.0)
111-
run: dotnet test ${{ env.SOLUTION_FILE }} --framework net8.0 --filter "${{ env.SKIP_FILTER_NO_MEMORY_DUMPS }}" ${{ env.COMMON_TEST_ARGS }}
92+
- name: Test
93+
run: dotnet test ${{ env.SOLUTION_FILE }} --filter "${{ matrix.skipIntegrationTests == true && 'Category!=MemoryDumps&Category!=Integration' || 'Category!=MemoryDumps' }}" ${{ env.COMMON_TEST_ARGS }}
11294

113-
- name: Test (net8.0) (memory dumps)
114-
run: dotnet test ${{ env.SOLUTION_FILE }} --framework net8.0 --filter "${{ env.SKIP_FILTER_WITH_MEMORY_DUMPS }}" ${{ env.COMMON_TEST_ARGS }}
95+
- name: Test (memory dumps)
96+
run: dotnet test --project src/Management/test/Endpoint.Test/Steeltoe.Management.Endpoint.Test.csproj --filter "Category=MemoryDumps" ${{ env.COMMON_TEST_ARGS }}
11597

11698
- name: Upload crash/hang dumps (on failure)
11799
if: ${{ failure() }}
118100
uses: actions/upload-artifact@v5
119101
with:
120102
name: FailedTestOutput-${{ matrix.os }}
121103
path: |
122-
${{ github.workspace }}/dumps/**/*.dmp
123-
${{ github.workspace }}/dumps/**/Sequence_*.xml
104+
${{ github.workspace }}/TestOutput/**/*.dmp
105+
${{ github.workspace }}/TestOutput/**/Sequence_*.xml
124106
if-no-files-found: ignore
125107

126108
- name: Report test results

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

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ env:
2323
DOTNET_NOLOGO: true
2424
SOLUTION_FILE: 'src/Steeltoe.${{ inputs.component }}.slnf'
2525
COMMON_TEST_ARGS: >-
26-
--no-build --configuration Release --collect "XPlat Code Coverage" --logger trx --results-directory ${{ github.workspace }}/dumps
26+
--no-build --configuration Release --collect "XPlat Code Coverage" --logger trx --results-directory ${{ github.workspace }}/TestOutput
2727
--settings coverlet.runsettings --blame-crash --blame-hang-timeout 3m
2828
2929
jobs:
@@ -79,35 +79,21 @@ jobs:
7979
- name: Build solution
8080
run: dotnet build ${{ env.SOLUTION_FILE }} --no-restore --configuration Release --verbosity minimal
8181

82-
- name: Test (net10.0)
83-
run: dotnet test ${{ env.SOLUTION_FILE }} --framework net10.0 --filter "Category!=MemoryDumps" ${{ env.COMMON_TEST_ARGS }}
82+
- name: Test
83+
run: dotnet test ${{ env.SOLUTION_FILE }} --filter "Category!=MemoryDumps" ${{ env.COMMON_TEST_ARGS }}
8484

85-
- name: Test (net10.0) (memory dumps)
85+
- name: Test (memory dumps)
8686
if: ${{ inputs.component == 'Management' }}
87-
run: dotnet test ${{ env.SOLUTION_FILE }} --framework net10.0 --filter "Category=MemoryDumps" ${{ env.COMMON_TEST_ARGS }}
88-
89-
- name: Test (net9.0)
90-
run: dotnet test ${{ env.SOLUTION_FILE }} --framework net9.0 --filter "Category!=MemoryDumps" ${{ env.COMMON_TEST_ARGS }}
91-
92-
- name: Test (net9.0) (memory dumps)
93-
if: ${{ inputs.component == 'Management' }}
94-
run: dotnet test ${{ env.SOLUTION_FILE }} --framework net9.0 --filter "Category=MemoryDumps" ${{ env.COMMON_TEST_ARGS }}
95-
96-
- name: Test (net8.0)
97-
run: dotnet test ${{ env.SOLUTION_FILE }} --framework net8.0 --filter "Category!=MemoryDumps" ${{ env.COMMON_TEST_ARGS }}
98-
99-
- name: Test (net8.0) (memory dumps)
100-
if: ${{ inputs.component == 'Management' }}
101-
run: dotnet test ${{ env.SOLUTION_FILE }} --framework net8.0 --filter "Category=MemoryDumps" ${{ env.COMMON_TEST_ARGS }}
87+
run: dotnet test --project src/Management/test/Endpoint.Test/Steeltoe.Management.Endpoint.Test.csproj --filter "Category=MemoryDumps" ${{ env.COMMON_TEST_ARGS }}
10288

10389
- name: Upload crash/hang dumps (on failure)
10490
if: ${{ failure() }}
10591
uses: actions/upload-artifact@v5
10692
with:
10793
name: FailedTestOutput-${{ inputs.OS }}-latest
10894
path: |
109-
${{ github.workspace }}/dumps/**/*.dmp
110-
${{ github.workspace }}/dumps/**/Sequence_*.xml
95+
${{ github.workspace }}/TestOutput/**/*.dmp
96+
${{ github.workspace }}/TestOutput/**/Sequence_*.xml
11197
if-no-files-found: ignore
11298

11399
- name: Report test results

.github/workflows/sonarcube.yml

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ env:
2222
DOTNET_NOLOGO: true
2323
SOLUTION_FILE: 'src/Steeltoe.All.sln'
2424
SONAR_TEST_ARGS: >-
25-
--no-build --configuration Release --collect "XPlat Code Coverage" --logger trx --results-directory ${{ github.workspace }}
25+
--no-build --configuration Release --collect "XPlat Code Coverage" --logger trx --results-directory ${{ github.workspace }}/TestOutput
2626
--settings coverlet.runsettings -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.UseSourceLink=false
2727
2828
jobs:
@@ -79,23 +79,11 @@ jobs:
7979
- name: Build solution
8080
run: dotnet build ${{ env.SOLUTION_FILE }} --no-restore --configuration Release --verbosity minimal
8181

82-
- name: Test (net10.0)
83-
run: dotnet test ${{ env.SOLUTION_FILE }} --filter "Category!=MemoryDumps" --framework net10.0 ${{ env.SONAR_TEST_ARGS }}
82+
- name: Test
83+
run: dotnet test ${{ env.SOLUTION_FILE }} --filter "Category!=MemoryDumps" ${{ env.SONAR_TEST_ARGS }}
8484

85-
- name: Test (net10.0) (memory dumps)
86-
run: dotnet test ${{ env.SOLUTION_FILE }} --filter "Category=MemoryDumps" --framework net10.0 ${{ env.SONAR_TEST_ARGS }}
87-
88-
- name: Test (net9.0)
89-
run: dotnet test ${{ env.SOLUTION_FILE }} --filter "Category!=MemoryDumps" --framework net9.0 ${{ env.SONAR_TEST_ARGS }}
90-
91-
- name: Test (net9.0) (memory dumps)
92-
run: dotnet test ${{ env.SOLUTION_FILE }} --filter "Category=MemoryDumps" --framework net9.0 ${{ env.SONAR_TEST_ARGS }}
93-
94-
- name: Test (net8.0)
95-
run: dotnet test ${{ env.SOLUTION_FILE }} --filter "Category!=MemoryDumps" --framework net8.0 ${{ env.SONAR_TEST_ARGS }}
96-
97-
- name: Test (net8.0) (memory dumps)
98-
run: dotnet test ${{ env.SOLUTION_FILE }} --filter "Category=MemoryDumps" --framework net8.0 ${{ env.SONAR_TEST_ARGS }}
85+
- name: Test (memory dumps)
86+
run: dotnet test --project src/Management/test/Endpoint.Test/Steeltoe.Management.Endpoint.Test.csproj --filter "Category=MemoryDumps" ${{ env.SONAR_TEST_ARGS }}
9987

10088
- name: End Sonar .NET scanner
10189
if: ${{ !cancelled() && steps.sonar_begin.outcome == 'success' }}

Directory.Build.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
<Exec Command="$(GeneratorCommandLine)" />
102102

103103
<ItemGroup>
104-
<FileWrites Include="$(GeneratedConfigurationSchemaOutputPath)" Condition="Exists('$(GeneratedConfigurationSchemaOutputPath)')"/>
104+
<FileWrites Include="$(GeneratedConfigurationSchemaOutputPath)" Condition="Exists('$(GeneratedConfigurationSchemaOutputPath)')" />
105105
</ItemGroup>
106106
</Target>
107107

@@ -123,7 +123,7 @@
123123
</PropertyGroup>
124124

125125
<Warning Condition="'$(CurrentConfigurationSchemaFileContent)' != '$(GeneratedConfigurationSchemaFileContent)'"
126-
Text="ConfigurationSchema.json is out of date for $(MSBuildProjectFile). Run 'dotnet build --no-incremental /p:UpdateConfigurationSchema=true' to update it." />
126+
Text="ConfigurationSchema.json is out of date for $(MSBuildProjectFile). Run 'dotnet build --no-incremental /p:UpdateConfigurationSchema=true' to update it." />
127127
</Target>
128128

129129
</Project>

shared-test.props

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
<Project>
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<NoWarn>$(NoWarn);S2094;S3717;SA1602;CA1062;CA1707;NU5104</NoWarn>
5-
</PropertyGroup>
6-
7-
<PropertyGroup>
8-
<!-- https://github.com/xunit/xunit/issues/3238#issuecomment-2770720936 -->
94
<TestTfmsInParallel>false</TestTfmsInParallel>
10-
<DisableTestingPlatformServerCapability>true</DisableTestingPlatformServerCapability>
5+
<NoWarn>$(NoWarn);S2094;S3717;SA1602;CA1062;CA1707;NU5104</NoWarn>
116
</PropertyGroup>
127

138
<ItemGroup>
@@ -22,7 +17,7 @@
2217
<PackageReference Include="Microsoft.Extensions.TimeProvider.Testing" Version="$(FoundationalVersion)" />
2318
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />
2419
<PackageReference Include="Moq" Version="$(MoqVersion)" />
25-
<PackageReference Include="xunit.v3" Version="$(XunitVersion)" />
20+
<PackageReference Include="xunit.v3.mtp-off" Version="$(XunitVersion)" />
2621
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVisualStudioVersion)" />
2722
</ItemGroup>
2823

src/Steeltoe.All.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
22
# Visual Studio Version 18
3-
VisualStudioVersion = 18.0.11222.15 d18.0
3+
VisualStudioVersion = 18.0.11222.15
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Steeltoe.Common", "Common\src\Common\Steeltoe.Common.csproj", "{61812938-5132-4AB6-B48D-2DF4189B3E37}"
66
EndProject

0 commit comments

Comments
 (0)