From d0ef32e008c73c29d9460b07006f01f762f95996 Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Thu, 15 Feb 2024 23:35:33 -0500 Subject: [PATCH 01/12] upload test result --- .github/workflows/build.yaml | 9 ++++++++- build.sh | 8 ++++---- test/Directory.Build.props | 1 + test/Directory.Packages.props | 1 + test/SymbolCollector.Core.Tests/ClientTests.cs | 3 +-- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8fea672..d1834d2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -49,8 +49,15 @@ jobs: SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} run: ./build.sh + # beta test result upload: https://docs.codecov.com/docs/test-result-ingestion-beta + - run: pip install codecov-cli + - run: codecovcli do-upload --report-type test_results --file test/**/junit-results.xml + - run: for f in test/**/TestResults.xml; do codecovcli do-upload --report-type test_results --file ${f}; done; + - name: Publish coverage report - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} - name: Archive Artifacts uses: actions/upload-artifact@v3 diff --git a/build.sh b/build.sh index 064367c..48017d6 100755 --- a/build.sh +++ b/build.sh @@ -19,15 +19,15 @@ popd find test -name "TestResults" -type d -prune -exec rm -rf '{}' + pushd test/SymbolCollector.Server.Tests/ -dotnet test -c Release --collect:"XPlat Code Coverage" --settings ../coverletArgs.runsettings +dotnet test -c Release --logger:junit --collect:"XPlat Code Coverage" --settings ../coverletArgs.runsettings popd pushd test/SymbolCollector.Core.Tests/ -dotnet test -c Release --collect:"XPlat Code Coverage" --settings ../coverletArgs.runsettings +dotnet test -c Release --logger:junit --collect:"XPlat Code Coverage" --settings ../coverletArgs.runsettings popd pushd test/SymbolCollector.Console.Tests/ -dotnet test -c Release --collect:"XPlat Code Coverage" --settings ../coverletArgs.runsettings +dotnet test -c Release --logger:junit --collect:"XPlat Code Coverage" --settings ../coverletArgs.runsettings popd pushd test/SymbolCollector.Android.UITests/ @@ -35,7 +35,7 @@ dotnet build -c Release # Don't run emulator tests on CI if [ -z ${CI+x} ]; then pushd bin/Release/net48 - mono ../../../tools/nunit/net35/nunit3-console.exe SymbolCollector.Android.UITests.dll + mono ../../../tools/nunit/net35/nunit3-console.exe SymbolCollector.Android.UITests.dll --result=junit-results.xml;transform=nunit3-junit.xslt popd fi popd diff --git a/test/Directory.Build.props b/test/Directory.Build.props index ebc171b..c04d383 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -10,5 +10,6 @@ + diff --git a/test/Directory.Packages.props b/test/Directory.Packages.props index 4ad329d..2e7b6ed 100644 --- a/test/Directory.Packages.props +++ b/test/Directory.Packages.props @@ -10,6 +10,7 @@ + diff --git a/test/SymbolCollector.Core.Tests/ClientTests.cs b/test/SymbolCollector.Core.Tests/ClientTests.cs index 79918de..311fc82 100644 --- a/test/SymbolCollector.Core.Tests/ClientTests.cs +++ b/test/SymbolCollector.Core.Tests/ClientTests.cs @@ -2,7 +2,6 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using NSubstitute; -using Sentry; using Xunit; namespace SymbolCollector.Core.Tests; @@ -128,4 +127,4 @@ protected override Task SendAsync( CancellationToken cancellationToken) => _callback(request, cancellationToken); } -} \ No newline at end of file +} From f2a8a5ac8e5361562d16cd3fe61985b75973c8c6 Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Thu, 15 Feb 2024 23:41:37 -0500 Subject: [PATCH 02/12] break a test --- .github/workflows/build.yaml | 2 +- test/SymbolCollector.Core.Tests/ClientTests.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d1834d2..4b9db70 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -51,7 +51,7 @@ jobs: # beta test result upload: https://docs.codecov.com/docs/test-result-ingestion-beta - run: pip install codecov-cli - - run: codecovcli do-upload --report-type test_results --file test/**/junit-results.xml + # - run: codecovcli do-upload --report-type test_results --file test/**/junit-results.xml - run: for f in test/**/TestResults.xml; do codecovcli do-upload --report-type test_results --file ${f}; done; - name: Publish coverage report diff --git a/test/SymbolCollector.Core.Tests/ClientTests.cs b/test/SymbolCollector.Core.Tests/ClientTests.cs index 311fc82..fa11188 100644 --- a/test/SymbolCollector.Core.Tests/ClientTests.cs +++ b/test/SymbolCollector.Core.Tests/ClientTests.cs @@ -73,7 +73,7 @@ public async Task UploadAllPathsAsync_TestFilesDirectory_FilesDetected() await sut.UploadAllPathsAsync("friendly name", BatchType.IOS, new[] {"TestFiles"}, CancellationToken.None); // number of valid test files in TestFiles - Assert.Equal(12, counter); + Assert.NotEqual(12, counter); } [Fact] From 8ae2b50bedde8c2f7808e38408307233e05f906b Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Thu, 15 Feb 2024 23:48:07 -0500 Subject: [PATCH 03/12] always run step --- .github/workflows/build.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4b9db70..31a43d7 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -38,6 +38,9 @@ jobs: if: matrix.os != 'macos-latest' run: dotnet workload install maui-android + # beta test result upload: https://docs.codecov.com/docs/test-result-ingestion-beta + - run: pip install codecov-cli + - name: Run batch build script if: matrix.os == 'windows-latest' shell: cmd @@ -49,10 +52,9 @@ jobs: SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} run: ./build.sh - # beta test result upload: https://docs.codecov.com/docs/test-result-ingestion-beta - - run: pip install codecov-cli # - run: codecovcli do-upload --report-type test_results --file test/**/junit-results.xml - run: for f in test/**/TestResults.xml; do codecovcli do-upload --report-type test_results --file ${f}; done; + if: always() - name: Publish coverage report uses: codecov/codecov-action@v4 From 798a4bf45f711f13fbf32abeb7881735f2bf1752 Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Thu, 15 Feb 2024 23:53:59 -0500 Subject: [PATCH 04/12] token --- .github/workflows/build.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 31a43d7..1e87fde 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -55,6 +55,8 @@ jobs: # - run: codecovcli do-upload --report-type test_results --file test/**/junit-results.xml - run: for f in test/**/TestResults.xml; do codecovcli do-upload --report-type test_results --file ${f}; done; if: always() + with: + token: ${{ secrets.CODECOV_TOKEN }} - name: Publish coverage report uses: codecov/codecov-action@v4 From d131b27e45017c7c32a65b6eeb7d494312224def Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Thu, 15 Feb 2024 23:57:27 -0500 Subject: [PATCH 05/12] command per file --- .github/workflows/build.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1e87fde..5c2e90c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -53,7 +53,10 @@ jobs: run: ./build.sh # - run: codecovcli do-upload --report-type test_results --file test/**/junit-results.xml - - run: for f in test/**/TestResults.xml; do codecovcli do-upload --report-type test_results --file ${f}; done; + - run: | + codecovcli do-upload --report-type test_results --file test/SymbolCollector.Console.Tests/TestResults/TestResults.xml + codecovcli do-upload --report-type test_results --file test/SymbolCollector.Core.Tests/TestResults/TestResults.xml + codecovcli do-upload --report-type test_results --file test/SymbolCollector.Server.Tests/TestResults/TestResults.xml if: always() with: token: ${{ secrets.CODECOV_TOKEN }} From 30ebf2344a6811026405633b4596e56cb51d88ec Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Fri, 16 Feb 2024 00:00:06 -0500 Subject: [PATCH 06/12] yml --- .github/workflows/build.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5c2e90c..163b2c8 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -52,14 +52,14 @@ jobs: SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} run: ./build.sh - # - run: codecovcli do-upload --report-type test_results --file test/**/junit-results.xml - - run: | - codecovcli do-upload --report-type test_results --file test/SymbolCollector.Console.Tests/TestResults/TestResults.xml - codecovcli do-upload --report-type test_results --file test/SymbolCollector.Core.Tests/TestResults/TestResults.xml - codecovcli do-upload --report-type test_results --file test/SymbolCollector.Server.Tests/TestResults/TestResults.xml + - name: upload test results if: always() with: token: ${{ secrets.CODECOV_TOKEN }} + run: | + codecovcli do-upload --report-type test_results --file test/SymbolCollector.Console.Tests/TestResults/TestResults.xml + codecovcli do-upload --report-type test_results --file test/SymbolCollector.Core.Tests/TestResults/TestResults.xml + codecovcli do-upload --report-type test_results --file test/SymbolCollector.Server.Tests/TestResults/TestResults.xml - name: Publish coverage report uses: codecov/codecov-action@v4 From ded6edda65e67a93b10c711175b76f7b670ec0b0 Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Fri, 16 Feb 2024 00:04:38 -0500 Subject: [PATCH 07/12] env var --- .github/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 163b2c8..efeebb6 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -54,8 +54,8 @@ jobs: - name: upload test results if: always() - with: - token: ${{ secrets.CODECOV_TOKEN }} + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} run: | codecovcli do-upload --report-type test_results --file test/SymbolCollector.Console.Tests/TestResults/TestResults.xml codecovcli do-upload --report-type test_results --file test/SymbolCollector.Core.Tests/TestResults/TestResults.xml From e15b8fa734bb08ecdfd23aab66b8415806ebe7ff Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Fri, 16 Feb 2024 00:11:42 -0500 Subject: [PATCH 08/12] todo reminder --- .github/workflows/build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index efeebb6..2272826 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -56,6 +56,7 @@ jobs: if: always() env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + # TODO: UI Tests in CI: codecovcli do-upload --report-type test_results --file test/**/junit-results.xml run: | codecovcli do-upload --report-type test_results --file test/SymbolCollector.Console.Tests/TestResults/TestResults.xml codecovcli do-upload --report-type test_results --file test/SymbolCollector.Core.Tests/TestResults/TestResults.xml From e6c4ab68bd1eb9a35049454ac0e61f59d35e72fa Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Fri, 16 Feb 2024 00:17:27 -0500 Subject: [PATCH 09/12] run tests from gha yml --- .github/workflows/build.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 2272826..906d050 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -52,6 +52,15 @@ jobs: SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} run: ./build.sh + - name: Test Core + run: dotnet test test/SymbolCollector.Core.Tests/ -c Release --no-build --logger:junit --collect:"XPlat Code Coverage" --settings test/coverletArgs.runsettings + + - name: Test Server + run: dotnet test test/SymbolCollector.Server.Tests/ -c Release --no-build --logger:junit --collect:"XPlat Code Coverage" --settings test/coverletArgs.runsettings + + - name: Test Console + run: dotnet test test/SymbolCollector.Console.Tests/ -c Release --no-build --logger:junit --collect:"XPlat Code Coverage" --settings test/coverletArgs.runsettings + - name: upload test results if: always() env: From 3fcadb8f58a3b4c4b725f85daaa25455e53e9dbf Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Fri, 16 Feb 2024 00:23:08 -0500 Subject: [PATCH 10/12] run tests from gha yml --- .github/workflows/build.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 906d050..b700e9f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -53,12 +53,15 @@ jobs: run: ./build.sh - name: Test Core + if: always() run: dotnet test test/SymbolCollector.Core.Tests/ -c Release --no-build --logger:junit --collect:"XPlat Code Coverage" --settings test/coverletArgs.runsettings - name: Test Server + if: always() run: dotnet test test/SymbolCollector.Server.Tests/ -c Release --no-build --logger:junit --collect:"XPlat Code Coverage" --settings test/coverletArgs.runsettings - name: Test Console + if: always() run: dotnet test test/SymbolCollector.Console.Tests/ -c Release --no-build --logger:junit --collect:"XPlat Code Coverage" --settings test/coverletArgs.runsettings - name: upload test results From 5b26f63c3782dd07675df8556bb9195a76b8463a Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Fri, 16 Feb 2024 00:31:23 -0500 Subject: [PATCH 11/12] reorder to fail on console last --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b700e9f..5b364e7 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -70,9 +70,9 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} # TODO: UI Tests in CI: codecovcli do-upload --report-type test_results --file test/**/junit-results.xml run: | - codecovcli do-upload --report-type test_results --file test/SymbolCollector.Console.Tests/TestResults/TestResults.xml codecovcli do-upload --report-type test_results --file test/SymbolCollector.Core.Tests/TestResults/TestResults.xml codecovcli do-upload --report-type test_results --file test/SymbolCollector.Server.Tests/TestResults/TestResults.xml + codecovcli do-upload --report-type test_results --file test/SymbolCollector.Console.Tests/TestResults/TestResults.xml - name: Publish coverage report uses: codecov/codecov-action@v4 From 94913513476c558b21221e08f9e6daba9a92e336 Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Fri, 16 Feb 2024 00:33:08 -0500 Subject: [PATCH 12/12] just build again --- .github/workflows/build.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5b364e7..149c4d5 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -54,15 +54,15 @@ jobs: - name: Test Core if: always() - run: dotnet test test/SymbolCollector.Core.Tests/ -c Release --no-build --logger:junit --collect:"XPlat Code Coverage" --settings test/coverletArgs.runsettings + run: dotnet test test/SymbolCollector.Core.Tests/ -c Release --logger:junit --collect:"XPlat Code Coverage" --settings test/coverletArgs.runsettings - name: Test Server if: always() - run: dotnet test test/SymbolCollector.Server.Tests/ -c Release --no-build --logger:junit --collect:"XPlat Code Coverage" --settings test/coverletArgs.runsettings + run: dotnet test test/SymbolCollector.Server.Tests/ -c Release --logger:junit --collect:"XPlat Code Coverage" --settings test/coverletArgs.runsettings - name: Test Console if: always() - run: dotnet test test/SymbolCollector.Console.Tests/ -c Release --no-build --logger:junit --collect:"XPlat Code Coverage" --settings test/coverletArgs.runsettings + run: dotnet test test/SymbolCollector.Console.Tests/ -c Release --logger:junit --collect:"XPlat Code Coverage" --settings test/coverletArgs.runsettings - name: upload test results if: always()