From 86755b21bd19a0c5fc27f6e5a1ad3e7a1c69d51b Mon Sep 17 00:00:00 2001 From: Mikayla Hutchinson Date: Tue, 4 Oct 2022 02:16:31 -0400 Subject: [PATCH] Unify test execution steps Turns out xunit _can_ run tests on Mono, you just have to install an additional package to work around a vstest bug. See https://github.com/microsoft/vstest/issues/2469 --- .github/workflows/build.yml | 18 ------------------ .../Mono.TextTemplating.Tests.csproj | 13 ++++++++++--- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4713651..5d99d29 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,11 +49,7 @@ jobs: - name: Test run: dotnet test --no-build -c ${{ matrix.config }} - - name: Test (Windows) - if: startsWith (matrix.os, 'windows') - run: dotnet test -c ${{ matrix.config }} --no-build # run: dotnet test -c ${{ matrix.config }} --no-build --blame-hang-timeout 5m --diag TestResults-${{ matrix.config }}-${{ matrix.os }}/Log/test_log.txt --logger trx --results-directory TestResults-${{ matrix.config }}-${{ matrix.os }} - # - name: Test diagnostics # if: failure() && startsWith (matrix.os, 'windows') # uses: actions/upload-artifact@v2 @@ -61,20 +57,6 @@ jobs: # name: test-results-${{ matrix.config }}-${{ matrix.os }} # path: TestResults-${{ matrix.config }}-${{ matrix.os }} - # dotnet test doesn't support mono so we have to use the xunit console runner - - name: Set up NuGet - if: startsWith (matrix.os, 'windows') == false - uses: nuget/setup-nuget@v1 - - - name: Test (Linux/Mac) - if: startsWith (matrix.os, 'windows') == false - run: | - nuget install xunit.runner.console -Version 2.4.2 -OutputDirectory testrunner - mono ./testrunner/xunit.runner.console.2.4.2/tools/net472/xunit.console.exe ./Mono.TextTemplating.Tests/bin/${{ matrix.config }}/net472/Mono.TextTemplating.Tests.dll -parallel none -noshadow - dotnet test -c ${{ matrix.config }} --no-build -f netcoreapp2.1 - dotnet test -c ${{ matrix.config }} --no-build -f netcoreapp3.1 - dotnet test -c ${{ matrix.config }} --no-build -f net5.0 - - uses: actions/upload-artifact@v3 if: matrix.config == 'Release' && startsWith(matrix.os, 'windows') with: diff --git a/Mono.TextTemplating.Tests/Mono.TextTemplating.Tests.csproj b/Mono.TextTemplating.Tests/Mono.TextTemplating.Tests.csproj index b5b688e..d89719b 100644 --- a/Mono.TextTemplating.Tests/Mono.TextTemplating.Tests.csproj +++ b/Mono.TextTemplating.Tests/Mono.TextTemplating.Tests.csproj @@ -7,17 +7,24 @@ $(DefineConstants);FEATURE_APPDOMAINS $(DefaultItemExcludes);TestCases\** + - - - + + + + + + + + +