From 878edb2551adb05a990e66fbe22cfac556f52124 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 30 Nov 2023 15:34:23 -0800 Subject: [PATCH 001/118] First attempt adding testing Github Actions for Certify.Core.Tests.Unit --- .github/workflows/4_6_2_Core_Unit_Tests.yaml | 48 ++++++++++++++++++++ .github/workflows/8_0_Core_Unit_Tests.yaml | 48 ++++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 .github/workflows/4_6_2_Core_Unit_Tests.yaml create mode 100644 .github/workflows/8_0_Core_Unit_Tests.yaml diff --git a/.github/workflows/4_6_2_Core_Unit_Tests.yaml b/.github/workflows/4_6_2_Core_Unit_Tests.yaml new file mode 100644 index 000000000..b57d4dfbb --- /dev/null +++ b/.github/workflows/4_6_2_Core_Unit_Tests.yaml @@ -0,0 +1,48 @@ +name: build and test .NET 4.6.2 + +on: + push: + pull_request: + branches: [ main ] + paths: + - '**.cs' + - '**.csproj' + +env: + DOTNET_VERSION: '8.0.0' # The .NET SDK version to use + +jobs: + build-and-test: + + name: build-and-test-${{matrix.os}} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-latest] + + steps: + - uses: actions/checkout@v3 + - name: Setup .NET Core + uses: actions/setup-dotnet@v3 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Install dependencies + run: dotnet restore + working-directory: ./src/Certify.Tests/Certify.Core.Tests.Unit + + - name: Build + run: dotnet build -c Release --no-restore -f net462 + working-directory: ./src/Certify.Tests/Certify.Core.Tests.Unit + + - name: Test + run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net462 --logger trx --results-directory "TestResults-4_6_2-${{ matrix.os }}" + working-directory: ./src/Certify.Tests/Certify.Core.Tests.Unit/bin/Release/net462 + + - name: Upload dotnet test results + uses: actions/upload-artifact@v3 + with: + name: dotnet-results-4_6_2-${{ matrix.os }} + path: TestResults-4_6_2-${{ matrix.os }} + # Use always() to always run this step to publish test results when there are test failures + if: ${{ always() }} diff --git a/.github/workflows/8_0_Core_Unit_Tests.yaml b/.github/workflows/8_0_Core_Unit_Tests.yaml new file mode 100644 index 000000000..0e5ce23bd --- /dev/null +++ b/.github/workflows/8_0_Core_Unit_Tests.yaml @@ -0,0 +1,48 @@ +name: build and test .NET Core 8.0 + +on: + push: + pull_request: + branches: [ main ] + paths: + - '**.cs' + - '**.csproj' + +env: + DOTNET_VERSION: '8.0.0' # The .NET SDK version to use + +jobs: + build-and-test: + + name: build-and-test-${{matrix.os}} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + + steps: + - uses: actions/checkout@v3 + - name: Setup .NET Core + uses: actions/setup-dotnet@v3 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Install dependencies + run: dotnet restore + working-directory: ./src/Certify.Tests/Certify.Core.Tests.Unit + + - name: Build + run: dotnet build -c Release --no-restore -f net8.0 + working-directory: ./src/Certify.Tests/Certify.Core.Tests.Unit + + - name: Test + run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --results-directory "TestResults-8_0-${{ matrix.os }}" + working-directory: ./src/Certify.Tests/Certify.Core.Tests.Unit/bin/Release/net8.0 + + - name: Upload dotnet test results + uses: actions/upload-artifact@v3 + with: + name: dotnet-results-8_0-${{ matrix.os }} + path: TestResults-8_0-${{ matrix.os }} + # Use always() to always run this step to publish test results when there are test failures + if: ${{ always() }} From 0509beeb09158c83c1077664b67ec0e5089a1fd0 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 30 Nov 2023 15:45:02 -0800 Subject: [PATCH 002/118] Fix to the .NET Version number needed to download SDK --- .github/workflows/4_6_2_Core_Unit_Tests.yaml | 2 +- .github/workflows/8_0_Core_Unit_Tests.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests.yaml b/.github/workflows/4_6_2_Core_Unit_Tests.yaml index b57d4dfbb..2e74361d0 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests.yaml @@ -9,7 +9,7 @@ on: - '**.csproj' env: - DOTNET_VERSION: '8.0.0' # The .NET SDK version to use + DOTNET_VERSION: '8.0.100' # The .NET SDK version to use jobs: build-and-test: diff --git a/.github/workflows/8_0_Core_Unit_Tests.yaml b/.github/workflows/8_0_Core_Unit_Tests.yaml index 0e5ce23bd..532131b66 100644 --- a/.github/workflows/8_0_Core_Unit_Tests.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests.yaml @@ -9,7 +9,7 @@ on: - '**.csproj' env: - DOTNET_VERSION: '8.0.0' # The .NET SDK version to use + DOTNET_VERSION: '8.0.100' # The .NET SDK version to use jobs: build-and-test: From 3c87e397a688bea39315abe3338241ef0b8f488b Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 30 Nov 2023 17:09:43 -0800 Subject: [PATCH 003/118] Changes for pulling dependencies, and splitting 8.0 into two workflows --- ...ts.yaml => 4_6_2_Core_Unit_Tests_Win.yaml} | 20 +++++- .../workflows/8_0_Core_Unit_Tests_Linux.yaml | 64 +++++++++++++++++++ ...ests.yaml => 8_0_Core_Unit_Tests_Win.yaml} | 22 ++++++- 3 files changed, 101 insertions(+), 5 deletions(-) rename .github/workflows/{4_6_2_Core_Unit_Tests.yaml => 4_6_2_Core_Unit_Tests_Win.yaml} (69%) create mode 100644 .github/workflows/8_0_Core_Unit_Tests_Linux.yaml rename .github/workflows/{8_0_Core_Unit_Tests.yaml => 8_0_Core_Unit_Tests_Win.yaml} (68%) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml similarity index 69% rename from .github/workflows/4_6_2_Core_Unit_Tests.yaml rename to .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index 2e74361d0..eecc4339c 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -1,9 +1,9 @@ -name: build and test .NET 4.6.2 +name: build and test .NET 4.6.2 Windows on: push: pull_request: - branches: [ main ] + branches: [ release, development ] paths: - '**.cs' - '**.csproj' @@ -22,6 +22,22 @@ jobs: steps: - uses: actions/checkout@v3 + - uses: actions/checkout@master + with: + repository: webprofusion/anvil + ref: refs/heads/main + path: ./libs/anvil + - uses: actions/checkout@master + with: + repository: webprofusion/certify-plugins + ref: refs/heads/${{ github.ref_name }} + path: ./certify-plugins + - uses: actions/checkout@master + with: + repository: webprofusion/certify-internal + ref: refs/heads/main + path: ./certify-plugins + - name: Setup .NET Core uses: actions/setup-dotnet@v3 with: diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml new file mode 100644 index 000000000..8b41ab5b7 --- /dev/null +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -0,0 +1,64 @@ +name: build and test .NET Core 8.0 Linux + +on: + push: + pull_request: + branches: [ release, development ] + paths: + - '**.cs' + - '**.csproj' + +env: + DOTNET_VERSION: '8.0.100' # The .NET SDK version to use + +jobs: + build-and-test: + + name: build-and-test-${{matrix.os}} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + + steps: + - uses: actions/checkout@v3 + - uses: actions/checkout@master + with: + repository: webprofusion/anvil + ref: refs/heads/main + path: ./libs/anvil + - uses: actions/checkout@master + with: + repository: webprofusion/certify-plugins + ref: refs/heads/${{ github.ref_name }} + path: ./certify-plugins + - uses: actions/checkout@master + with: + repository: webprofusion/certify-internal + ref: refs/heads/main + path: ./certify-plugins + + - name: Setup .NET Core + uses: actions/setup-dotnet@v3 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Install dependencies + run: dotnet restore + working-directory: ./src/Certify.Tests/Certify.Core.Tests.Unit + + - name: Build + run: dotnet build -c Release --no-restore -f net8.0 + working-directory: ./src/Certify.Tests/Certify.Core.Tests.Unit + + - name: Test + run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --results-directory "TestResults-8_0-${{ matrix.os }}" + working-directory: ./src/Certify.Tests/Certify.Core.Tests.Unit/bin/Release/net8.0 + + - name: Upload dotnet test results + uses: actions/upload-artifact@v3 + with: + name: dotnet-results-8_0-${{ matrix.os }} + path: TestResults-8_0-${{ matrix.os }} + # Use always() to always run this step to publish test results when there are test failures + if: ${{ always() }} diff --git a/.github/workflows/8_0_Core_Unit_Tests.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml similarity index 68% rename from .github/workflows/8_0_Core_Unit_Tests.yaml rename to .github/workflows/8_0_Core_Unit_Tests_Win.yaml index 532131b66..551830880 100644 --- a/.github/workflows/8_0_Core_Unit_Tests.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -1,9 +1,9 @@ -name: build and test .NET Core 8.0 +name: build and test .NET Core 8.0 Windows on: push: pull_request: - branches: [ main ] + branches: [ release, development ] paths: - '**.cs' - '**.csproj' @@ -18,10 +18,26 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest] + os: [windows-latest] steps: - uses: actions/checkout@v3 + - uses: actions/checkout@master + with: + repository: webprofusion/anvil + ref: refs/heads/main + path: ./libs/anvil + - uses: actions/checkout@master + with: + repository: webprofusion/certify-plugins + ref: refs/heads/${{ github.ref_name }} + path: ./certify-plugins + - uses: actions/checkout@master + with: + repository: webprofusion/certify-internal + ref: refs/heads/main + path: ./certify-plugins + - name: Setup .NET Core uses: actions/setup-dotnet@v3 with: From a3170054da243705383e86da01d6930ccdcb1f56 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 30 Nov 2023 17:20:02 -0800 Subject: [PATCH 004/118] Change ref type for plugins dependency branch --- .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml | 2 +- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 2 +- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index eecc4339c..f49e5b65f 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -30,7 +30,7 @@ jobs: - uses: actions/checkout@master with: repository: webprofusion/certify-plugins - ref: refs/heads/${{ github.ref_name }} + ref: refs/heads/${{ github.base_ref }} path: ./certify-plugins - uses: actions/checkout@master with: diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 8b41ab5b7..8c9ad6a17 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -30,7 +30,7 @@ jobs: - uses: actions/checkout@master with: repository: webprofusion/certify-plugins - ref: refs/heads/${{ github.ref_name }} + ref: refs/heads/${{ github.base_ref }} path: ./certify-plugins - uses: actions/checkout@master with: diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 551830880..bfd0bb752 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -30,7 +30,7 @@ jobs: - uses: actions/checkout@master with: repository: webprofusion/certify-plugins - ref: refs/heads/${{ github.ref_name }} + ref: refs/heads/${{ github.base_ref }} path: ./certify-plugins - uses: actions/checkout@master with: From 53298522da902c86f35f255ffb68090d1c9e0223 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 30 Nov 2023 17:47:26 -0800 Subject: [PATCH 005/118] More changes to cloning dependencies in GitActions --- .../workflows/4_6_2_Core_Unit_Tests_Win.yaml | 26 +++++++++++++++---- .../workflows/8_0_Core_Unit_Tests_Linux.yaml | 26 +++++++++++++++---- .../workflows/8_0_Core_Unit_Tests_Win.yaml | 26 +++++++++++++++---- 3 files changed, 63 insertions(+), 15 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index f49e5b65f..d99615d6b 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -21,18 +21,34 @@ jobs: os: [windows-latest] steps: - - uses: actions/checkout@v3 - - uses: actions/checkout@master + - name: Clone webprofusion/certify + uses: actions/checkout@v3 + + - name: Clone webprofusion/anvil + uses: actions/checkout@master with: repository: webprofusion/anvil ref: refs/heads/main path: ./libs/anvil - - uses: actions/checkout@master + + - name: Clone webprofusion/certify-plugins (development) + if: ${{ contains(github.ref_name, '_dev') }} + uses: actions/checkout@master with: repository: webprofusion/certify-plugins - ref: refs/heads/${{ github.base_ref }} + ref: refs/heads/development path: ./certify-plugins - - uses: actions/checkout@master + + - name: Clone webprofusion/certify-plugins (release) + if: ${{ contains(github.ref_name, '_rel') }} + uses: actions/checkout@master + with: + repository: webprofusion/certify-plugins + ref: refs/heads/release + path: ./certify-plugins + + - name: Clone webprofusion/certify-internal + uses: actions/checkout@master with: repository: webprofusion/certify-internal ref: refs/heads/main diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 8c9ad6a17..f0a2135d4 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -21,18 +21,34 @@ jobs: os: [ubuntu-latest] steps: - - uses: actions/checkout@v3 - - uses: actions/checkout@master + - name: Clone webprofusion/certify + uses: actions/checkout@v3 + + - name: Clone webprofusion/anvil + uses: actions/checkout@master with: repository: webprofusion/anvil ref: refs/heads/main path: ./libs/anvil - - uses: actions/checkout@master + + - name: Clone webprofusion/certify-plugins (development) + if: ${{ contains(github.ref_name, '_dev') }} + uses: actions/checkout@master with: repository: webprofusion/certify-plugins - ref: refs/heads/${{ github.base_ref }} + ref: refs/heads/development path: ./certify-plugins - - uses: actions/checkout@master + + - name: Clone webprofusion/certify-plugins (release) + if: ${{ contains(github.ref_name, '_rel') }} + uses: actions/checkout@master + with: + repository: webprofusion/certify-plugins + ref: refs/heads/release + path: ./certify-plugins + + - name: Clone webprofusion/certify-internal + uses: actions/checkout@master with: repository: webprofusion/certify-internal ref: refs/heads/main diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index bfd0bb752..41fb30973 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -21,18 +21,34 @@ jobs: os: [windows-latest] steps: - - uses: actions/checkout@v3 - - uses: actions/checkout@master + - name: Clone webprofusion/certify + uses: actions/checkout@v3 + + - name: Clone webprofusion/anvil + uses: actions/checkout@master with: repository: webprofusion/anvil ref: refs/heads/main path: ./libs/anvil - - uses: actions/checkout@master + + - name: Clone webprofusion/certify-plugins (development) + if: ${{ contains(github.ref_name, '_dev') }} + uses: actions/checkout@master with: repository: webprofusion/certify-plugins - ref: refs/heads/${{ github.base_ref }} + ref: refs/heads/development path: ./certify-plugins - - uses: actions/checkout@master + + - name: Clone webprofusion/certify-plugins (release) + if: ${{ contains(github.ref_name, '_rel') }} + uses: actions/checkout@master + with: + repository: webprofusion/certify-plugins + ref: refs/heads/release + path: ./certify-plugins + + - name: Clone webprofusion/certify-internal + uses: actions/checkout@master with: repository: webprofusion/certify-internal ref: refs/heads/main From 8564a3555fa8586bc1438f0298c30dd06d3757d5 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 30 Nov 2023 17:52:09 -0800 Subject: [PATCH 006/118] Fix path for cloning certify-internal repo --- .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml | 2 +- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 2 +- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index d99615d6b..f123e684a 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -52,7 +52,7 @@ jobs: with: repository: webprofusion/certify-internal ref: refs/heads/main - path: ./certify-plugins + path: ./certify-internal - name: Setup .NET Core uses: actions/setup-dotnet@v3 diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index f0a2135d4..23c27a5b3 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -52,7 +52,7 @@ jobs: with: repository: webprofusion/certify-internal ref: refs/heads/main - path: ./certify-plugins + path: ./certify-internal - name: Setup .NET Core uses: actions/setup-dotnet@v3 diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 41fb30973..20d178349 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -52,7 +52,7 @@ jobs: with: repository: webprofusion/certify-internal ref: refs/heads/main - path: ./certify-plugins + path: ./certify-internal - name: Setup .NET Core uses: actions/setup-dotnet@v3 From 8a52afd94909917e0b98816606015ebb4baaa223 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 30 Nov 2023 17:58:06 -0800 Subject: [PATCH 007/118] Testing actions without internal repo clone --- .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml | 12 ++++++------ .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 12 ++++++------ .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index f123e684a..3d35871e4 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -47,12 +47,12 @@ jobs: ref: refs/heads/release path: ./certify-plugins - - name: Clone webprofusion/certify-internal - uses: actions/checkout@master - with: - repository: webprofusion/certify-internal - ref: refs/heads/main - path: ./certify-internal + # - name: Clone webprofusion/certify-internal + # uses: actions/checkout@master + # with: + # repository: webprofusion/certify-internal + # ref: refs/heads/main + # path: ./certify-internal - name: Setup .NET Core uses: actions/setup-dotnet@v3 diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 23c27a5b3..e663a1e65 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -47,12 +47,12 @@ jobs: ref: refs/heads/release path: ./certify-plugins - - name: Clone webprofusion/certify-internal - uses: actions/checkout@master - with: - repository: webprofusion/certify-internal - ref: refs/heads/main - path: ./certify-internal + # - name: Clone webprofusion/certify-internal + # uses: actions/checkout@master + # with: + # repository: webprofusion/certify-internal + # ref: refs/heads/main + # path: ./certify-internal - name: Setup .NET Core uses: actions/setup-dotnet@v3 diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 20d178349..718127ca8 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -47,12 +47,12 @@ jobs: ref: refs/heads/release path: ./certify-plugins - - name: Clone webprofusion/certify-internal - uses: actions/checkout@master - with: - repository: webprofusion/certify-internal - ref: refs/heads/main - path: ./certify-internal + # - name: Clone webprofusion/certify-internal + # uses: actions/checkout@master + # with: + # repository: webprofusion/certify-internal + # ref: refs/heads/main + # path: ./certify-internal - name: Setup .NET Core uses: actions/setup-dotnet@v3 From 63b7c8222137b78fbd52538ffabfd4a0b2cea428 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 30 Nov 2023 18:02:48 -0800 Subject: [PATCH 008/118] Fixing relative placement of cloning paths for dependency repos --- .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml | 8 ++++---- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 8 ++++---- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index 3d35871e4..8ef9f7696 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -29,7 +29,7 @@ jobs: with: repository: webprofusion/anvil ref: refs/heads/main - path: ./libs/anvil + path: ../libs/anvil - name: Clone webprofusion/certify-plugins (development) if: ${{ contains(github.ref_name, '_dev') }} @@ -37,7 +37,7 @@ jobs: with: repository: webprofusion/certify-plugins ref: refs/heads/development - path: ./certify-plugins + path: ../certify-plugins - name: Clone webprofusion/certify-plugins (release) if: ${{ contains(github.ref_name, '_rel') }} @@ -45,14 +45,14 @@ jobs: with: repository: webprofusion/certify-plugins ref: refs/heads/release - path: ./certify-plugins + path: ../certify-plugins # - name: Clone webprofusion/certify-internal # uses: actions/checkout@master # with: # repository: webprofusion/certify-internal # ref: refs/heads/main - # path: ./certify-internal + # path: ../certify-internal - name: Setup .NET Core uses: actions/setup-dotnet@v3 diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index e663a1e65..4e37c6ff0 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -29,7 +29,7 @@ jobs: with: repository: webprofusion/anvil ref: refs/heads/main - path: ./libs/anvil + path: ../libs/anvil - name: Clone webprofusion/certify-plugins (development) if: ${{ contains(github.ref_name, '_dev') }} @@ -37,7 +37,7 @@ jobs: with: repository: webprofusion/certify-plugins ref: refs/heads/development - path: ./certify-plugins + path: ../certify-plugins - name: Clone webprofusion/certify-plugins (release) if: ${{ contains(github.ref_name, '_rel') }} @@ -45,14 +45,14 @@ jobs: with: repository: webprofusion/certify-plugins ref: refs/heads/release - path: ./certify-plugins + path: ../certify-plugins # - name: Clone webprofusion/certify-internal # uses: actions/checkout@master # with: # repository: webprofusion/certify-internal # ref: refs/heads/main - # path: ./certify-internal + # path: ../certify-internal - name: Setup .NET Core uses: actions/setup-dotnet@v3 diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 718127ca8..b096f3ba4 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -29,7 +29,7 @@ jobs: with: repository: webprofusion/anvil ref: refs/heads/main - path: ./libs/anvil + path: ../libs/anvil - name: Clone webprofusion/certify-plugins (development) if: ${{ contains(github.ref_name, '_dev') }} @@ -37,7 +37,7 @@ jobs: with: repository: webprofusion/certify-plugins ref: refs/heads/development - path: ./certify-plugins + path: ../certify-plugins - name: Clone webprofusion/certify-plugins (release) if: ${{ contains(github.ref_name, '_rel') }} @@ -45,14 +45,14 @@ jobs: with: repository: webprofusion/certify-plugins ref: refs/heads/release - path: ./certify-plugins + path: ../certify-plugins # - name: Clone webprofusion/certify-internal # uses: actions/checkout@master # with: # repository: webprofusion/certify-internal # ref: refs/heads/main - # path: ./certify-internal + # path: ../certify-internal - name: Setup .NET Core uses: actions/setup-dotnet@v3 From ba967cb7ac13ce98156b6e0376f6a966eecf0813 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 30 Nov 2023 18:20:49 -0800 Subject: [PATCH 009/118] Setting repos for "side by side" checkout https://github.com/actions/checkout#checkout-multiple-repos-side-by-side --- .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml | 16 +++++++++------- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 12 +++++++----- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 12 +++++++----- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index 8ef9f7696..9ae7f8cd3 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -22,14 +22,16 @@ jobs: steps: - name: Clone webprofusion/certify - uses: actions/checkout@v3 + uses: actions/checkout@master + with: + path: ./certify - name: Clone webprofusion/anvil uses: actions/checkout@master with: repository: webprofusion/anvil ref: refs/heads/main - path: ../libs/anvil + path: ./libs/anvil - name: Clone webprofusion/certify-plugins (development) if: ${{ contains(github.ref_name, '_dev') }} @@ -37,7 +39,7 @@ jobs: with: repository: webprofusion/certify-plugins ref: refs/heads/development - path: ../certify-plugins + path: ./certify-plugins - name: Clone webprofusion/certify-plugins (release) if: ${{ contains(github.ref_name, '_rel') }} @@ -45,14 +47,14 @@ jobs: with: repository: webprofusion/certify-plugins ref: refs/heads/release - path: ../certify-plugins + path: ./certify-plugins # - name: Clone webprofusion/certify-internal # uses: actions/checkout@master # with: # repository: webprofusion/certify-internal # ref: refs/heads/main - # path: ../certify-internal + # path: ./certify-internal - name: Setup .NET Core uses: actions/setup-dotnet@v3 @@ -62,11 +64,11 @@ jobs: - name: Install dependencies run: dotnet restore working-directory: ./src/Certify.Tests/Certify.Core.Tests.Unit - + - name: Build run: dotnet build -c Release --no-restore -f net462 working-directory: ./src/Certify.Tests/Certify.Core.Tests.Unit - + - name: Test run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net462 --logger trx --results-directory "TestResults-4_6_2-${{ matrix.os }}" working-directory: ./src/Certify.Tests/Certify.Core.Tests.Unit/bin/Release/net462 diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 4e37c6ff0..3ed37f25b 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -22,14 +22,16 @@ jobs: steps: - name: Clone webprofusion/certify - uses: actions/checkout@v3 + uses: actions/checkout@master + with: + path: ./certify - name: Clone webprofusion/anvil uses: actions/checkout@master with: repository: webprofusion/anvil ref: refs/heads/main - path: ../libs/anvil + path: ./libs/anvil - name: Clone webprofusion/certify-plugins (development) if: ${{ contains(github.ref_name, '_dev') }} @@ -37,7 +39,7 @@ jobs: with: repository: webprofusion/certify-plugins ref: refs/heads/development - path: ../certify-plugins + path: ./certify-plugins - name: Clone webprofusion/certify-plugins (release) if: ${{ contains(github.ref_name, '_rel') }} @@ -45,14 +47,14 @@ jobs: with: repository: webprofusion/certify-plugins ref: refs/heads/release - path: ../certify-plugins + path: ./certify-plugins # - name: Clone webprofusion/certify-internal # uses: actions/checkout@master # with: # repository: webprofusion/certify-internal # ref: refs/heads/main - # path: ../certify-internal + # path: ./certify-internal - name: Setup .NET Core uses: actions/setup-dotnet@v3 diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index b096f3ba4..72da07398 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -22,14 +22,16 @@ jobs: steps: - name: Clone webprofusion/certify - uses: actions/checkout@v3 + uses: actions/checkout@master + with: + path: ./certify - name: Clone webprofusion/anvil uses: actions/checkout@master with: repository: webprofusion/anvil ref: refs/heads/main - path: ../libs/anvil + path: ./libs/anvil - name: Clone webprofusion/certify-plugins (development) if: ${{ contains(github.ref_name, '_dev') }} @@ -37,7 +39,7 @@ jobs: with: repository: webprofusion/certify-plugins ref: refs/heads/development - path: ../certify-plugins + path: ./certify-plugins - name: Clone webprofusion/certify-plugins (release) if: ${{ contains(github.ref_name, '_rel') }} @@ -45,14 +47,14 @@ jobs: with: repository: webprofusion/certify-plugins ref: refs/heads/release - path: ../certify-plugins + path: ./certify-plugins # - name: Clone webprofusion/certify-internal # uses: actions/checkout@master # with: # repository: webprofusion/certify-internal # ref: refs/heads/main - # path: ../certify-internal + # path: ./certify-internal - name: Setup .NET Core uses: actions/setup-dotnet@v3 From 3ee269cbae6ff22078ef64ef31e7b1aa2dd1fa43 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 30 Nov 2023 18:32:57 -0800 Subject: [PATCH 010/118] Fix paths on dotnet tool steps --- .../workflows/4_6_2_Core_Unit_Tests_Win.yaml | 27 +++++++------------ .../workflows/8_0_Core_Unit_Tests_Linux.yaml | 27 +++++++------------ .../workflows/8_0_Core_Unit_Tests_Win.yaml | 27 +++++++------------ 3 files changed, 30 insertions(+), 51 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index 9ae7f8cd3..a7be533c0 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -49,34 +49,27 @@ jobs: ref: refs/heads/release path: ./certify-plugins - # - name: Clone webprofusion/certify-internal - # uses: actions/checkout@master - # with: - # repository: webprofusion/certify-internal - # ref: refs/heads/main - # path: ./certify-internal - - name: Setup .NET Core - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@master with: dotnet-version: ${{ env.DOTNET_VERSION }} - - name: Install dependencies + - name: Install Dependencies run: dotnet restore - working-directory: ./src/Certify.Tests/Certify.Core.Tests.Unit + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - - name: Build + - name: Build Certify.Core.Tests.Unit run: dotnet build -c Release --no-restore -f net462 - working-directory: ./src/Certify.Tests/Certify.Core.Tests.Unit + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - - name: Test + - name: Run Certify.Core.Tests.Unit Tests run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net462 --logger trx --results-directory "TestResults-4_6_2-${{ matrix.os }}" - working-directory: ./src/Certify.Tests/Certify.Core.Tests.Unit/bin/Release/net462 + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Release/net462 - - name: Upload dotnet test results - uses: actions/upload-artifact@v3 + - name: Upload Certify.Core.Tests.Unit Test Results + uses: actions/upload-artifact@master with: name: dotnet-results-4_6_2-${{ matrix.os }} - path: TestResults-4_6_2-${{ matrix.os }} + path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Release/net462/TestResults-4_6_2-${{ matrix.os }} # Use always() to always run this step to publish test results when there are test failures if: ${{ always() }} diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 3ed37f25b..89229dbab 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -48,35 +48,28 @@ jobs: repository: webprofusion/certify-plugins ref: refs/heads/release path: ./certify-plugins - - # - name: Clone webprofusion/certify-internal - # uses: actions/checkout@master - # with: - # repository: webprofusion/certify-internal - # ref: refs/heads/main - # path: ./certify-internal - name: Setup .NET Core - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@master with: dotnet-version: ${{ env.DOTNET_VERSION }} - - name: Install dependencies + - name: Install Dependencies run: dotnet restore - working-directory: ./src/Certify.Tests/Certify.Core.Tests.Unit + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - - name: Build + - name: Build Certify.Core.Tests.Unit run: dotnet build -c Release --no-restore -f net8.0 - working-directory: ./src/Certify.Tests/Certify.Core.Tests.Unit + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - - name: Test + - name: Run Certify.Core.Tests.Unit Tests run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --results-directory "TestResults-8_0-${{ matrix.os }}" - working-directory: ./src/Certify.Tests/Certify.Core.Tests.Unit/bin/Release/net8.0 + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Release/net8.0 - - name: Upload dotnet test results - uses: actions/upload-artifact@v3 + - name: Upload Certify.Core.Tests.Unit Test Results + uses: actions/upload-artifact@master with: name: dotnet-results-8_0-${{ matrix.os }} - path: TestResults-8_0-${{ matrix.os }} + path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Release/net8.0/TestResults-8_0-${{ matrix.os }} # Use always() to always run this step to publish test results when there are test failures if: ${{ always() }} diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 72da07398..c5a19e639 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -49,34 +49,27 @@ jobs: ref: refs/heads/release path: ./certify-plugins - # - name: Clone webprofusion/certify-internal - # uses: actions/checkout@master - # with: - # repository: webprofusion/certify-internal - # ref: refs/heads/main - # path: ./certify-internal - - name: Setup .NET Core - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@master with: dotnet-version: ${{ env.DOTNET_VERSION }} - - name: Install dependencies + - name: Install Dependencies run: dotnet restore - working-directory: ./src/Certify.Tests/Certify.Core.Tests.Unit + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - - name: Build + - name: Build Certify.Core.Tests.Unit run: dotnet build -c Release --no-restore -f net8.0 - working-directory: ./src/Certify.Tests/Certify.Core.Tests.Unit + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - - name: Test + - name: Run Certify.Core.Tests.Unit Tests run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --results-directory "TestResults-8_0-${{ matrix.os }}" - working-directory: ./src/Certify.Tests/Certify.Core.Tests.Unit/bin/Release/net8.0 + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Release/net8.0 - - name: Upload dotnet test results - uses: actions/upload-artifact@v3 + - name: Upload Certify.Core.Tests.Unit Test Results + uses: actions/upload-artifact@master with: name: dotnet-results-8_0-${{ matrix.os }} - path: TestResults-8_0-${{ matrix.os }} + path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Release/net8.0/TestResults-8_0-${{ matrix.os }} # Use always() to always run this step to publish test results when there are test failures if: ${{ always() }} From 9b77371e358bd528859b3f981d994bdce4fe482d Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 30 Nov 2023 19:09:19 -0800 Subject: [PATCH 011/118] Disable .NET 4.6.2 Test Workflow until cause of test stalls is fixed --- .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index a7be533c0..f7736f185 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -13,7 +13,8 @@ env: jobs: build-and-test: - + # TODO: Re-enable once we determine the cause of the .NET Framework 4.6.2 tests stalling (test runner doesn't quit when done') + if: ${{ ! always() }} name: build-and-test-${{matrix.os}} runs-on: ${{ matrix.os }} strategy: From fc6a5dd45efb3e69bedccf993a4afe6cae301462 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 30 Nov 2023 19:11:50 -0800 Subject: [PATCH 012/118] Default pull step for cloning webprofusion/certify-plugins --- .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml | 8 ++++++++ .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 10 +++++++++- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 8 ++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index f7736f185..fda0a78ee 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -50,6 +50,14 @@ jobs: ref: refs/heads/release path: ./certify-plugins + - name: Clone webprofusion/certify-plugins (development default) + if: ${{ ! contains(github.ref_name, '_rel') && ! contains(github.ref_name, '_dev') }} + uses: actions/checkout@master + with: + repository: webprofusion/certify-plugins + ref: refs/heads/release + path: ./certify-plugins + - name: Setup .NET Core uses: actions/setup-dotnet@master with: diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 89229dbab..be90a4c99 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -48,7 +48,15 @@ jobs: repository: webprofusion/certify-plugins ref: refs/heads/release path: ./certify-plugins - + + - name: Clone webprofusion/certify-plugins (development default) + if: ${{ ! contains(github.ref_name, '_rel') && ! contains(github.ref_name, '_dev') }} + uses: actions/checkout@master + with: + repository: webprofusion/certify-plugins + ref: refs/heads/release + path: ./certify-plugins + - name: Setup .NET Core uses: actions/setup-dotnet@master with: diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index c5a19e639..19ff52011 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -49,6 +49,14 @@ jobs: ref: refs/heads/release path: ./certify-plugins + - name: Clone webprofusion/certify-plugins (development default) + if: ${{ ! contains(github.ref_name, '_rel') && ! contains(github.ref_name, '_dev') }} + uses: actions/checkout@master + with: + repository: webprofusion/certify-plugins + ref: refs/heads/release + path: ./certify-plugins + - name: Setup .NET Core uses: actions/setup-dotnet@master with: From 93f8582648be283b15bf0d1e13246eb1586ee4d3 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 30 Nov 2023 19:25:40 -0800 Subject: [PATCH 013/118] Add step to setup Step CLI on Windows Test Runner --- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 19ff52011..692db4267 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -61,6 +61,9 @@ jobs: uses: actions/setup-dotnet@master with: dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Setup Step CLI + run: mkdir C:\temp && powershell -Command "Invoke-WebRequest -Method 'GET' -uri 'https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.24.4/step_windows_0.24.4_amd64.zip' -Outfile 'C:\temp\step_windows_0.24.4_amd64.zip'" && tar -oxzf C:\temp\step_windows_0.24.4_amd64.zip -C "C:\Program Files" && rmdir /s /q C:\temp && setx /M PATH "%PATH%;C:\Program Files\step_0.24.4\bin" - name: Install Dependencies run: dotnet restore From 579c570d35e2bc672e64f0938b5c4f150db2f418 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 30 Nov 2023 19:28:34 -0800 Subject: [PATCH 014/118] Add Github Actions step to pull step-ca docker image on Windows runner --- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 692db4267..0914d4ce1 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -65,6 +65,9 @@ jobs: - name: Setup Step CLI run: mkdir C:\temp && powershell -Command "Invoke-WebRequest -Method 'GET' -uri 'https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.24.4/step_windows_0.24.4_amd64.zip' -Outfile 'C:\temp\step_windows_0.24.4_amd64.zip'" && tar -oxzf C:\temp\step_windows_0.24.4_amd64.zip -C "C:\Program Files" && rmdir /s /q C:\temp && setx /M PATH "%PATH%;C:\Program Files\step_0.24.4\bin" + - name: Pull step-ca Docker Image + run: docker pull smallstep/step-ca + - name: Install Dependencies run: dotnet restore working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit From 9f2bd0f268ef7f0cf82daedb6c30da9d20c266d4 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 30 Nov 2023 19:33:43 -0800 Subject: [PATCH 015/118] Add Github Actions step to pull step-ca docker image on Linux runner --- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index be90a4c99..dbe8ff977 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -62,6 +62,12 @@ jobs: with: dotnet-version: ${{ env.DOTNET_VERSION }} + - name: Setup Step CLI + run: wget https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.23.0/step-cli_0.23.0_amd64.deb && dpkg -i step-cli_0.23.0_amd64.deb + + - name: Pull step-ca Docker Image + run: docker pull smallstep/step-ca + - name: Install Dependencies run: dotnet restore working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit From b526768b934ec943e86319d8c17b34446a86d2ec Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 30 Nov 2023 19:34:21 -0800 Subject: [PATCH 016/118] Fix Setup Step CLI GitHub Actions step for Windows runner --- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 0914d4ce1..75add6406 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -63,7 +63,7 @@ jobs: dotnet-version: ${{ env.DOTNET_VERSION }} - name: Setup Step CLI - run: mkdir C:\temp && powershell -Command "Invoke-WebRequest -Method 'GET' -uri 'https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.24.4/step_windows_0.24.4_amd64.zip' -Outfile 'C:\temp\step_windows_0.24.4_amd64.zip'" && tar -oxzf C:\temp\step_windows_0.24.4_amd64.zip -C "C:\Program Files" && rmdir /s /q C:\temp && setx /M PATH "%PATH%;C:\Program Files\step_0.24.4\bin" + run: powershell -Command "Invoke-WebRequest -Method 'GET' -uri 'https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.24.4/step_windows_0.24.4_amd64.zip' -Outfile 'C:\temp\step_windows_0.24.4_amd64.zip'" && tar -oxzf C:\temp\step_windows_0.24.4_amd64.zip -C "C:\Program Files" && setx /M PATH "%PATH%;C:\Program Files\step_0.24.4\bin" - name: Pull step-ca Docker Image run: docker pull smallstep/step-ca From e6920b9862c9cda67276371b7e3cd78a72141073 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 30 Nov 2023 19:40:25 -0800 Subject: [PATCH 017/118] Fix Setup Step CLI GitHub Actions step for Linux runner --- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index dbe8ff977..dfaf73a84 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -63,7 +63,7 @@ jobs: dotnet-version: ${{ env.DOTNET_VERSION }} - name: Setup Step CLI - run: wget https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.23.0/step-cli_0.23.0_amd64.deb && dpkg -i step-cli_0.23.0_amd64.deb + run: wget https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.23.0/step-cli_0.23.0_amd64.deb && sudo dpkg -i step-cli_0.23.0_amd64.deb - name: Pull step-ca Docker Image run: docker pull smallstep/step-ca From ab1085863064257ffb06e072fdbf0814f3c3c139 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 30 Nov 2023 21:55:13 -0800 Subject: [PATCH 018/118] Refactor step-ca-win to be more like step-ca Linux image with env args --- .../step-ca-win-init.bat | 52 ++++++++++++++++--- .../step-ca-win.dockerfile | 2 +- .../windows_compose.yaml | 5 ++ 3 files changed, 52 insertions(+), 7 deletions(-) diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/step-ca-win-init.bat b/src/Certify.Tests/Certify.Core.Tests.Unit/step-ca-win-init.bat index c2a262060..56fde2918 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Unit/step-ca-win-init.bat +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/step-ca-win-init.bat @@ -1,23 +1,63 @@ -FOR /F "tokens=* USEBACKQ" %%F IN (`step path`) DO ( +FOR /F "tokens=* USEBACKQ" %%F IN (`step path`) DO ( SET STEPPATH=%%F ) +IF EXIST %STEPPATH%\config\ca.json ( + step-ca --password-file %STEPPATH%\secrets\password %STEPPATH%\config\ca.json + EXIT 0 +) + +IF "%DOCKER_STEPCA_INIT_NAME%"=="" ( + echo "there is no ca.json config file; please run step ca init, or provide config parameters via DOCKER_STEPCA_INIT_ vars" + EXIT 1 +) + +IF "%DOCKER_STEPCA_INIT_DNS_NAMES%"=="" ( + echo "there is no ca.json config file; please run step ca init, or provide config parameters via DOCKER_STEPCA_INIT_ vars" + EXIT 1 +) + +IF "%DOCKER_STEPCA_INIT_PROVISIONER_NAME%"=="" SET DOCKER_STEPCA_INIT_PROVISIONER_NAME=admin +IF "%DOCKER_STEPCA_INIT_ADMIN_SUBJECT%"=="" SET DOCKER_STEPCA_INIT_ADMIN_SUBJECT=step +IF "%DOCKER_STEPCA_INIT_ADDRESS%"=="" SET DOCKER_STEPCA_INIT_ADDRESS=:9000 + +IF NOT "%DOCKER_STEPCA_INIT_PASSWORD%"=="" ( +pwsh -Command "Out-File -FilePath "$Env:STEPPATH\password" -InputObject "$Env:DOCKER_STEPCA_INIT_PASSWORD";"^ + "Out-File -FilePath "$Env:STEPPATH\provisioner_password" -InputObject "$Env:DOCKER_STEPCA_INIT_PASSWORD";" +) ELSE IF NOT "%DOCKER_STEPCA_INIT_PASSWORD_FILE%"=="" ( +pwsh -Command "Out-File -FilePath "$Env:STEPPATH\password" -InputObject "$Env:DOCKER_STEPCA_INIT_PASSWORD_FILE";"^ + "Out-File -FilePath "$Env:STEPPATH\provisioner_password" -InputObject "$Env:DOCKER_STEPCA_INIT_PASSWORD_FILE";" +) ELSE ( pwsh -Command "$psw = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'.tochararray() | Get-Random -Count 40 | Join-String;"^ - "echo $psw;"^ "Out-File -FilePath "$Env:STEPPATH\password" -InputObject $psw;"^ "Out-File -FilePath "$Env:STEPPATH\provisioner_password" -InputObject $psw;"^ "Remove-Variable psw" +) + +setlocal + +SET INIT_ARGS=--deployment-type standalone --name %DOCKER_STEPCA_INIT_NAME% --dns %DOCKER_STEPCA_INIT_DNS_NAMES% --provisioner %DOCKER_STEPCA_INIT_PROVISIONER_NAME% --password-file %STEPPATH%\password --provisioner-password-file %STEPPATH%\provisioner_password --address %DOCKER_STEPCA_INIT_ADDRESS% + +IF "%DOCKER_STEPCA_INIT_SSH%"=="true" SET INIT_ARGS=%INIT_ARGS% -ssh +IF "%DOCKER_STEPCA_INIT_REMOTE_MANAGEMENT%"=="true" SET INIT_ARGS=%INIT_ARGS% --remote-management --admin-subject %DOCKER_STEPCA_INIT_ADMIN_SUBJECT% + +step ca init %INIT_ARGS% +SET /p psw=<%STEPPATH%\provisioner_password +echo "👉 Your CA administrative password is: %psw%" +echo "🤫 This will only be displayed once." + +endlocal -step ca init --deployment-type standalone --name Smallstep --dns localhost --provisioner admin ^ ---password-file %STEPPATH%\password --provisioner-password-file %STEPPATH%\provisioner_password ^ ---address :9000 --remote-management --admin-subject step +SET HEALTH_URL=https://%DOCKER_STEPCA_INIT_DNS_NAMES%%DOCKER_STEPCA_INIT_ADDRESS%/health sdelete64 -accepteula -nobanner -q %STEPPATH%\provisioner_password move "%STEPPATH%\password" "%STEPPATH%\secrets\password" +:: Current error with running this program in Windows Docker Container causes issue reading DB first time, so they must be deleted to be recreated rmdir /s /q %STEPPATH%\db -step ca provisioner add acme --type ACME +:: Current error with running this program in Windows Docker Container causes ACME not to be set with --acme +IF "%DOCKER_STEPCA_INIT_ACME%"=="true" step ca provisioner add acme --type ACME step-ca --password-file %STEPPATH%\secrets\password %STEPPATH%\config\ca.json diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/step-ca-win.dockerfile b/src/Certify.Tests/Certify.Core.Tests.Unit/step-ca-win.dockerfile index 37cba87d9..e653a1724 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Unit/step-ca-win.dockerfile +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/step-ca-win.dockerfile @@ -16,6 +16,6 @@ FROM base AS final COPY ./step-ca-win-init.bat . COPY --from=netapi /Windows/System32/netapi32.dll /Windows/System32/netapi32.dll -HEALTHCHECK CMD curl -Method GET -f http://localhost:9000/health || exit 1 +HEALTHCHECK CMD curl -Method GET -f %HEALTH_URL% || exit 1 CMD step-ca-win-init.bat && cmd diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/windows_compose.yaml b/src/Certify.Tests/Certify.Core.Tests.Unit/windows_compose.yaml index 80e4f500c..8dd660ff5 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Unit/windows_compose.yaml +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/windows_compose.yaml @@ -50,6 +50,11 @@ services: profiles: ["4_6_2", "8_0"] ports: - 9000:9000 + environment: + DOCKER_STEPCA_INIT_NAME: Smallstep + DOCKER_STEPCA_INIT_DNS_NAMES: localhost + DOCKER_STEPCA_INIT_REMOTE_MANAGEMENT: true + DOCKER_STEPCA_INIT_ACME: true volumes: - step:C:\Users\ContainerUser\.step From 4db80f86ca2bc95a4cd525ef2b1ba187ddb36b8a Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 30 Nov 2023 21:56:06 -0800 Subject: [PATCH 019/118] Changes to CertifyManagerAccountTests for Windows GitHub Actions runner --- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 2 +- .../Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 75add6406..d25cfeb70 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -66,7 +66,7 @@ jobs: run: powershell -Command "Invoke-WebRequest -Method 'GET' -uri 'https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.24.4/step_windows_0.24.4_amd64.zip' -Outfile 'C:\temp\step_windows_0.24.4_amd64.zip'" && tar -oxzf C:\temp\step_windows_0.24.4_amd64.zip -C "C:\Program Files" && setx /M PATH "%PATH%;C:\Program Files\step_0.24.4\bin" - name: Pull step-ca Docker Image - run: docker pull smallstep/step-ca + run: docker pull jrnelson90/step-ca-win - name: Install Dependencies run: dotnet restore diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs b/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs index 1aa31f23d..584b67a23 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs @@ -90,12 +90,11 @@ private async Task StartStepCaContainer() // Create new volume for step-ca container _stepVolume = new VolumeBuilder().WithName("step").Build(); await _stepVolume.CreateAsync(); - // Create new step-ca container _caContainer = new ContainerBuilder() .WithName("step-ca") // Set the image for the container to "smallstep/step-ca:latest". - .WithImage("smallstep/step-ca:latest") + .WithImage(_isWindows && Environment.GetEnvironmentVariable("GITHUB_WORKSPACE") != null ? "jrnelson90/step-ca-win:latest" : "smallstep/step-ca:latest") .WithVolumeMount(_stepVolume, "/home/step") // Bind port 9000 of the container to port 9000 on the host. .WithPortBinding(_caPort) From 5fdd2be8ad9cb9bc6033f1ec2dba8417957c155c Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 30 Nov 2023 22:09:06 -0800 Subject: [PATCH 020/118] Fix to CertifyManagerAccountTests for Windows GitHub Actions runner Fixes mounting Docker volume --- .../Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs b/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs index 584b67a23..05d325eae 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs @@ -90,12 +90,15 @@ private async Task StartStepCaContainer() // Create new volume for step-ca container _stepVolume = new VolumeBuilder().WithName("step").Build(); await _stepVolume.CreateAsync(); + + var isWindowsGitlabRunner = _isWindows && Environment.GetEnvironmentVariable("GITHUB_WORKSPACE") != null; + // Create new step-ca container _caContainer = new ContainerBuilder() .WithName("step-ca") // Set the image for the container to "smallstep/step-ca:latest". - .WithImage(_isWindows && Environment.GetEnvironmentVariable("GITHUB_WORKSPACE") != null ? "jrnelson90/step-ca-win:latest" : "smallstep/step-ca:latest") - .WithVolumeMount(_stepVolume, "/home/step") + .WithImage(isWindowsGitlabRunner ? "jrnelson90/step-ca-win:latest" : "smallstep/step-ca:latest") + .WithVolumeMount(_stepVolume, isWindowsGitlabRunner ? Path.Combine(Environment.GetEnvironmentVariable("USERPROFILE"), ".step") : "/home/step") // Bind port 9000 of the container to port 9000 on the host. .WithPortBinding(_caPort) .WithEnvironment("DOCKER_STEPCA_INIT_NAME", "Smallstep") From 49b08a46a3cf526a55ba37923bb93a859b8be1f5 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 30 Nov 2023 22:14:19 -0800 Subject: [PATCH 021/118] Adding Step-CA and Step CLI dependencies to .NET 4.6.2 test GitHub flow --- .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index fda0a78ee..3f07955c4 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -63,6 +63,12 @@ jobs: with: dotnet-version: ${{ env.DOTNET_VERSION }} + - name: Setup Step CLI + run: powershell -Command "Invoke-WebRequest -Method 'GET' -uri 'https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.24.4/step_windows_0.24.4_amd64.zip' -Outfile 'C:\temp\step_windows_0.24.4_amd64.zip'" && tar -oxzf C:\temp\step_windows_0.24.4_amd64.zip -C "C:\Program Files" && setx /M PATH "%PATH%;C:\Program Files\step_0.24.4\bin" + + - name: Pull step-ca Docker Image + run: docker pull jrnelson90/step-ca-win + - name: Install Dependencies run: dotnet restore working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit From c231f8c0cbbc21fd4bc683e0555c91afbe9222f0 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 30 Nov 2023 22:32:54 -0800 Subject: [PATCH 022/118] Fix to CertifyManagerAccountTests for Windows GitHub Actions runner --- .../CertifyManagerAccountTests.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs b/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs index 05d325eae..b69d93a62 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs @@ -26,6 +26,7 @@ public class CertifyManagerAccountTests : IDisposable private readonly CertifyManager _certifyManager; private readonly bool _isContainer = Environment.GetEnvironmentVariable("DOTNET_RUNNING_IN_CONTAINER") == "true"; private readonly bool _isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows); + private readonly bool _isWindowsGitlabRunner = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && Environment.GetEnvironmentVariable("GITHUB_WORKSPACE") != null; private readonly string _caDomain; private readonly int _caPort; private IContainer _caContainer; @@ -72,7 +73,7 @@ private async Task BootstrapStepCa() await StartStepCaContainer(); // Read step-ca fingerprint from config file - var stepCaConfigBytes = await _caContainer.ReadFileAsync("/home/step/config/defaults.json"); + var stepCaConfigBytes = await _caContainer.ReadFileAsync(_isWindowsGitlabRunner ? "C:\\Users\\ContainerUser\\.step\\config\\defaults.json" : "/home/step/config/defaults.json"); var stepCaConfigJson = JsonReader.ReadBytes(stepCaConfigBytes); stepCaFingerprint = stepCaConfigJson.fingerprint; } @@ -91,14 +92,12 @@ private async Task StartStepCaContainer() _stepVolume = new VolumeBuilder().WithName("step").Build(); await _stepVolume.CreateAsync(); - var isWindowsGitlabRunner = _isWindows && Environment.GetEnvironmentVariable("GITHUB_WORKSPACE") != null; - // Create new step-ca container _caContainer = new ContainerBuilder() .WithName("step-ca") // Set the image for the container to "smallstep/step-ca:latest". - .WithImage(isWindowsGitlabRunner ? "jrnelson90/step-ca-win:latest" : "smallstep/step-ca:latest") - .WithVolumeMount(_stepVolume, isWindowsGitlabRunner ? Path.Combine(Environment.GetEnvironmentVariable("USERPROFILE"), ".step") : "/home/step") + .WithImage(_isWindowsGitlabRunner ? "jrnelson90/step-ca-win:latest" : "smallstep/step-ca:latest") + .WithVolumeMount(_stepVolume, _isWindowsGitlabRunner ? "C:\\Users\\ContainerUser\\.step" : "/home/step") // Bind port 9000 of the container to port 9000 on the host. .WithPortBinding(_caPort) .WithEnvironment("DOCKER_STEPCA_INIT_NAME", "Smallstep") From fee935969337e47af1645c0623b7dba4305e02f1 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 30 Nov 2023 23:06:18 -0800 Subject: [PATCH 023/118] Debug Windows runner on GitHub for CertifyManagerAccountTests --- .../Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs b/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs index b69d93a62..72ab84c4e 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs @@ -73,6 +73,12 @@ private async Task BootstrapStepCa() await StartStepCaContainer(); // Read step-ca fingerprint from config file + if(_isWindowsGitlabRunner) + { + var result = await _caContainer.ExecAsync(new List { "dir", "C:\\Users\\ContainerUser\\.step\\config\\" }); + _log.Information(result.Stdout); + } + var stepCaConfigBytes = await _caContainer.ReadFileAsync(_isWindowsGitlabRunner ? "C:\\Users\\ContainerUser\\.step\\config\\defaults.json" : "/home/step/config/defaults.json"); var stepCaConfigJson = JsonReader.ReadBytes(stepCaConfigBytes); stepCaFingerprint = stepCaConfigJson.fingerprint; From 0ef9a8d8e25830feca63216f004cde7061a4ec09 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Fri, 1 Dec 2023 01:46:07 -0800 Subject: [PATCH 024/118] Fixes for running CertifyManagerAccountTests in Windows GitHub Runner --- .../CertifyManagerAccountTests.cs | 119 +++++++++++++----- 1 file changed, 88 insertions(+), 31 deletions(-) diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs b/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs index 72ab84c4e..9803ec5b5 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs @@ -34,6 +34,7 @@ public class CertifyManagerAccountTests : IDisposable private CertificateAuthority _customCa; private AccountDetails _customCaAccount; private readonly Loggy _log; + private readonly string _winRunnerTempDir = "C:\\Temp\\.step"; public CertifyManagerAccountTests() { @@ -47,7 +48,8 @@ public CertifyManagerAccountTests() BootstrapStepCa().Wait(); CheckCustomCaIsRunning().Wait(); AddCustomCa().Wait(); - AddNewAccount().Wait(); + CheckForExistingLeAccount().Wait(); + AddNewCustomCaAccount().Wait(); } private async Task BootstrapStepCa() @@ -73,15 +75,17 @@ private async Task BootstrapStepCa() await StartStepCaContainer(); // Read step-ca fingerprint from config file - if(_isWindowsGitlabRunner) + if (_isWindowsGitlabRunner) { - var result = await _caContainer.ExecAsync(new List { "dir", "C:\\Users\\ContainerUser\\.step\\config\\" }); - _log.Information(result.Stdout); + // Read step-ca fingerprint from config file + var stepCaConfigJson = JsonReader.ReadFile($"{_winRunnerTempDir}\\config\\defaults.json"); + stepCaFingerprint = stepCaConfigJson.fingerprint; + } else + { + var stepCaConfigBytes = await _caContainer.ReadFileAsync("/home/step/config/defaults.json"); + var stepCaConfigJson = JsonReader.ReadBytes(stepCaConfigBytes); + stepCaFingerprint = stepCaConfigJson.fingerprint; } - - var stepCaConfigBytes = await _caContainer.ReadFileAsync(_isWindowsGitlabRunner ? "C:\\Users\\ContainerUser\\.step\\config\\defaults.json" : "/home/step/config/defaults.json"); - var stepCaConfigJson = JsonReader.ReadBytes(stepCaConfigBytes); - stepCaFingerprint = stepCaConfigJson.fingerprint; } // Run bootstrap command @@ -94,26 +98,51 @@ private async Task StartStepCaContainer() { try { - // Create new volume for step-ca container - _stepVolume = new VolumeBuilder().WithName("step").Build(); - await _stepVolume.CreateAsync(); - - // Create new step-ca container - _caContainer = new ContainerBuilder() - .WithName("step-ca") - // Set the image for the container to "smallstep/step-ca:latest". - .WithImage(_isWindowsGitlabRunner ? "jrnelson90/step-ca-win:latest" : "smallstep/step-ca:latest") - .WithVolumeMount(_stepVolume, _isWindowsGitlabRunner ? "C:\\Users\\ContainerUser\\.step" : "/home/step") - // Bind port 9000 of the container to port 9000 on the host. - .WithPortBinding(_caPort) - .WithEnvironment("DOCKER_STEPCA_INIT_NAME", "Smallstep") - .WithEnvironment("DOCKER_STEPCA_INIT_DNS_NAMES", _caDomain) - .WithEnvironment("DOCKER_STEPCA_INIT_REMOTE_MANAGEMENT", "true") - .WithEnvironment("DOCKER_STEPCA_INIT_ACME", "true") - // Wait until the HTTPS endpoint of the container is available. - .WithWaitStrategy(Wait.ForUnixContainer().UntilMessageIsLogged($"Serving HTTPS on :{_caPort} ...")) - // Build the container configuration. - .Build(); + if (_isWindowsGitlabRunner) + { + if (!Directory.Exists(_winRunnerTempDir)) { + Directory.CreateDirectory(_winRunnerTempDir); + } + + // Create new step-ca container + _caContainer = new ContainerBuilder() + .WithName("step-ca") + // Set the image for the container to "smallstep/step-ca:latest". + .WithImage("jrnelson90/step-ca-win:latest") + .WithBindMount(_winRunnerTempDir, "C:\\Users\\ContainerUser\\.step") + // Bind port 9000 of the container to port 9000 on the host. + .WithPortBinding(_caPort) + .WithEnvironment("DOCKER_STEPCA_INIT_NAME", "Smallstep") + .WithEnvironment("DOCKER_STEPCA_INIT_DNS_NAMES", _caDomain) + .WithEnvironment("DOCKER_STEPCA_INIT_REMOTE_MANAGEMENT", "true") + .WithEnvironment("DOCKER_STEPCA_INIT_ACME", "true") + // Wait until the HTTPS endpoint of the container is available. + .WithWaitStrategy(Wait.ForUnixContainer().UntilMessageIsLogged($"Serving HTTPS on :{_caPort} ...")) + // Build the container configuration. + .Build(); + } else + { + // Create new volume for step-ca container + _stepVolume = new VolumeBuilder().WithName("step").Build(); + await _stepVolume.CreateAsync(); + + // Create new step-ca container + _caContainer = new ContainerBuilder() + .WithName("step-ca") + // Set the image for the container to "smallstep/step-ca:latest". + .WithImage("smallstep/step-ca:latest") + .WithVolumeMount(_stepVolume, "/home/step") + // Bind port 9000 of the container to port 9000 on the host. + .WithPortBinding(_caPort) + .WithEnvironment("DOCKER_STEPCA_INIT_NAME", "Smallstep") + .WithEnvironment("DOCKER_STEPCA_INIT_DNS_NAMES", _caDomain) + .WithEnvironment("DOCKER_STEPCA_INIT_REMOTE_MANAGEMENT", "true") + .WithEnvironment("DOCKER_STEPCA_INIT_ACME", "true") + // Wait until the HTTPS endpoint of the container is available. + .WithWaitStrategy(Wait.ForUnixContainer().UntilMessageIsLogged($"Serving HTTPS on :{_caPort} ...")) + // Build the container configuration. + .Build(); + } // Start step-ca container await _caContainer.StartAsync(); @@ -259,7 +288,7 @@ private async Task AddCustomCa() Assert.IsTrue(updateCaRes.IsSuccess, $"Expected Custom CA creation for CA with ID {_customCa.Id} to be successful"); } - private async Task AddNewAccount() + private async Task AddNewCustomCaAccount() { if (_customCa?.Id != null) { @@ -280,6 +309,27 @@ private async Task AddNewAccount() } } + private async Task CheckForExistingLeAccount() + { + if ((await _certifyManager.GetAccountRegistrations()).Find(a => a.CertificateAuthorityId == "letsencrypt.org") == null) + { + var contactRegistration = new ContactRegistration + { + AgreedToTermsAndConditions = true, + CertificateAuthorityId = "letsencrypt.org", + EmailAddress = "admin." + Guid.NewGuid().ToString().Substring(0, 6) + "@test.com", + ImportedAccountKey = "", + ImportedAccountURI = "", + IsStaging = true + }; + + // Add account + var addAccountRes = await _certifyManager.AddAccount(contactRegistration); + Assert.IsTrue(addAccountRes.IsSuccess, $"Expected account creation to be successful for {contactRegistration.EmailAddress}"); + _customCaAccount = (await _certifyManager.GetAccountRegistrations()).Find(a => a.Email == contactRegistration.EmailAddress); + } + } + public void Dispose() => Cleanup().Wait(); private async Task Cleanup() @@ -297,8 +347,15 @@ private async Task Cleanup() if (!_isContainer) { await _caContainer.DisposeAsync(); - await _stepVolume.DeleteAsync(); - await _stepVolume.DisposeAsync(); + if (_stepVolume != null) + { + await _stepVolume.DeleteAsync(); + await _stepVolume.DisposeAsync(); + } + else + { + Directory.Delete("C:\\Temp\\.step", true); + } } var stepConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".step", "config"); From c79a1b881151595ab15cb28287518f97bbca8bf8 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Fri, 1 Dec 2023 02:08:16 -0800 Subject: [PATCH 025/118] Tweak to command for Setup Step CLI step in Windows GitHub Runner --- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index d25cfeb70..b5a739ff6 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -63,7 +63,7 @@ jobs: dotnet-version: ${{ env.DOTNET_VERSION }} - name: Setup Step CLI - run: powershell -Command "Invoke-WebRequest -Method 'GET' -uri 'https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.24.4/step_windows_0.24.4_amd64.zip' -Outfile 'C:\temp\step_windows_0.24.4_amd64.zip'" && tar -oxzf C:\temp\step_windows_0.24.4_amd64.zip -C "C:\Program Files" && setx /M PATH "%PATH%;C:\Program Files\step_0.24.4\bin" + run: "Invoke-WebRequest -Method 'GET' -uri 'https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.24.4/step_windows_0.24.4_amd64.zip' -Outfile 'C:\\temp\\step_windows_0.24.4_amd64.zip'; tar -oxzf C:\\temp\\step_windows_0.24.4_amd64.zip -C 'C:\\Program Files'; setx /M PATH '%PATH%;C:\\Program Files\\step_0.24.4\\bin'" - name: Pull step-ca Docker Image run: docker pull jrnelson90/step-ca-win From e3fe7c216bbd929bcc60f7e01c101c80944ac140 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Fri, 1 Dec 2023 02:14:25 -0800 Subject: [PATCH 026/118] More Fixes for missing LE Accounts expected by Unit Tests --- .../CAFailoverTests.cs | 32 ++++++++++++++++--- .../CertifyManagerAccountTests.cs | 1 - 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/CAFailoverTests.cs b/src/Certify.Tests/Certify.Core.Tests.Unit/CAFailoverTests.cs index 0555e39aa..a67413a2e 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Unit/CAFailoverTests.cs +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/CAFailoverTests.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; using Certify.Management; using Certify.Models; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -11,14 +12,37 @@ namespace Certify.Core.Tests.Unit public class CAFailoverTests { private const string DEFAULTCA = "letscertify"; + private readonly CertifyManager _certifyManager; // TODO: This requires a valid test CA auth token to run //private Dictionary ConfigSettings = new Dictionary(); - //public CAFailoverTests() - //{ - // ConfigSettings = JsonConvert.DeserializeObject>(System.IO.File.ReadAllText("C:\\temp\\Certify\\TestConfigSettings.json")); - //} + public CAFailoverTests() + { + _certifyManager = new CertifyManager(); + CheckForExistingLeAccount().Wait(); + // ConfigSettings = JsonConvert.DeserializeObject>(System.IO.File.ReadAllText("C:\\temp\\Certify\\TestConfigSettings.json")); + } + + private async Task CheckForExistingLeAccount() + { + if ((await _certifyManager.GetAccountRegistrations()).Find(a => a.CertificateAuthorityId == "letsencrypt.org") == null) + { + var contactRegistration = new ContactRegistration + { + AgreedToTermsAndConditions = true, + CertificateAuthorityId = "letsencrypt.org", + EmailAddress = "admin." + Guid.NewGuid().ToString().Substring(0, 6) + "@test.com", + ImportedAccountKey = "", + ImportedAccountURI = "", + IsStaging = true + }; + + // Add account + var addAccountRes = await _certifyManager.AddAccount(contactRegistration); + Assert.IsTrue(addAccountRes.IsSuccess, $"Expected account creation to be successful for {contactRegistration.EmailAddress}"); + } + } private List GetTestCAs() { diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs b/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs index 9803ec5b5..ec349e862 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs @@ -326,7 +326,6 @@ private async Task CheckForExistingLeAccount() // Add account var addAccountRes = await _certifyManager.AddAccount(contactRegistration); Assert.IsTrue(addAccountRes.IsSuccess, $"Expected account creation to be successful for {contactRegistration.EmailAddress}"); - _customCaAccount = (await _certifyManager.GetAccountRegistrations()).Find(a => a.Email == contactRegistration.EmailAddress); } } From f3530f5ddbcfd6068acf05e0cfd3dee0907b028e Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Fri, 1 Dec 2023 02:19:25 -0800 Subject: [PATCH 027/118] Debug step for Step CLI setup in Windows GitHub Runner --- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index b5a739ff6..8fffe43df 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -65,6 +65,9 @@ jobs: - name: Setup Step CLI run: "Invoke-WebRequest -Method 'GET' -uri 'https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.24.4/step_windows_0.24.4_amd64.zip' -Outfile 'C:\\temp\\step_windows_0.24.4_amd64.zip'; tar -oxzf C:\\temp\\step_windows_0.24.4_amd64.zip -C 'C:\\Program Files'; setx /M PATH '%PATH%;C:\\Program Files\\step_0.24.4\\bin'" + - name: Validate Step CLI Install + run: "dir C:\\Program Files\\step_0.24.4" + - name: Pull step-ca Docker Image run: docker pull jrnelson90/step-ca-win From 71a1d528402ecdb7fb7d9bb90c467e8fef922c73 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Fri, 1 Dec 2023 02:26:30 -0800 Subject: [PATCH 028/118] More fixes to running tests in GitLab Runners --- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 2 +- src/Certify.Tests/Certify.Core.Tests.Unit/CAFailoverTests.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 8fffe43df..d8e5a47dd 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -66,7 +66,7 @@ jobs: run: "Invoke-WebRequest -Method 'GET' -uri 'https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.24.4/step_windows_0.24.4_amd64.zip' -Outfile 'C:\\temp\\step_windows_0.24.4_amd64.zip'; tar -oxzf C:\\temp\\step_windows_0.24.4_amd64.zip -C 'C:\\Program Files'; setx /M PATH '%PATH%;C:\\Program Files\\step_0.24.4\\bin'" - name: Validate Step CLI Install - run: "dir C:\\Program Files\\step_0.24.4" + run: dir "C:\\Program Files\\step_0.24.4" - name: Pull step-ca Docker Image run: docker pull jrnelson90/step-ca-win diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/CAFailoverTests.cs b/src/Certify.Tests/Certify.Core.Tests.Unit/CAFailoverTests.cs index a67413a2e..1748a5978 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Unit/CAFailoverTests.cs +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/CAFailoverTests.cs @@ -20,6 +20,7 @@ public class CAFailoverTests public CAFailoverTests() { _certifyManager = new CertifyManager(); + _certifyManager.Init().Wait(); CheckForExistingLeAccount().Wait(); // ConfigSettings = JsonConvert.DeserializeObject>(System.IO.File.ReadAllText("C:\\temp\\Certify\\TestConfigSettings.json")); } From 2d2d6a9df7805a9acbab688c803d146e5fcfb1d2 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Fri, 1 Dec 2023 02:39:01 -0800 Subject: [PATCH 029/118] More debugging info for fixing GitLab Runners --- .../workflows/8_0_Core_Unit_Tests_Win.yaml | 2 +- .../CAFailoverTests.cs | 37 +++---------------- 2 files changed, 7 insertions(+), 32 deletions(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index d8e5a47dd..1c551a72e 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -66,7 +66,7 @@ jobs: run: "Invoke-WebRequest -Method 'GET' -uri 'https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.24.4/step_windows_0.24.4_amd64.zip' -Outfile 'C:\\temp\\step_windows_0.24.4_amd64.zip'; tar -oxzf C:\\temp\\step_windows_0.24.4_amd64.zip -C 'C:\\Program Files'; setx /M PATH '%PATH%;C:\\Program Files\\step_0.24.4\\bin'" - name: Validate Step CLI Install - run: dir "C:\\Program Files\\step_0.24.4" + run: dir "C:\\Program Files\\step_0.24.4" && echo %PATH% - name: Pull step-ca Docker Image run: docker pull jrnelson90/step-ca-win diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/CAFailoverTests.cs b/src/Certify.Tests/Certify.Core.Tests.Unit/CAFailoverTests.cs index 1748a5978..b47eb7afe 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Unit/CAFailoverTests.cs +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/CAFailoverTests.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Threading.Tasks; using Certify.Management; using Certify.Models; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -12,38 +11,14 @@ namespace Certify.Core.Tests.Unit public class CAFailoverTests { private const string DEFAULTCA = "letscertify"; - private readonly CertifyManager _certifyManager; // TODO: This requires a valid test CA auth token to run //private Dictionary ConfigSettings = new Dictionary(); - public CAFailoverTests() - { - _certifyManager = new CertifyManager(); - _certifyManager.Init().Wait(); - CheckForExistingLeAccount().Wait(); - // ConfigSettings = JsonConvert.DeserializeObject>(System.IO.File.ReadAllText("C:\\temp\\Certify\\TestConfigSettings.json")); - } - - private async Task CheckForExistingLeAccount() - { - if ((await _certifyManager.GetAccountRegistrations()).Find(a => a.CertificateAuthorityId == "letsencrypt.org") == null) - { - var contactRegistration = new ContactRegistration - { - AgreedToTermsAndConditions = true, - CertificateAuthorityId = "letsencrypt.org", - EmailAddress = "admin." + Guid.NewGuid().ToString().Substring(0, 6) + "@test.com", - ImportedAccountKey = "", - ImportedAccountURI = "", - IsStaging = true - }; - - // Add account - var addAccountRes = await _certifyManager.AddAccount(contactRegistration); - Assert.IsTrue(addAccountRes.IsSuccess, $"Expected account creation to be successful for {contactRegistration.EmailAddress}"); - } - } + //public CAFailoverTests() + //{ + // ConfigSettings = JsonConvert.DeserializeObject>(System.IO.File.ReadAllText("C:\\temp\\Certify\\TestConfigSettings.json")); + //} private List GetTestCAs() { @@ -228,7 +203,7 @@ public void TestBasicNoFallbacks() var selectedAccount = RenewalManager.SelectCAWithFailover(caList, accounts.FindAll(a => a.IsStagingAccount == false), managedCertificate, defaultCAAccount); // assert result - Assert.IsTrue(selectedAccount.CertificateAuthorityId == DEFAULTCA, "Default CA should be selected"); + Assert.IsTrue(selectedAccount.CertificateAuthorityId == DEFAULTCA, $"Default CA should be selected: returned CA {selectedAccount.CertificateAuthorityId}"); Assert.IsFalse(selectedAccount.IsFailoverSelection, "Account should not be marked as a failover choice"); } @@ -256,7 +231,7 @@ public void TestBasicNextFallbackNull() var selectedAccount = RenewalManager.SelectCAWithFailover(caList, accounts, managedCertificate, defaultCAAccount); // assert result - Assert.IsTrue(selectedAccount.CertificateAuthorityId == DEFAULTCA, "Default CA should be selected"); + Assert.IsTrue(selectedAccount.CertificateAuthorityId == DEFAULTCA, $"Default CA should be selected: returned CA {selectedAccount.CertificateAuthorityId}"); Assert.IsFalse(selectedAccount.IsFailoverSelection, "Account should not be marked as a failover choice"); } From 1d408e71306dbc7449537217d3baa60907aaffa2 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Fri, 1 Dec 2023 02:47:44 -0800 Subject: [PATCH 030/118] More debugging info for Step CLI step in GitLab Runners --- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 1c551a72e..fb3dd325d 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -66,7 +66,7 @@ jobs: run: "Invoke-WebRequest -Method 'GET' -uri 'https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.24.4/step_windows_0.24.4_amd64.zip' -Outfile 'C:\\temp\\step_windows_0.24.4_amd64.zip'; tar -oxzf C:\\temp\\step_windows_0.24.4_amd64.zip -C 'C:\\Program Files'; setx /M PATH '%PATH%;C:\\Program Files\\step_0.24.4\\bin'" - name: Validate Step CLI Install - run: dir "C:\\Program Files\\step_0.24.4" && echo %PATH% + run: dir "C:\\Program Files\\step_0.24.4" && [Environment]::GetEnvironmentVariable("Path") -split ";" - name: Pull step-ca Docker Image run: docker pull jrnelson90/step-ca-win From 89ee2fd0f6473eebfb31c904735be4a37c321450 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Fri, 1 Dec 2023 02:53:57 -0800 Subject: [PATCH 031/118] Tweak for adding Step CLI to Windows GitLab Runner PATH --- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index fb3dd325d..f23e00fd3 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -63,7 +63,10 @@ jobs: dotnet-version: ${{ env.DOTNET_VERSION }} - name: Setup Step CLI - run: "Invoke-WebRequest -Method 'GET' -uri 'https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.24.4/step_windows_0.24.4_amd64.zip' -Outfile 'C:\\temp\\step_windows_0.24.4_amd64.zip'; tar -oxzf C:\\temp\\step_windows_0.24.4_amd64.zip -C 'C:\\Program Files'; setx /M PATH '%PATH%;C:\\Program Files\\step_0.24.4\\bin'" + run: "Invoke-WebRequest -Method 'GET' -uri 'https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.24.4/step_windows_0.24.4_amd64.zip' -Outfile 'C:\\temp\\step_windows_0.24.4_amd64.zip'; tar -oxzf C:\\temp\\step_windows_0.24.4_amd64.zip -C 'C:\\Program Files';" + + - name: Add Step CLI to PATH + run: setx /M PATH "%PATH%;C:\\Program Files\\step_0.24.4\\bin" - name: Validate Step CLI Install run: dir "C:\\Program Files\\step_0.24.4" && [Environment]::GetEnvironmentVariable("Path") -split ";" From 86273c1932174fb7b12ca505fb1014d0d3bf20b8 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Fri, 1 Dec 2023 03:16:02 -0800 Subject: [PATCH 032/118] Another tweak for adding Step CLI to Windows GitLab Runner PATH --- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index f23e00fd3..c900e7361 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -66,7 +66,7 @@ jobs: run: "Invoke-WebRequest -Method 'GET' -uri 'https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.24.4/step_windows_0.24.4_amd64.zip' -Outfile 'C:\\temp\\step_windows_0.24.4_amd64.zip'; tar -oxzf C:\\temp\\step_windows_0.24.4_amd64.zip -C 'C:\\Program Files';" - name: Add Step CLI to PATH - run: setx /M PATH "%PATH%;C:\\Program Files\\step_0.24.4\\bin" + run: $NewPath = $Env.Path += ";C:\\Program Files\\step_0.24.4\\bin" && [Environment]::SetEnvironmentVariable( "Path", $NewPath, "Machine" ) - name: Validate Step CLI Install run: dir "C:\\Program Files\\step_0.24.4" && [Environment]::GetEnvironmentVariable("Path") -split ";" From 07d085ad4835a9662142f3a6daaa8f20ac447a9f Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Fri, 1 Dec 2023 03:23:24 -0800 Subject: [PATCH 033/118] Path update for Step CLI in Windows GitLab Runner --- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index c900e7361..9786817de 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -66,7 +66,7 @@ jobs: run: "Invoke-WebRequest -Method 'GET' -uri 'https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.24.4/step_windows_0.24.4_amd64.zip' -Outfile 'C:\\temp\\step_windows_0.24.4_amd64.zip'; tar -oxzf C:\\temp\\step_windows_0.24.4_amd64.zip -C 'C:\\Program Files';" - name: Add Step CLI to PATH - run: $NewPath = $Env.Path += ";C:\\Program Files\\step_0.24.4\\bin" && [Environment]::SetEnvironmentVariable( "Path", $NewPath, "Machine" ) + run: $NewPath = $Env.Path += ";C:\\Program Files\\step_0.24.4\\bin" && [Environment]::SetEnvironmentVariable("Path", $NewPath) - name: Validate Step CLI Install run: dir "C:\\Program Files\\step_0.24.4" && [Environment]::GetEnvironmentVariable("Path") -split ";" From ac5728de1a36a249bf05b177d2402e53c4fc5e8d Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Fri, 1 Dec 2023 03:41:56 -0800 Subject: [PATCH 034/118] More GitHub Runner Tweaks --- .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml | 6 +++--- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 6 +++--- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index 3f07955c4..0ac116f31 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -74,17 +74,17 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Build Certify.Core.Tests.Unit - run: dotnet build -c Release --no-restore -f net462 + run: dotnet build -c Debug --no-restore -f net462 working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Run Certify.Core.Tests.Unit Tests run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net462 --logger trx --results-directory "TestResults-4_6_2-${{ matrix.os }}" - working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Release/net462 + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462 - name: Upload Certify.Core.Tests.Unit Test Results uses: actions/upload-artifact@master with: name: dotnet-results-4_6_2-${{ matrix.os }} - path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Release/net462/TestResults-4_6_2-${{ matrix.os }} + path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ matrix.os }} # Use always() to always run this step to publish test results when there are test failures if: ${{ always() }} diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index dfaf73a84..70303ca56 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -73,17 +73,17 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Build Certify.Core.Tests.Unit - run: dotnet build -c Release --no-restore -f net8.0 + run: dotnet build -c Debug --no-restore -f net8.0 working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Run Certify.Core.Tests.Unit Tests run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --results-directory "TestResults-8_0-${{ matrix.os }}" - working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Release/net8.0 + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - name: Upload Certify.Core.Tests.Unit Test Results uses: actions/upload-artifact@master with: name: dotnet-results-8_0-${{ matrix.os }} - path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Release/net8.0/TestResults-8_0-${{ matrix.os }} + path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} # Use always() to always run this step to publish test results when there are test failures if: ${{ always() }} diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 9786817de..fe197b403 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -66,7 +66,7 @@ jobs: run: "Invoke-WebRequest -Method 'GET' -uri 'https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.24.4/step_windows_0.24.4_amd64.zip' -Outfile 'C:\\temp\\step_windows_0.24.4_amd64.zip'; tar -oxzf C:\\temp\\step_windows_0.24.4_amd64.zip -C 'C:\\Program Files';" - name: Add Step CLI to PATH - run: $NewPath = $Env.Path += ";C:\\Program Files\\step_0.24.4\\bin" && [Environment]::SetEnvironmentVariable("Path", $NewPath) + run: $NewPath = [Environment]::GetEnvironmentVariable("Path") += ";C:\\Program Files\\step_0.24.4\\bin" && [Environment]::SetEnvironmentVariable("GITHUB_PATH", $NewPath) - name: Validate Step CLI Install run: dir "C:\\Program Files\\step_0.24.4" && [Environment]::GetEnvironmentVariable("Path") -split ";" @@ -79,17 +79,17 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Build Certify.Core.Tests.Unit - run: dotnet build -c Release --no-restore -f net8.0 + run: dotnet build -c Debug --no-restore -f net8.0 working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Run Certify.Core.Tests.Unit Tests run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --results-directory "TestResults-8_0-${{ matrix.os }}" - working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Release/net8.0 + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - name: Upload Certify.Core.Tests.Unit Test Results uses: actions/upload-artifact@master with: name: dotnet-results-8_0-${{ matrix.os }} - path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Release/net8.0/TestResults-8_0-${{ matrix.os }} + path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} # Use always() to always run this step to publish test results when there are test failures if: ${{ always() }} From a2ec8e0aa41c27c2a28f7799d3722de8ebbbeb69 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Fri, 1 Dec 2023 03:47:18 -0800 Subject: [PATCH 035/118] Add to Windows GitHub Path using GITHUB_PATH --- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index fe197b403..b2a0b30f3 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -66,10 +66,10 @@ jobs: run: "Invoke-WebRequest -Method 'GET' -uri 'https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.24.4/step_windows_0.24.4_amd64.zip' -Outfile 'C:\\temp\\step_windows_0.24.4_amd64.zip'; tar -oxzf C:\\temp\\step_windows_0.24.4_amd64.zip -C 'C:\\Program Files';" - name: Add Step CLI to PATH - run: $NewPath = [Environment]::GetEnvironmentVariable("Path") += ";C:\\Program Files\\step_0.24.4\\bin" && [Environment]::SetEnvironmentVariable("GITHUB_PATH", $NewPath) + run: echo "C:\\Program Files\\step_0.24.4\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Validate Step CLI Install - run: dir "C:\\Program Files\\step_0.24.4" && [Environment]::GetEnvironmentVariable("Path") -split ";" + run: dir "C:\\Program Files\\step_0.24.4" && [Environment]::GetEnvironmentVariable("Path") -split ";" && [Environment]::GetEnvironmentVariable("GITHUB_PATH") -split ";" - name: Pull step-ca Docker Image run: docker pull jrnelson90/step-ca-win From 162adc66901b5769e4efa4354084fe44024bea32 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Fri, 1 Dec 2023 04:03:15 -0800 Subject: [PATCH 036/118] Finishing up adding Step CLI to PATH in Windows GitHub Runners --- .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml | 8 +++++++- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index 0ac116f31..9e46f0298 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -64,7 +64,13 @@ jobs: dotnet-version: ${{ env.DOTNET_VERSION }} - name: Setup Step CLI - run: powershell -Command "Invoke-WebRequest -Method 'GET' -uri 'https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.24.4/step_windows_0.24.4_amd64.zip' -Outfile 'C:\temp\step_windows_0.24.4_amd64.zip'" && tar -oxzf C:\temp\step_windows_0.24.4_amd64.zip -C "C:\Program Files" && setx /M PATH "%PATH%;C:\Program Files\step_0.24.4\bin" + run: "Invoke-WebRequest -Method 'GET' -uri 'https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.24.4/step_windows_0.24.4_amd64.zip' -Outfile 'C:\\temp\\step_windows_0.24.4_amd64.zip'; tar -oxzf C:\\temp\\step_windows_0.24.4_amd64.zip -C 'C:\\Program Files';" + + - name: Add Step CLI to PATH + run: echo "C:\Program Files\step_0.24.4\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + - name: Validate Step CLI Install + run: dir "C:\Program Files\step_0.24.4" && [Environment]::GetEnvironmentVariable("Path") -split ";" && [Environment]::GetEnvironmentVariable("GITHUB_PATH") -split ";" - name: Pull step-ca Docker Image run: docker pull jrnelson90/step-ca-win diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index b2a0b30f3..44945da69 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -66,10 +66,10 @@ jobs: run: "Invoke-WebRequest -Method 'GET' -uri 'https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.24.4/step_windows_0.24.4_amd64.zip' -Outfile 'C:\\temp\\step_windows_0.24.4_amd64.zip'; tar -oxzf C:\\temp\\step_windows_0.24.4_amd64.zip -C 'C:\\Program Files';" - name: Add Step CLI to PATH - run: echo "C:\\Program Files\\step_0.24.4\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + run: echo "C:\Program Files\step_0.24.4\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Validate Step CLI Install - run: dir "C:\\Program Files\\step_0.24.4" && [Environment]::GetEnvironmentVariable("Path") -split ";" && [Environment]::GetEnvironmentVariable("GITHUB_PATH") -split ";" + run: dir "C:\Program Files\step_0.24.4" && [Environment]::GetEnvironmentVariable("Path") -split ";" && [Environment]::GetEnvironmentVariable("GITHUB_PATH") -split ";" - name: Pull step-ca Docker Image run: docker pull jrnelson90/step-ca-win From 87dc36521d43d044a7098282a27eda0e31f8c64a Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Tue, 5 Dec 2023 08:30:29 -0800 Subject: [PATCH 037/118] Testing adding code coverage report to GitHub Actions markup output --- .../workflows/8_0_Core_Unit_Tests_Linux.yaml | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 70303ca56..fd36319a0 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -77,7 +77,7 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Run Certify.Core.Tests.Unit Tests - run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --results-directory "TestResults-8_0-${{ matrix.os }}" + run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ matrix.os }}" working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - name: Upload Certify.Core.Tests.Unit Test Results @@ -87,3 +87,23 @@ jobs: path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} # Use always() to always run this step to publish test results when there are test failures if: ${{ always() }} + + - name: Code Coverage Report + uses: irongut/CodeCoverageSummary@v1.3.0 + with: + filename: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}coverage.cobertura.xml + badge: true + fail_below_min: false + format: markdown + hide_branch_rate: false + hide_complexity: false + indicators: true + output: both + thresholds: '50 70' + + - name: Add Coverage PR Comment + uses: marocchino/sticky-pull-request-comment@v2 + if: github.event_name == 'pull_request' + with: + recreate: true + path: code-coverage-results.md From c0b664974a926b1867e5960cae948365afcafdca Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Tue, 5 Dec 2023 08:34:27 -0800 Subject: [PATCH 038/118] Update sticky pull request comment version in Linux GitHub Action --- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index fd36319a0..9ea931bde 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -102,7 +102,7 @@ jobs: thresholds: '50 70' - name: Add Coverage PR Comment - uses: marocchino/sticky-pull-request-comment@v2 + uses: marocchino/sticky-pull-request-comment@v2.8.0 if: github.event_name == 'pull_request' with: recreate: true From e06a6e424806e9825140454c223ba567bd83d6c7 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Tue, 5 Dec 2023 08:51:41 -0800 Subject: [PATCH 039/118] Try using EnricoMi/publish-unit-test-result-action GitHub action --- .../workflows/8_0_Core_Unit_Tests_Linux.yaml | 42 +++++++++++-------- .../workflows/8_0_Core_Unit_Tests_Win.yaml | 33 +++++++++++---- 2 files changed, 50 insertions(+), 25 deletions(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 9ea931bde..59fa894fa 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -88,22 +88,28 @@ jobs: # Use always() to always run this step to publish test results when there are test failures if: ${{ always() }} - - name: Code Coverage Report - uses: irongut/CodeCoverageSummary@v1.3.0 + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action@v2 + if: always() with: - filename: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}coverage.cobertura.xml - badge: true - fail_below_min: false - format: markdown - hide_branch_rate: false - hide_complexity: false - indicators: true - output: both - thresholds: '50 70' - - - name: Add Coverage PR Comment - uses: marocchino/sticky-pull-request-comment@v2.8.0 - if: github.event_name == 'pull_request' - with: - recreate: true - path: code-coverage-results.md + files: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/*.trx + + # - name: Code Coverage Report + # uses: irongut/CodeCoverageSummary@v1.3.0 + # with: + # filename: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}coverage.cobertura.xml + # badge: true + # fail_below_min: false + # format: markdown + # hide_branch_rate: false + # hide_complexity: false + # indicators: true + # output: both + # thresholds: '50 70' + + # - name: Add Coverage PR Comment + # uses: marocchino/sticky-pull-request-comment@v2.8.0 + # if: github.event_name == 'pull_request' + # with: + # recreate: true + # path: code-coverage-results.md diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 44945da69..6b6c297a2 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -83,13 +83,32 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Run Certify.Core.Tests.Unit Tests - run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --results-directory "TestResults-8_0-${{ matrix.os }}" + run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ matrix.os }}" working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - - name: Upload Certify.Core.Tests.Unit Test Results - uses: actions/upload-artifact@master + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action/composite@v2 + if: always() with: - name: dotnet-results-8_0-${{ matrix.os }} - path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} - # Use always() to always run this step to publish test results when there are test failures - if: ${{ always() }} + files: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/*.trx + + # - name: Upload Certify.Core.Tests.Unit Test Results + # uses: actions/upload-artifact@master + # with: + # name: dotnet-results-8_0-${{ matrix.os }} + # path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} + # # Use always() to always run this step to publish test results when there are test failures + # if: ${{ always() }} + + # - name: Code Coverage Report + # uses: irongut/CodeCoverageSummary@v1.3.0 + # with: + # filename: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}coverage.cobertura.xml + # badge: true + # fail_below_min: false + # format: markdown + # hide_branch_rate: false + # hide_complexity: false + # indicators: true + # output: both + # thresholds: '50 70' \ No newline at end of file From 096946e0b5dc9f7d36bd9c1c2b0ffe6eeaa357f9 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Tue, 5 Dec 2023 09:50:34 -0800 Subject: [PATCH 040/118] Make coverage report without GitHub Action, using ReportGenerator CLI --- .../workflows/8_0_Core_Unit_Tests_Linux.yaml | 20 ++++++++----- .../workflows/8_0_Core_Unit_Tests_Win.yaml | 30 +++++++++++-------- 2 files changed, 31 insertions(+), 19 deletions(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 59fa894fa..fee218057 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -68,6 +68,9 @@ jobs: - name: Pull step-ca Docker Image run: docker pull smallstep/step-ca + - name: Install ReportGenerator Coverage Tool + run: dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 + - name: Install Dependencies run: dotnet restore working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit @@ -80,7 +83,10 @@ jobs: run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ matrix.os }}" working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - - name: Upload Certify.Core.Tests.Unit Test Results + - name: Generated HTML Coverage Report + run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} + + - name: Upload Certify.Core.Tests.Unit Test Results and Coverage uses: actions/upload-artifact@master with: name: dotnet-results-8_0-${{ matrix.os }} @@ -88,16 +94,16 @@ jobs: # Use always() to always run this step to publish test results when there are test failures if: ${{ always() }} - - name: Publish Test Results - uses: EnricoMi/publish-unit-test-result-action@v2 - if: always() - with: - files: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/*.trx + # - name: Publish Test Results + # uses: EnricoMi/publish-unit-test-result-action@v2 + # if: always() + # with: + # files: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/*.trx # - name: Code Coverage Report # uses: irongut/CodeCoverageSummary@v1.3.0 # with: - # filename: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}coverage.cobertura.xml + # filename: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/coverage.cobertura.xml # badge: true # fail_below_min: false # format: markdown diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 6b6c297a2..dcec48a30 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -74,6 +74,9 @@ jobs: - name: Pull step-ca Docker Image run: docker pull jrnelson90/step-ca-win + - name: Install ReportGenerator Coverage Tool + run: dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 + - name: Install Dependencies run: dotnet restore working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit @@ -86,24 +89,27 @@ jobs: run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ matrix.os }}" working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - - name: Publish Test Results - uses: EnricoMi/publish-unit-test-result-action/composite@v2 - if: always() + - name: Generated HTML Coverage Report + run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} + + - name: Upload Certify.Core.Tests.Unit Test Results and Coverage + uses: actions/upload-artifact@master with: - files: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/*.trx - - # - name: Upload Certify.Core.Tests.Unit Test Results - # uses: actions/upload-artifact@master + name: dotnet-results-8_0-${{ matrix.os }} + path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} + # Use always() to always run this step to publish test results when there are test failures + if: ${{ always() }} + + # - name: Publish Test Results + # uses: EnricoMi/publish-unit-test-result-action/composite@v2 + # if: always() # with: - # name: dotnet-results-8_0-${{ matrix.os }} - # path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} - # # Use always() to always run this step to publish test results when there are test failures - # if: ${{ always() }} + # files: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/*.trx # - name: Code Coverage Report # uses: irongut/CodeCoverageSummary@v1.3.0 # with: - # filename: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}coverage.cobertura.xml + # filename: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/coverage.cobertura.xml # badge: true # fail_below_min: false # format: markdown From a7702dccfb243dba53a179d7841048de78292118 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Tue, 5 Dec 2023 10:04:43 -0800 Subject: [PATCH 041/118] Debug output files to Testresults folder from dotnet test --- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 3 +++ .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index fee218057..c1df24f4e 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -83,6 +83,9 @@ jobs: run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ matrix.os }}" working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 + - name: Debug Test Results Output + run: ls ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} + - name: Generated HTML Coverage Report run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index dcec48a30..85d618b56 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -89,6 +89,9 @@ jobs: run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ matrix.os }}" working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 + - name: Debug Test Results Output + run: dir ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} + - name: Generated HTML Coverage Report run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} From 28d5b9afd40ab557f7198aaa6663d5f0463ae5a0 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Tue, 5 Dec 2023 10:12:55 -0800 Subject: [PATCH 042/118] Further debugging of test results output files --- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 2 +- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index c1df24f4e..078b36312 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -84,7 +84,7 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - name: Debug Test Results Output - run: ls ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} + run: ls ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} && ls ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/* - name: Generated HTML Coverage Report run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 85d618b56..3b7c1aad7 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -90,7 +90,7 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - name: Debug Test Results Output - run: dir ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} + run: dir ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} && dir ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/* - name: Generated HTML Coverage Report run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} From c2e41e39b0f89f0c2c9e89d2e37d78622d622c2e Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Tue, 5 Dec 2023 10:30:39 -0800 Subject: [PATCH 043/118] Fix path for cobertura coverage file in report generation --- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 4 ++-- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 078b36312..3bb7f68de 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -84,10 +84,10 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - name: Debug Test Results Output - run: ls ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} && ls ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/* + run: ls ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} && ls ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/** - name: Generated HTML Coverage Report - run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} + run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} - name: Upload Certify.Core.Tests.Unit Test Results and Coverage uses: actions/upload-artifact@master diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 3b7c1aad7..3ee6b9457 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -90,10 +90,10 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - name: Debug Test Results Output - run: dir ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} && dir ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/* + run: dir ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} && dir ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/**/ - name: Generated HTML Coverage Report - run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} + run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} - name: Upload Certify.Core.Tests.Unit Test Results and Coverage uses: actions/upload-artifact@master From 48999d63777068eeb3dfaf4cc9b9937eed95374f Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Tue, 5 Dec 2023 10:50:57 -0800 Subject: [PATCH 044/118] Add Coverlet Collector Package at runtime of GitHub Action for coverage --- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 3 +++ .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 3bb7f68de..cb00be3be 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -75,6 +75,9 @@ jobs: run: dotnet restore working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit + - name: Install Coverlet Collector Package + run: dotnet add package coverlet.collector + - name: Build Certify.Core.Tests.Unit run: dotnet build -c Debug --no-restore -f net8.0 working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 3ee6b9457..2dd234c0d 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -80,7 +80,10 @@ jobs: - name: Install Dependencies run: dotnet restore working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - + + - name: Install Coverlet Collector Package + run: dotnet add package coverlet.collector + - name: Build Certify.Core.Tests.Unit run: dotnet build -c Debug --no-restore -f net8.0 working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit From f69aae540b48a89df7336948e0335c2e86539e05 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Tue, 5 Dec 2023 10:57:01 -0800 Subject: [PATCH 045/118] Specify working directory when adding Coverlet Collector package --- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 1 + .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index cb00be3be..b6bc497f1 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -77,6 +77,7 @@ jobs: - name: Install Coverlet Collector Package run: dotnet add package coverlet.collector + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Build Certify.Core.Tests.Unit run: dotnet build -c Debug --no-restore -f net8.0 diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 2dd234c0d..edac0bff4 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -83,6 +83,7 @@ jobs: - name: Install Coverlet Collector Package run: dotnet add package coverlet.collector + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Build Certify.Core.Tests.Unit run: dotnet build -c Debug --no-restore -f net8.0 From 01461ff1833f5013960e7a31c00a858830b99f77 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Tue, 5 Dec 2023 11:16:47 -0800 Subject: [PATCH 046/118] Add coverlet.collector through project dependencies rather than CLI --- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 6 +----- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 7 ------- .../Certify.Core.Tests.Unit/Certify.Core.Tests.Unit.csproj | 4 ++++ 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index b6bc497f1..8ffd4ed9d 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -74,10 +74,6 @@ jobs: - name: Install Dependencies run: dotnet restore working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - - - name: Install Coverlet Collector Package - run: dotnet add package coverlet.collector - working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Build Certify.Core.Tests.Unit run: dotnet build -c Debug --no-restore -f net8.0 @@ -88,7 +84,7 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - name: Debug Test Results Output - run: ls ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} && ls ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/** + run: ls ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} && ls ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/**/ - name: Generated HTML Coverage Report run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index edac0bff4..dff1510f2 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -68,9 +68,6 @@ jobs: - name: Add Step CLI to PATH run: echo "C:\Program Files\step_0.24.4\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - name: Validate Step CLI Install - run: dir "C:\Program Files\step_0.24.4" && [Environment]::GetEnvironmentVariable("Path") -split ";" && [Environment]::GetEnvironmentVariable("GITHUB_PATH") -split ";" - - name: Pull step-ca Docker Image run: docker pull jrnelson90/step-ca-win @@ -80,10 +77,6 @@ jobs: - name: Install Dependencies run: dotnet restore working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - - - name: Install Coverlet Collector Package - run: dotnet add package coverlet.collector - working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Build Certify.Core.Tests.Unit run: dotnet build -c Debug --no-restore -f net8.0 diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/Certify.Core.Tests.Unit.csproj b/src/Certify.Tests/Certify.Core.Tests.Unit/Certify.Core.Tests.Unit.csproj index 1273b3f7d..df5a1dbf3 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Unit/Certify.Core.Tests.Unit.csproj +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/Certify.Core.Tests.Unit.csproj @@ -132,6 +132,10 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + From 568cd6a92621d163a6dab95d23d22b0261889d26 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Tue, 5 Dec 2023 12:18:42 -0800 Subject: [PATCH 047/118] Changes to fix loading Coverlet Collector without running dotnet publish --- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 4 ++-- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 8ffd4ed9d..8c9aa8b71 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -80,11 +80,11 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Run Certify.Core.Tests.Unit Tests - run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ matrix.os }}" + run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ matrix.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - name: Debug Test Results Output - run: ls ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} && ls ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/**/ + run: ls ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} && ls ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/** - name: Generated HTML Coverage Report run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index dff1510f2..ed2440903 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -83,7 +83,7 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Run Certify.Core.Tests.Unit Tests - run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ matrix.os }}" + run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ matrix.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - name: Debug Test Results Output From d4720d7f7b7df6793fc4b6a1a3adbc50f51a8ca0 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Tue, 5 Dec 2023 14:14:33 -0800 Subject: [PATCH 048/118] Remove coverage directory debug step --- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 9 +++------ .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 9 +++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 8c9aa8b71..80b476d07 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -4,9 +4,9 @@ on: push: pull_request: branches: [ release, development ] - paths: - - '**.cs' - - '**.csproj' + # paths: + # - '**.cs' + # - '**.csproj' env: DOTNET_VERSION: '8.0.100' # The .NET SDK version to use @@ -85,9 +85,6 @@ jobs: - name: Debug Test Results Output run: ls ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} && ls ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/** - - - name: Generated HTML Coverage Report - run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} - name: Upload Certify.Core.Tests.Unit Test Results and Coverage uses: actions/upload-artifact@master diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index ed2440903..bfea79364 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -4,9 +4,9 @@ on: push: pull_request: branches: [ release, development ] - paths: - - '**.cs' - - '**.csproj' + # paths: + # - '**.cs' + # - '**.csproj' env: DOTNET_VERSION: '8.0.100' # The .NET SDK version to use @@ -86,9 +86,6 @@ jobs: run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ matrix.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - - name: Debug Test Results Output - run: dir ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} && dir ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/**/ - - name: Generated HTML Coverage Report run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} From 248a096c3cafe2e458eca3f92999f0eb1fc34295 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Tue, 5 Dec 2023 14:22:25 -0800 Subject: [PATCH 049/118] Remove coverage directory debug step on Linux --- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 80b476d07..38a18e732 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -83,8 +83,8 @@ jobs: run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ matrix.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - - name: Debug Test Results Output - run: ls ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} && ls ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/** + - name: Generated HTML Coverage Report + run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} - name: Upload Certify.Core.Tests.Unit Test Results and Coverage uses: actions/upload-artifact@master From 40f82da239261c5e3351b6db3b8bea3c6e670748 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Tue, 5 Dec 2023 15:29:24 -0800 Subject: [PATCH 050/118] Tweaks to fix PR GitHub Actions Test jobs for Certify --- .../workflows/4_6_2_Core_Unit_Tests_Win.yaml | 62 ++++++++++++------- .../workflows/8_0_Core_Unit_Tests_Linux.yaml | 34 +++++----- .../workflows/8_0_Core_Unit_Tests_Win.yaml | 34 +++++----- 3 files changed, 70 insertions(+), 60 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index 9e46f0298..7b6e7d12d 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -4,9 +4,9 @@ on: push: pull_request: branches: [ release, development ] - paths: - - '**.cs' - - '**.csproj' + # paths: + # - '**.cs' + # - '**.csproj' env: DOTNET_VERSION: '8.0.100' # The .NET SDK version to use @@ -15,12 +15,8 @@ jobs: build-and-test: # TODO: Re-enable once we determine the cause of the .NET Framework 4.6.2 tests stalling (test runner doesn't quit when done') if: ${{ ! always() }} - name: build-and-test-${{matrix.os}} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-latest] - + name: build-and-test-${{ runner.os }} + runs-on: windows-latest steps: - name: Clone webprofusion/certify uses: actions/checkout@master @@ -34,28 +30,28 @@ jobs: ref: refs/heads/main path: ./libs/anvil - - name: Clone webprofusion/certify-plugins (development) - if: ${{ contains(github.ref_name, '_dev') }} + - name: Clone webprofusion/certify-plugins (development branch push) + if: ${{ github.event_name == "push" && contains(github.ref_name, '_dev') }} uses: actions/checkout@master with: repository: webprofusion/certify-plugins ref: refs/heads/development path: ./certify-plugins - - name: Clone webprofusion/certify-plugins (release) - if: ${{ contains(github.ref_name, '_rel') }} + - name: Clone webprofusion/certify-plugins (release branch push) + if: ${{ github.event_name == "push" && contains(github.ref_name, '_rel') }} uses: actions/checkout@master with: repository: webprofusion/certify-plugins ref: refs/heads/release path: ./certify-plugins - - name: Clone webprofusion/certify-plugins (development default) - if: ${{ ! contains(github.ref_name, '_rel') && ! contains(github.ref_name, '_dev') }} + - name: Clone webprofusion/certify-plugins (pull request) + if: ${{ github.event_name == "pull_request" }} uses: actions/checkout@master with: repository: webprofusion/certify-plugins - ref: refs/heads/release + ref: ${{ github.base_ref }} path: ./certify-plugins - name: Setup .NET Core @@ -69,9 +65,6 @@ jobs: - name: Add Step CLI to PATH run: echo "C:\Program Files\step_0.24.4\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - name: Validate Step CLI Install - run: dir "C:\Program Files\step_0.24.4" && [Environment]::GetEnvironmentVariable("Path") -split ";" && [Environment]::GetEnvironmentVariable("GITHUB_PATH") -split ";" - - name: Pull step-ca Docker Image run: docker pull jrnelson90/step-ca-win @@ -79,18 +72,43 @@ jobs: run: dotnet restore working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit + - name: Install ReportGenerator Coverage Tool + run: dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 + - name: Build Certify.Core.Tests.Unit run: dotnet build -c Debug --no-restore -f net462 working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Run Certify.Core.Tests.Unit Tests - run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net462 --logger trx --results-directory "TestResults-4_6_2-${{ matrix.os }}" + run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net462 --logger trx --collect:"XPlat Code Coverage" --results-directory "TestResults-4_6_2-${{ runner.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462 + - name: Generated HTML Coverage Report + run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }} + - name: Upload Certify.Core.Tests.Unit Test Results uses: actions/upload-artifact@master with: - name: dotnet-results-4_6_2-${{ matrix.os }} - path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ matrix.os }} + name: dotnet-results-4_6_2-${{ runner.os }} + path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }} # Use always() to always run this step to publish test results when there are test failures if: ${{ always() }} + + # - name: Publish Test Results + # uses: EnricoMi/publish-unit-test-result-action/composite@v2 + # if: always() + # with: + # files: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/*.trx + + # - name: Code Coverage Report + # uses: irongut/CodeCoverageSummary@v1.3.0 + # with: + # filename: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/coverage.cobertura.xml + # badge: true + # fail_below_min: false + # format: markdown + # hide_branch_rate: false + # hide_complexity: false + # indicators: true + # output: both + # thresholds: '50 70' \ No newline at end of file diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 38a18e732..a803f6855 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -14,12 +14,8 @@ env: jobs: build-and-test: - name: build-and-test-${{matrix.os}} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest] - + name: build-and-test-${{ runner.os }} + runs-on: ubuntu-latest steps: - name: Clone webprofusion/certify uses: actions/checkout@master @@ -33,28 +29,28 @@ jobs: ref: refs/heads/main path: ./libs/anvil - - name: Clone webprofusion/certify-plugins (development) - if: ${{ contains(github.ref_name, '_dev') }} + - name: Clone webprofusion/certify-plugins (development branch push) + if: ${{ github.event_name == "push" && contains(github.ref_name, '_dev') }} uses: actions/checkout@master with: repository: webprofusion/certify-plugins ref: refs/heads/development path: ./certify-plugins - - name: Clone webprofusion/certify-plugins (release) - if: ${{ contains(github.ref_name, '_rel') }} + - name: Clone webprofusion/certify-plugins (release branch push) + if: ${{ github.event_name == "push" && contains(github.ref_name, '_rel') }} uses: actions/checkout@master with: repository: webprofusion/certify-plugins ref: refs/heads/release path: ./certify-plugins - - name: Clone webprofusion/certify-plugins (development default) - if: ${{ ! contains(github.ref_name, '_rel') && ! contains(github.ref_name, '_dev') }} + - name: Clone webprofusion/certify-plugins (pull request) + if: ${{ github.event_name == "pull_request" }} uses: actions/checkout@master with: repository: webprofusion/certify-plugins - ref: refs/heads/release + ref: ${{ github.base_ref }} path: ./certify-plugins - name: Setup .NET Core @@ -80,17 +76,17 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Run Certify.Core.Tests.Unit Tests - run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ matrix.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 + run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - name: Generated HTML Coverage Report - run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} + run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} - name: Upload Certify.Core.Tests.Unit Test Results and Coverage uses: actions/upload-artifact@master with: - name: dotnet-results-8_0-${{ matrix.os }} - path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} + name: dotnet-results-8_0-${{ runner.os }} + path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} # Use always() to always run this step to publish test results when there are test failures if: ${{ always() }} @@ -98,12 +94,12 @@ jobs: # uses: EnricoMi/publish-unit-test-result-action@v2 # if: always() # with: - # files: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/*.trx + # files: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx # - name: Code Coverage Report # uses: irongut/CodeCoverageSummary@v1.3.0 # with: - # filename: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/coverage.cobertura.xml + # filename: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/coverage.cobertura.xml # badge: true # fail_below_min: false # format: markdown diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index bfea79364..6dedb2097 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -14,12 +14,8 @@ env: jobs: build-and-test: - name: build-and-test-${{matrix.os}} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-latest] - + name: build-and-test-${{ runner.os }} + runs-on: windows-latest steps: - name: Clone webprofusion/certify uses: actions/checkout@master @@ -33,28 +29,28 @@ jobs: ref: refs/heads/main path: ./libs/anvil - - name: Clone webprofusion/certify-plugins (development) - if: ${{ contains(github.ref_name, '_dev') }} + - name: Clone webprofusion/certify-plugins (development branch push) + if: ${{ github.event_name == "push" && contains(github.ref_name, '_dev') }} uses: actions/checkout@master with: repository: webprofusion/certify-plugins ref: refs/heads/development path: ./certify-plugins - - name: Clone webprofusion/certify-plugins (release) - if: ${{ contains(github.ref_name, '_rel') }} + - name: Clone webprofusion/certify-plugins (release branch push) + if: ${{ github.event_name == "push" && contains(github.ref_name, '_rel') }} uses: actions/checkout@master with: repository: webprofusion/certify-plugins ref: refs/heads/release path: ./certify-plugins - - name: Clone webprofusion/certify-plugins (development default) - if: ${{ ! contains(github.ref_name, '_rel') && ! contains(github.ref_name, '_dev') }} + - name: Clone webprofusion/certify-plugins (pull request) + if: ${{ github.event_name == "pull_request" }} uses: actions/checkout@master with: repository: webprofusion/certify-plugins - ref: refs/heads/release + ref: ${{ github.base_ref }} path: ./certify-plugins - name: Setup .NET Core @@ -83,17 +79,17 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Run Certify.Core.Tests.Unit Tests - run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ matrix.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 + run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - name: Generated HTML Coverage Report - run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} + run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} - name: Upload Certify.Core.Tests.Unit Test Results and Coverage uses: actions/upload-artifact@master with: - name: dotnet-results-8_0-${{ matrix.os }} - path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }} + name: dotnet-results-8_0-${{ runner.os }} + path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} # Use always() to always run this step to publish test results when there are test failures if: ${{ always() }} @@ -101,12 +97,12 @@ jobs: # uses: EnricoMi/publish-unit-test-result-action/composite@v2 # if: always() # with: - # files: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/*.trx + # files: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx # - name: Code Coverage Report # uses: irongut/CodeCoverageSummary@v1.3.0 # with: - # filename: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ matrix.os }}/coverage.cobertura.xml + # filename: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/coverage.cobertura.xml # badge: true # fail_below_min: false # format: markdown From 4c4e415b64c7ad9e4b2e62a36d119c72daeab2e8 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Tue, 5 Dec 2023 15:43:48 -0800 Subject: [PATCH 051/118] More tweaks to fix PR GitHub Actions Test jobs for Certify --- .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml | 8 ++++---- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 8 ++++---- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index 7b6e7d12d..1ad597df9 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -15,7 +15,7 @@ jobs: build-and-test: # TODO: Re-enable once we determine the cause of the .NET Framework 4.6.2 tests stalling (test runner doesn't quit when done') if: ${{ ! always() }} - name: build-and-test-${{ runner.os }} + name: build-and-test-windows runs-on: windows-latest steps: - name: Clone webprofusion/certify @@ -31,7 +31,7 @@ jobs: path: ./libs/anvil - name: Clone webprofusion/certify-plugins (development branch push) - if: ${{ github.event_name == "push" && contains(github.ref_name, '_dev') }} + if: ${{ github.event_name == 'push' && contains(github.ref_name, '_dev') }} uses: actions/checkout@master with: repository: webprofusion/certify-plugins @@ -39,7 +39,7 @@ jobs: path: ./certify-plugins - name: Clone webprofusion/certify-plugins (release branch push) - if: ${{ github.event_name == "push" && contains(github.ref_name, '_rel') }} + if: ${{ github.event_name == 'push' && contains(github.ref_name, '_rel') }} uses: actions/checkout@master with: repository: webprofusion/certify-plugins @@ -47,7 +47,7 @@ jobs: path: ./certify-plugins - name: Clone webprofusion/certify-plugins (pull request) - if: ${{ github.event_name == "pull_request" }} + if: ${{ github.event_name == 'pull_request' }} uses: actions/checkout@master with: repository: webprofusion/certify-plugins diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index a803f6855..14d1266dd 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -14,7 +14,7 @@ env: jobs: build-and-test: - name: build-and-test-${{ runner.os }} + name: build-and-test-linux runs-on: ubuntu-latest steps: - name: Clone webprofusion/certify @@ -30,7 +30,7 @@ jobs: path: ./libs/anvil - name: Clone webprofusion/certify-plugins (development branch push) - if: ${{ github.event_name == "push" && contains(github.ref_name, '_dev') }} + if: ${{ github.event_name == 'push' && contains(github.ref_name, '_dev') }} uses: actions/checkout@master with: repository: webprofusion/certify-plugins @@ -38,7 +38,7 @@ jobs: path: ./certify-plugins - name: Clone webprofusion/certify-plugins (release branch push) - if: ${{ github.event_name == "push" && contains(github.ref_name, '_rel') }} + if: ${{ github.event_name == 'push' && contains(github.ref_name, '_rel') }} uses: actions/checkout@master with: repository: webprofusion/certify-plugins @@ -46,7 +46,7 @@ jobs: path: ./certify-plugins - name: Clone webprofusion/certify-plugins (pull request) - if: ${{ github.event_name == "pull_request" }} + if: ${{ github.event_name == 'pull_request' }} uses: actions/checkout@master with: repository: webprofusion/certify-plugins diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 6dedb2097..7642faabc 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -14,7 +14,7 @@ env: jobs: build-and-test: - name: build-and-test-${{ runner.os }} + name: build-and-test-windows runs-on: windows-latest steps: - name: Clone webprofusion/certify @@ -30,7 +30,7 @@ jobs: path: ./libs/anvil - name: Clone webprofusion/certify-plugins (development branch push) - if: ${{ github.event_name == "push" && contains(github.ref_name, '_dev') }} + if: ${{ github.event_name == 'push' && contains(github.ref_name, '_dev') }} uses: actions/checkout@master with: repository: webprofusion/certify-plugins @@ -38,7 +38,7 @@ jobs: path: ./certify-plugins - name: Clone webprofusion/certify-plugins (release branch push) - if: ${{ github.event_name == "push" && contains(github.ref_name, '_rel') }} + if: ${{ github.event_name == 'push' && contains(github.ref_name, '_rel') }} uses: actions/checkout@master with: repository: webprofusion/certify-plugins @@ -46,7 +46,7 @@ jobs: path: ./certify-plugins - name: Clone webprofusion/certify-plugins (pull request) - if: ${{ github.event_name == "pull_request" }} + if: ${{ github.event_name == 'pull_request' }} uses: actions/checkout@master with: repository: webprofusion/certify-plugins From 8a3446c053239f4c7ad9048a8e4257b7d061fbdb Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Tue, 5 Dec 2023 16:43:54 -0800 Subject: [PATCH 052/118] Edit to generate HTML Test Results Artifact --- .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml | 14 +++++++++----- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 8 ++++++-- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 8 ++++++-- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index 1ad597df9..f1a2b8655 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -68,13 +68,17 @@ jobs: - name: Pull step-ca Docker Image run: docker pull jrnelson90/step-ca-win + - name: Install ReportGenerator Coverage Tool + run: dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 + + - name: Install TrxToHtml Tool + run: dotnet tool install -g Samhammer.TrxToHtml + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit + - name: Install Dependencies run: dotnet restore working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - - name: Install ReportGenerator Coverage Tool - run: dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 - - name: Build Certify.Core.Tests.Unit run: dotnet build -c Debug --no-restore -f net462 working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit @@ -83,8 +87,8 @@ jobs: run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net462 --logger trx --collect:"XPlat Code Coverage" --results-directory "TestResults-4_6_2-${{ runner.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462 - - name: Generated HTML Coverage Report - run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }} + - name: Generated HTML Reports + run: trx-to-html && reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }} - name: Upload Certify.Core.Tests.Unit Test Results uses: actions/upload-artifact@master diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 14d1266dd..e15d7636b 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -67,6 +67,10 @@ jobs: - name: Install ReportGenerator Coverage Tool run: dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 + - name: Install TrxToHtml Tool + run: dotnet tool install -g Samhammer.TrxToHtml + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit + - name: Install Dependencies run: dotnet restore working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit @@ -79,8 +83,8 @@ jobs: run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - - name: Generated HTML Coverage Report - run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} + - name: Generated HTML Reports + run: trx-to-html && reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} - name: Upload Certify.Core.Tests.Unit Test Results and Coverage uses: actions/upload-artifact@master diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 7642faabc..a8940abb4 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -70,6 +70,10 @@ jobs: - name: Install ReportGenerator Coverage Tool run: dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 + - name: Install TrxToHtml Tool + run: dotnet tool install -g Samhammer.TrxToHtml + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit + - name: Install Dependencies run: dotnet restore working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit @@ -82,8 +86,8 @@ jobs: run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - - name: Generated HTML Coverage Report - run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} + - name: Generated HTML Reports + run: trx-to-html && reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} - name: Upload Certify.Core.Tests.Unit Test Results and Coverage uses: actions/upload-artifact@master From da825242e9d91a2478e5b771b9967f7703c5de75 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Tue, 5 Dec 2023 16:52:10 -0800 Subject: [PATCH 053/118] Add .NET Core 3.1.x to GitHub Actions for Trx-To-HTML Tool --- .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml | 4 +++- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 4 +++- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index f1a2b8655..e12180f77 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -57,7 +57,9 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@master with: - dotnet-version: ${{ env.DOTNET_VERSION }} + dotnet-version: | + 3.1.x + ${{ env.DOTNET_VERSION }} - name: Setup Step CLI run: "Invoke-WebRequest -Method 'GET' -uri 'https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.24.4/step_windows_0.24.4_amd64.zip' -Outfile 'C:\\temp\\step_windows_0.24.4_amd64.zip'; tar -oxzf C:\\temp\\step_windows_0.24.4_amd64.zip -C 'C:\\Program Files';" diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index e15d7636b..b30daf501 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -56,7 +56,9 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@master with: - dotnet-version: ${{ env.DOTNET_VERSION }} + dotnet-version: | + 3.1.x + ${{ env.DOTNET_VERSION }} - name: Setup Step CLI run: wget https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.23.0/step-cli_0.23.0_amd64.deb && sudo dpkg -i step-cli_0.23.0_amd64.deb diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index a8940abb4..92b4260f8 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -56,7 +56,9 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@master with: - dotnet-version: ${{ env.DOTNET_VERSION }} + dotnet-version: | + 3.1.x + ${{ env.DOTNET_VERSION }} - name: Setup Step CLI run: "Invoke-WebRequest -Method 'GET' -uri 'https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.24.4/step_windows_0.24.4_amd64.zip' -Outfile 'C:\\temp\\step_windows_0.24.4_amd64.zip'; tar -oxzf C:\\temp\\step_windows_0.24.4_amd64.zip -C 'C:\\Program Files';" From 5a376aff890d034ef1667cfc1b3085501d38821a Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Tue, 5 Dec 2023 17:02:46 -0800 Subject: [PATCH 054/118] Generate HTML Test Results report with built-in Logger --- .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml | 14 ++++---------- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 16 +++++----------- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 14 ++++---------- 3 files changed, 13 insertions(+), 31 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index e12180f77..c356e6bd6 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -57,9 +57,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@master with: - dotnet-version: | - 3.1.x - ${{ env.DOTNET_VERSION }} + dotnet-version: ${{ env.DOTNET_VERSION }} - name: Setup Step CLI run: "Invoke-WebRequest -Method 'GET' -uri 'https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.24.4/step_windows_0.24.4_amd64.zip' -Outfile 'C:\\temp\\step_windows_0.24.4_amd64.zip'; tar -oxzf C:\\temp\\step_windows_0.24.4_amd64.zip -C 'C:\\Program Files';" @@ -73,10 +71,6 @@ jobs: - name: Install ReportGenerator Coverage Tool run: dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 - - name: Install TrxToHtml Tool - run: dotnet tool install -g Samhammer.TrxToHtml - working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - - name: Install Dependencies run: dotnet restore working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit @@ -86,11 +80,11 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Run Certify.Core.Tests.Unit Tests - run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net462 --logger trx --collect:"XPlat Code Coverage" --results-directory "TestResults-4_6_2-${{ runner.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 + run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net462 --logger trx --logger html --collect:"XPlat Code Coverage" --results-directory "TestResults-4_6_2-${{ runner.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462 - - name: Generated HTML Reports - run: trx-to-html && reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }} + - name: Generated HTML Coverage Report + run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }} - name: Upload Certify.Core.Tests.Unit Test Results uses: actions/upload-artifact@master diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index b30daf501..c2b5d04a2 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -56,9 +56,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@master with: - dotnet-version: | - 3.1.x - ${{ env.DOTNET_VERSION }} + dotnet-version: ${{ env.DOTNET_VERSION }} - name: Setup Step CLI run: wget https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.23.0/step-cli_0.23.0_amd64.deb && sudo dpkg -i step-cli_0.23.0_amd64.deb @@ -67,11 +65,7 @@ jobs: run: docker pull smallstep/step-ca - name: Install ReportGenerator Coverage Tool - run: dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 - - - name: Install TrxToHtml Tool - run: dotnet tool install -g Samhammer.TrxToHtml - working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit + run: dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 - name: Install Dependencies run: dotnet restore @@ -82,11 +76,11 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Run Certify.Core.Tests.Unit Tests - run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 + run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --logger html --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - - name: Generated HTML Reports - run: trx-to-html && reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} + - name: Generated HTML Coverage Report + run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} - name: Upload Certify.Core.Tests.Unit Test Results and Coverage uses: actions/upload-artifact@master diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 92b4260f8..52b409a89 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -56,9 +56,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@master with: - dotnet-version: | - 3.1.x - ${{ env.DOTNET_VERSION }} + dotnet-version: ${{ env.DOTNET_VERSION }} - name: Setup Step CLI run: "Invoke-WebRequest -Method 'GET' -uri 'https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.24.4/step_windows_0.24.4_amd64.zip' -Outfile 'C:\\temp\\step_windows_0.24.4_amd64.zip'; tar -oxzf C:\\temp\\step_windows_0.24.4_amd64.zip -C 'C:\\Program Files';" @@ -72,10 +70,6 @@ jobs: - name: Install ReportGenerator Coverage Tool run: dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 - - name: Install TrxToHtml Tool - run: dotnet tool install -g Samhammer.TrxToHtml - working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - - name: Install Dependencies run: dotnet restore working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit @@ -85,11 +79,11 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Run Certify.Core.Tests.Unit Tests - run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 + run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --logger html --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - - name: Generated HTML Reports - run: trx-to-html && reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} + - name: Generated HTML Coverage Report + run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} - name: Upload Certify.Core.Tests.Unit Test Results and Coverage uses: actions/upload-artifact@master From 4f38cb1c087d19f757db7954b81c2bf44b288247 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Tue, 5 Dec 2023 17:57:47 -0800 Subject: [PATCH 055/118] Attempting to output CLI reports to Markdown in GITHUB_STEP_SUMMARY --- .../workflows/4_6_2_Core_Unit_Tests_Win.yaml | 25 +++++++++++-------- .../workflows/8_0_Core_Unit_Tests_Linux.yaml | 25 +++++++++++-------- .../workflows/8_0_Core_Unit_Tests_Win.yaml | 25 +++++++++++-------- 3 files changed, 42 insertions(+), 33 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index c356e6bd6..f3eb1a49f 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -68,8 +68,8 @@ jobs: - name: Pull step-ca Docker Image run: docker pull jrnelson90/step-ca-win - - name: Install ReportGenerator Coverage Tool - run: dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 + - name: Install Test Report Tools + run: dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 && dotnet tool install --global LiquidTestReports.Cli --version 1.4.3-beta - name: Install Dependencies run: dotnet restore @@ -83,16 +83,19 @@ jobs: run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net462 --logger trx --logger html --collect:"XPlat Code Coverage" --results-directory "TestResults-4_6_2-${{ runner.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462 - - name: Generated HTML Coverage Report - run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }} + - name: Generated Test Coverage Report + run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }} -reporttypes:MarkdownSummaryGithub && type ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/SummaryGithub.md > %GITHUB_STEP_SUMMARY% - - name: Upload Certify.Core.Tests.Unit Test Results - uses: actions/upload-artifact@master - with: - name: dotnet-results-4_6_2-${{ runner.os }} - path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }} - # Use always() to always run this step to publish test results when there are test failures - if: ${{ always() }} + - name: Generated Test Results Report + run: liquid --inputs ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/*.trx --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/test_results.md && type ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/test_results.md > %GITHUB_STEP_SUMMARY% + + # - name: Upload Certify.Core.Tests.Unit Test Results + # uses: actions/upload-artifact@master + # with: + # name: dotnet-results-4_6_2-${{ runner.os }} + # path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }} + # # Use always() to always run this step to publish test results when there are test failures + # if: ${{ always() }} # - name: Publish Test Results # uses: EnricoMi/publish-unit-test-result-action/composite@v2 diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index c2b5d04a2..5d29f860d 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -64,8 +64,8 @@ jobs: - name: Pull step-ca Docker Image run: docker pull smallstep/step-ca - - name: Install ReportGenerator Coverage Tool - run: dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 + - name: Install Test Report Tools + run: dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 && dotnet tool install --global LiquidTestReports.Cli --version 1.4.3-beta - name: Install Dependencies run: dotnet restore @@ -79,16 +79,19 @@ jobs: run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --logger html --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - - name: Generated HTML Coverage Report - run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} + - name: Generated Test Coverage Report + run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub && cat ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/SummaryGithub.md > $GITHUB_STEP_SUMMARY - - name: Upload Certify.Core.Tests.Unit Test Results and Coverage - uses: actions/upload-artifact@master - with: - name: dotnet-results-8_0-${{ runner.os }} - path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} - # Use always() to always run this step to publish test results when there are test failures - if: ${{ always() }} + - name: Generated Test Results Report + run: liquid --inputs ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md && cat ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md > $GITHUB_STEP_SUMMARY + + # - name: Upload Certify.Core.Tests.Unit Test Results and Coverage + # uses: actions/upload-artifact@master + # with: + # name: dotnet-results-8_0-${{ runner.os }} + # path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} + # # Use always() to always run this step to publish test results when there are test failures + # if: ${{ always() }} # - name: Publish Test Results # uses: EnricoMi/publish-unit-test-result-action@v2 diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 52b409a89..8c27e731d 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -67,8 +67,8 @@ jobs: - name: Pull step-ca Docker Image run: docker pull jrnelson90/step-ca-win - - name: Install ReportGenerator Coverage Tool - run: dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 + - name: Install Test Report Tools + run: dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 && dotnet tool install --global LiquidTestReports.Cli --version 1.4.3-beta - name: Install Dependencies run: dotnet restore @@ -82,16 +82,19 @@ jobs: run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --logger html --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - - name: Generated HTML Coverage Report - run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} + - name: Generated Test Coverage Report + run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub && type ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/SummaryGithub.md > %GITHUB_STEP_SUMMARY% - - name: Upload Certify.Core.Tests.Unit Test Results and Coverage - uses: actions/upload-artifact@master - with: - name: dotnet-results-8_0-${{ runner.os }} - path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} - # Use always() to always run this step to publish test results when there are test failures - if: ${{ always() }} + - name: Generated Test Results Report + run: liquid --inputs ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md && type ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md > %GITHUB_STEP_SUMMARY% + + # - name: Upload Certify.Core.Tests.Unit Test Results and Coverage + # uses: actions/upload-artifact@master + # with: + # name: dotnet-results-8_0-${{ runner.os }} + # path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} + # # Use always() to always run this step to publish test results when there are test failures + # if: ${{ always() }} # - name: Publish Test Results # uses: EnricoMi/publish-unit-test-result-action/composite@v2 From 97e20c2dd346da0e860641823de48e20e437322a Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Tue, 5 Dec 2023 18:06:39 -0800 Subject: [PATCH 056/118] Fix for generating Test Results Markdown --- .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml | 2 +- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 2 +- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index f3eb1a49f..2c8549d57 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -87,7 +87,7 @@ jobs: run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }} -reporttypes:MarkdownSummaryGithub && type ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/SummaryGithub.md > %GITHUB_STEP_SUMMARY% - name: Generated Test Results Report - run: liquid --inputs ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/*.trx --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/test_results.md && type ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/test_results.md > %GITHUB_STEP_SUMMARY% + run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/*.trx;Format=Trx"" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/test_results.md && type ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/test_results.md > %GITHUB_STEP_SUMMARY% # - name: Upload Certify.Core.Tests.Unit Test Results # uses: actions/upload-artifact@master diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 5d29f860d..073f64e9e 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -83,7 +83,7 @@ jobs: run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub && cat ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/SummaryGithub.md > $GITHUB_STEP_SUMMARY - name: Generated Test Results Report - run: liquid --inputs ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md && cat ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md > $GITHUB_STEP_SUMMARY + run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx;Format=Trx" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md && cat ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md > $GITHUB_STEP_SUMMARY # - name: Upload Certify.Core.Tests.Unit Test Results and Coverage # uses: actions/upload-artifact@master diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 8c27e731d..80c241a59 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -86,7 +86,7 @@ jobs: run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub && type ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/SummaryGithub.md > %GITHUB_STEP_SUMMARY% - name: Generated Test Results Report - run: liquid --inputs ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md && type ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md > %GITHUB_STEP_SUMMARY% + run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx;Format=Trx" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md && type ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md > %GITHUB_STEP_SUMMARY% # - name: Upload Certify.Core.Tests.Unit Test Results and Coverage # uses: actions/upload-artifact@master From 6bd2997a8f0f72293ec052243be61737c2b7b5f0 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Tue, 5 Dec 2023 18:16:58 -0800 Subject: [PATCH 057/118] Tweaks to generating Markdown reports for Windows Runners --- .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml | 4 ++-- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index 2c8549d57..4cca99159 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -84,10 +84,10 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462 - name: Generated Test Coverage Report - run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }} -reporttypes:MarkdownSummaryGithub && type ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/SummaryGithub.md > %GITHUB_STEP_SUMMARY% + run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }} -reporttypes:MarkdownSummaryGithub && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY - name: Generated Test Results Report - run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/*.trx;Format=Trx"" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/test_results.md && type ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/test_results.md > %GITHUB_STEP_SUMMARY% + run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/*.trx;Format=Trx"" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/test_results.md && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/test_results.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY # - name: Upload Certify.Core.Tests.Unit Test Results # uses: actions/upload-artifact@master diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 80c241a59..2d5fc515c 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -83,10 +83,10 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - name: Generated Test Coverage Report - run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub && type ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/SummaryGithub.md > %GITHUB_STEP_SUMMARY% + run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY - name: Generated Test Results Report - run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx;Format=Trx" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md && type ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md > %GITHUB_STEP_SUMMARY% + run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx;Format=Trx" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY # - name: Upload Certify.Core.Tests.Unit Test Results and Coverage # uses: actions/upload-artifact@master From d30b340e22c2827b7f1443e5423f3988c8eb1e15 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Tue, 5 Dec 2023 18:30:16 -0800 Subject: [PATCH 058/118] Change Markup Report Titles and Display Order --- .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml | 10 +++++----- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 8 ++++---- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index 4cca99159..04f16245c 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -83,12 +83,12 @@ jobs: run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net462 --logger trx --logger html --collect:"XPlat Code Coverage" --results-directory "TestResults-4_6_2-${{ runner.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462 - - name: Generated Test Coverage Report - run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }} -reporttypes:MarkdownSummaryGithub && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY - - name: Generated Test Results Report - run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/*.trx;Format=Trx"" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/test_results.md && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/test_results.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY - + run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/*.trx;Format=Trx"" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/test_results.md --title "Test Results" && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/test_results.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY + + - name: Generated Test Coverage Report + run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY + # - name: Upload Certify.Core.Tests.Unit Test Results # uses: actions/upload-artifact@master # with: diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 073f64e9e..d7678e251 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -79,12 +79,12 @@ jobs: run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --logger html --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - - name: Generated Test Coverage Report - run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub && cat ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/SummaryGithub.md > $GITHUB_STEP_SUMMARY - - name: Generated Test Results Report - run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx;Format=Trx" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md && cat ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md > $GITHUB_STEP_SUMMARY + run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx;Format=Trx" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md --title "Test Results" && cat ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md > $GITHUB_STEP_SUMMARY + - name: Generated Test Coverage Report + run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" && cat ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/SummaryGithub.md > $GITHUB_STEP_SUMMARY + # - name: Upload Certify.Core.Tests.Unit Test Results and Coverage # uses: actions/upload-artifact@master # with: diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 2d5fc515c..4ce4a14dc 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -82,12 +82,12 @@ jobs: run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --logger html --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - - name: Generated Test Coverage Report - run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY - - name: Generated Test Results Report - run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx;Format=Trx" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY + run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx;Format=Trx" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md --title "Test Results" && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY + - name: Generated Test Coverage Report + run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY + # - name: Upload Certify.Core.Tests.Unit Test Results and Coverage # uses: actions/upload-artifact@master # with: From 08b1e174054b088255e83d1507371ed87c33472f Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Tue, 5 Dec 2023 18:55:51 -0800 Subject: [PATCH 059/118] Add Folder parameter to Test Results Generation --- .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml | 2 +- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 2 +- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index 04f16245c..b0c2f3d0e 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -84,7 +84,7 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462 - name: Generated Test Results Report - run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/*.trx;Format=Trx"" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/test_results.md --title "Test Results" && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/test_results.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY + run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/*.trx;Folder=./certify/src/Certify.Tests/Certify.Core.Tests.Unit;Format=Trx"" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/test_results.md --title "Test Results" && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/test_results.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY - name: Generated Test Coverage Report run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index d7678e251..abb2c8bdd 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -80,7 +80,7 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - name: Generated Test Results Report - run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx;Format=Trx" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md --title "Test Results" && cat ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md > $GITHUB_STEP_SUMMARY + run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx;Folder=./certify/src/Certify.Tests/Certify.Core.Tests.Unit;Format=Trx" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md --title "Test Results" && cat ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md > $GITHUB_STEP_SUMMARY - name: Generated Test Coverage Report run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" && cat ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/SummaryGithub.md > $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 4ce4a14dc..aa8dac637 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -83,7 +83,7 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - name: Generated Test Results Report - run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx;Format=Trx" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md --title "Test Results" && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY + run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx;Folder=./certify/src/Certify.Tests/Certify.Core.Tests.Unit;Format=Trx" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md --title "Test Results" && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY - name: Generated Test Coverage Report run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY From 5e9c42400728985d969e9f63feabf41a1cc23c34 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Tue, 5 Dec 2023 19:14:24 -0800 Subject: [PATCH 060/118] Trying to suppress build warnings from being added to annotations --- .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml | 10 +++------- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 10 +++------- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 10 +++------- 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index b0c2f3d0e..ea69f4905 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -71,12 +71,8 @@ jobs: - name: Install Test Report Tools run: dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 && dotnet tool install --global LiquidTestReports.Cli --version 1.4.3-beta - - name: Install Dependencies - run: dotnet restore - working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - - - name: Build Certify.Core.Tests.Unit - run: dotnet build -c Debug --no-restore -f net462 + - name: Install Dependencies & Build Certify.Core.Tests.Unit + run: dotnet build -c Debug -f net462 --property WarningLevel=0 /clp:ErrorsOnly working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Run Certify.Core.Tests.Unit Tests @@ -84,7 +80,7 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462 - name: Generated Test Results Report - run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/*.trx;Folder=./certify/src/Certify.Tests/Certify.Core.Tests.Unit;Format=Trx"" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/test_results.md --title "Test Results" && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/test_results.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY + run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/*.trx;Format=Trx"" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/test_results.md --title "Test Results" && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/test_results.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY - name: Generated Test Coverage Report run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index abb2c8bdd..82285589e 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -67,12 +67,8 @@ jobs: - name: Install Test Report Tools run: dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 && dotnet tool install --global LiquidTestReports.Cli --version 1.4.3-beta - - name: Install Dependencies - run: dotnet restore - working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - - - name: Build Certify.Core.Tests.Unit - run: dotnet build -c Debug --no-restore -f net8.0 + - name: Install Dependencies & Build Certify.Core.Tests.Unit + run: dotnet build -c Debug -f net8.0 --property WarningLevel=0 /clp:ErrorsOnly working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Run Certify.Core.Tests.Unit Tests @@ -80,7 +76,7 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - name: Generated Test Results Report - run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx;Folder=./certify/src/Certify.Tests/Certify.Core.Tests.Unit;Format=Trx" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md --title "Test Results" && cat ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md > $GITHUB_STEP_SUMMARY + run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx;Format=Trx" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md --title "Test Results" && cat ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md > $GITHUB_STEP_SUMMARY - name: Generated Test Coverage Report run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" && cat ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/SummaryGithub.md > $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index aa8dac637..8d0c00d8b 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -70,12 +70,8 @@ jobs: - name: Install Test Report Tools run: dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 && dotnet tool install --global LiquidTestReports.Cli --version 1.4.3-beta - - name: Install Dependencies - run: dotnet restore - working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - - - name: Build Certify.Core.Tests.Unit - run: dotnet build -c Debug --no-restore -f net8.0 + - name: Install Dependencies & Build Certify.Core.Tests.Unit + run: dotnet build -c Debug -f net8.0 --property WarningLevel=0 /clp:ErrorsOnly working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Run Certify.Core.Tests.Unit Tests @@ -83,7 +79,7 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - name: Generated Test Results Report - run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx;Folder=./certify/src/Certify.Tests/Certify.Core.Tests.Unit;Format=Trx" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md --title "Test Results" && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY + run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx;Format=Trx" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md --title "Test Results" && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY - name: Generated Test Coverage Report run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY From 4c561de86557d02634c7d341fb5876f23e0c07d6 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Wed, 6 Dec 2023 10:35:24 -0800 Subject: [PATCH 061/118] Trying out dorny/test-reporter action on Linux runner --- .../workflows/4_6_2_Core_Unit_Tests_Win.yaml | 29 ++--------- .../workflows/8_0_Core_Unit_Tests_Linux.yaml | 49 ++++++------------- .../workflows/8_0_Core_Unit_Tests_Win.yaml | 29 ++--------- 3 files changed, 25 insertions(+), 82 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index ea69f4905..7a167bfd9 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -4,9 +4,9 @@ on: push: pull_request: branches: [ release, development ] - # paths: - # - '**.cs' - # - '**.csproj' + paths: + - '**.cs' + - '**.csproj' env: DOTNET_VERSION: '8.0.100' # The .NET SDK version to use @@ -80,34 +80,15 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462 - name: Generated Test Results Report + if: success() || failure() # run this step even if previous step failed run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/*.trx;Format=Trx"" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/test_results.md --title "Test Results" && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/test_results.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY - name: Generated Test Coverage Report + if: success() || failure() # run this step even if previous step failed run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY - - # - name: Upload Certify.Core.Tests.Unit Test Results - # uses: actions/upload-artifact@master - # with: - # name: dotnet-results-4_6_2-${{ runner.os }} - # path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }} - # # Use always() to always run this step to publish test results when there are test failures - # if: ${{ always() }} # - name: Publish Test Results # uses: EnricoMi/publish-unit-test-result-action/composite@v2 # if: always() # with: # files: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/*.trx - - # - name: Code Coverage Report - # uses: irongut/CodeCoverageSummary@v1.3.0 - # with: - # filename: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/coverage.cobertura.xml - # badge: true - # fail_below_min: false - # format: markdown - # hide_branch_rate: false - # hide_complexity: false - # indicators: true - # output: both - # thresholds: '50 70' \ No newline at end of file diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 82285589e..681f534da 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -4,9 +4,9 @@ on: push: pull_request: branches: [ release, development ] - # paths: - # - '**.cs' - # - '**.csproj' + paths: + - '**.cs' + - '**.csproj' env: DOTNET_VERSION: '8.0.100' # The .NET SDK version to use @@ -76,41 +76,22 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - name: Generated Test Results Report - run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx;Format=Trx" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md --title "Test Results" && cat ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md > $GITHUB_STEP_SUMMARY - + # if: success() || failure() # run this step even if previous step failed + # run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx;Format=Trx" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md --title "Test Results" && cat ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md > $GITHUB_STEP_SUMMARY + uses: dorny/test-reporter@master + if: success() || failure() # run this step even if previous step failed + with: + name: Test Results # Name of the check run which will be created + path: ./src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx # Path to test results + reporter: dotnet-trx # Format of test results + working-directory: ./certify + - name: Generated Test Coverage Report + if: success() || failure() # run this step even if previous step failed run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" && cat ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/SummaryGithub.md > $GITHUB_STEP_SUMMARY - # - name: Upload Certify.Core.Tests.Unit Test Results and Coverage - # uses: actions/upload-artifact@master - # with: - # name: dotnet-results-8_0-${{ runner.os }} - # path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} - # # Use always() to always run this step to publish test results when there are test failures - # if: ${{ always() }} - # - name: Publish Test Results - # uses: EnricoMi/publish-unit-test-result-action@v2 + # uses: EnricoMi/publish-unit-test-result-action@master # if: always() # with: # files: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx - - # - name: Code Coverage Report - # uses: irongut/CodeCoverageSummary@v1.3.0 - # with: - # filename: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/coverage.cobertura.xml - # badge: true - # fail_below_min: false - # format: markdown - # hide_branch_rate: false - # hide_complexity: false - # indicators: true - # output: both - # thresholds: '50 70' - - # - name: Add Coverage PR Comment - # uses: marocchino/sticky-pull-request-comment@v2.8.0 - # if: github.event_name == 'pull_request' - # with: - # recreate: true - # path: code-coverage-results.md diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 8d0c00d8b..6af97a835 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -4,9 +4,9 @@ on: push: pull_request: branches: [ release, development ] - # paths: - # - '**.cs' - # - '**.csproj' + paths: + - '**.cs' + - '**.csproj' env: DOTNET_VERSION: '8.0.100' # The .NET SDK version to use @@ -79,34 +79,15 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - name: Generated Test Results Report + if: success() || failure() # run this step even if previous step failed run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx;Format=Trx" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md --title "Test Results" && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY - name: Generated Test Coverage Report + if: success() || failure() # run this step even if previous step failed run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY - # - name: Upload Certify.Core.Tests.Unit Test Results and Coverage - # uses: actions/upload-artifact@master - # with: - # name: dotnet-results-8_0-${{ runner.os }} - # path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} - # # Use always() to always run this step to publish test results when there are test failures - # if: ${{ always() }} - # - name: Publish Test Results # uses: EnricoMi/publish-unit-test-result-action/composite@v2 # if: always() # with: # files: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx - - # - name: Code Coverage Report - # uses: irongut/CodeCoverageSummary@v1.3.0 - # with: - # filename: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/coverage.cobertura.xml - # badge: true - # fail_below_min: false - # format: markdown - # hide_branch_rate: false - # hide_complexity: false - # indicators: true - # output: both - # thresholds: '50 70' \ No newline at end of file From 97d44830e8e2c57e346de3715fa9d97a6f7f9dbe Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Wed, 6 Dec 2023 10:47:36 -0800 Subject: [PATCH 062/118] Fix to dorny/test-reporter step for Linux GitHub Actions runner --- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 681f534da..83335d229 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -78,20 +78,21 @@ jobs: - name: Generated Test Results Report # if: success() || failure() # run this step even if previous step failed # run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx;Format=Trx" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md --title "Test Results" && cat ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md > $GITHUB_STEP_SUMMARY - uses: dorny/test-reporter@master + uses: dorny/test-reporter@v1 if: success() || failure() # run this step even if previous step failed with: name: Test Results # Name of the check run which will be created path: ./src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx # Path to test results reporter: dotnet-trx # Format of test results working-directory: ./certify + max-annotations: '50' - name: Generated Test Coverage Report if: success() || failure() # run this step even if previous step failed run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" && cat ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/SummaryGithub.md > $GITHUB_STEP_SUMMARY # - name: Publish Test Results - # uses: EnricoMi/publish-unit-test-result-action@master + # uses: EnricoMi/publish-unit-test-result-action@v2 # if: always() # with: # files: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx From 868d9323c21d8c0201e8eae5db47b5f1a6c868c8 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Wed, 6 Dec 2023 11:33:13 -0800 Subject: [PATCH 063/118] Trying out Tyrrrz/GitHubActionsTestLogger on Linux Runner --- .../workflows/8_0_Core_Unit_Tests_Linux.yaml | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 83335d229..ee0db385d 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -68,24 +68,25 @@ jobs: run: dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 && dotnet tool install --global LiquidTestReports.Cli --version 1.4.3-beta - name: Install Dependencies & Build Certify.Core.Tests.Unit - run: dotnet build -c Debug -f net8.0 --property WarningLevel=0 /clp:ErrorsOnly + run: dotnet build -c Debug -f net8.0 --property WarningLevel=0 /clp:ErrorsOnly && dotnet add package GitHubActionsTestLogger working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Run Certify.Core.Tests.Unit Tests - run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --logger html --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 + run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 -s test.runsettings -- RunConfiguration.CollectSourceInformation=true working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - - name: Generated Test Results Report - # if: success() || failure() # run this step even if previous step failed + # - name: Generated Test Results Report + # if: success() || failure() # run this step even if previous step failed # run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx;Format=Trx" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md --title "Test Results" && cat ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md > $GITHUB_STEP_SUMMARY - uses: dorny/test-reporter@v1 - if: success() || failure() # run this step even if previous step failed - with: - name: Test Results # Name of the check run which will be created - path: ./src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx # Path to test results - reporter: dotnet-trx # Format of test results - working-directory: ./certify - max-annotations: '50' + + # uses: dorny/test-reporter@v1 + # if: success() || failure() # run this step even if previous step failed + # with: + # name: Test Results # Name of the check run which will be created + # path: ./src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx # Path to test results + # reporter: dotnet-trx # Format of test results + # working-directory: ./certify + # max-annotations: '50' - name: Generated Test Coverage Report if: success() || failure() # run this step even if previous step failed From 1bf11d64b2358219c71e829c3c3886291c277a42 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Wed, 6 Dec 2023 11:36:19 -0800 Subject: [PATCH 064/118] Fix for trying out Tyrrrz/GitHubActionsTestLogger on Linux Runner --- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index ee0db385d..e085a42e1 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -72,7 +72,7 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Run Certify.Core.Tests.Unit Tests - run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 -s test.runsettings -- RunConfiguration.CollectSourceInformation=true + run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 -- RunConfiguration.CollectSourceInformation=true working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 # - name: Generated Test Results Report From 137876f58f18a2782ad89a4c2664d94a8c512e95 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Wed, 6 Dec 2023 11:41:34 -0800 Subject: [PATCH 065/118] Another Fix for Tyrrrz/GitHubActionsTestLogger on Linux Runner --- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index e085a42e1..4b9e13187 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -68,7 +68,7 @@ jobs: run: dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 && dotnet tool install --global LiquidTestReports.Cli --version 1.4.3-beta - name: Install Dependencies & Build Certify.Core.Tests.Unit - run: dotnet build -c Debug -f net8.0 --property WarningLevel=0 /clp:ErrorsOnly && dotnet add package GitHubActionsTestLogger + run: dotnet add package GitHubActionsTestLogger && dotnet build -c Debug -f net8.0 --property WarningLevel=0 /clp:ErrorsOnly working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Run Certify.Core.Tests.Unit Tests From 0d586b49c8e3a21b297714e18c8a3a43046ec15a Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Wed, 6 Dec 2023 12:10:07 -0800 Subject: [PATCH 066/118] Debug GITHUB_WORKSPACE value for Tyrrrz/GitHubActionsTestLogger --- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 4b9e13187..3b7123bba 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -72,7 +72,7 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Run Certify.Core.Tests.Unit Tests - run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 -- RunConfiguration.CollectSourceInformation=true + run: echo "GITHUB_WORKSPACE = $GITHUB_WORKSPACE" && dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 -- RunConfiguration.CollectSourceInformation=true working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 # - name: Generated Test Results Report From 6e041faaafcdde4f779096d94f5071898274965c Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Wed, 6 Dec 2023 13:14:17 -0800 Subject: [PATCH 067/118] Debug Tyrrrz/GitHubActionsTestLogger source link generation --- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 3b7123bba..fd49bbdff 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -70,9 +70,9 @@ jobs: - name: Install Dependencies & Build Certify.Core.Tests.Unit run: dotnet add package GitHubActionsTestLogger && dotnet build -c Debug -f net8.0 --property WarningLevel=0 /clp:ErrorsOnly working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - + - name: Run Certify.Core.Tests.Unit Tests - run: echo "GITHUB_WORKSPACE = $GITHUB_WORKSPACE" && dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 -- RunConfiguration.CollectSourceInformation=true + run: echo "/home/runner/work/certify/certify/certify" > $GITHUB_WORKSPACE && echo GITHUB_WORKSPACE = $GITHUB_WORKSPACE && dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 -- RunConfiguration.CollectSourceInformation=true working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 # - name: Generated Test Results Report @@ -90,7 +90,7 @@ jobs: - name: Generated Test Coverage Report if: success() || failure() # run this step even if previous step failed - run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" && cat ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/SummaryGithub.md > $GITHUB_STEP_SUMMARY + run: echo "GITHUB_WORKSPACE = $GITHUB_WORKSPACE" && reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" && cat ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/SummaryGithub.md > $GITHUB_STEP_SUMMARY # - name: Publish Test Results # uses: EnricoMi/publish-unit-test-result-action@v2 From 3e7bb45e85273b9d53c192632a7205650f401651 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Wed, 6 Dec 2023 13:27:49 -0800 Subject: [PATCH 068/118] More debugging Tyrrrz/GitHubActionsTestLogger source link generation --- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index fd49bbdff..f80569e8d 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -72,7 +72,7 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Run Certify.Core.Tests.Unit Tests - run: echo "/home/runner/work/certify/certify/certify" > $GITHUB_WORKSPACE && echo GITHUB_WORKSPACE = $GITHUB_WORKSPACE && dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 -- RunConfiguration.CollectSourceInformation=true + run: echo GITHUB_WORKSPACE = $GITHUB_WORKSPACE && "/home/runner/work/certify/certify/certify" > $GITHUB_WORKSPACE && echo GITHUB_WORKSPACE = $GITHUB_WORKSPACE && dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 -- RunConfiguration.CollectSourceInformation=true working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 # - name: Generated Test Results Report From 273565b32b54042d5067fdaa593f73e3877b993a Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Wed, 6 Dec 2023 13:31:40 -0800 Subject: [PATCH 069/118] More debugging Tyrrrz/GitHubActionsTestLogger source link generation --- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index f80569e8d..fa5e52d49 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -72,7 +72,7 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Run Certify.Core.Tests.Unit Tests - run: echo GITHUB_WORKSPACE = $GITHUB_WORKSPACE && "/home/runner/work/certify/certify/certify" > $GITHUB_WORKSPACE && echo GITHUB_WORKSPACE = $GITHUB_WORKSPACE && dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 -- RunConfiguration.CollectSourceInformation=true + run: echo GITHUB_WORKSPACE = $GITHUB_WORKSPACE && export GITHUB_WORKSPACE="/home/runner/work/certify/certify/certify" && echo GITHUB_WORKSPACE = $GITHUB_WORKSPACE && dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 -- RunConfiguration.CollectSourceInformation=true working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 # - name: Generated Test Results Report From fd04f6f7761f2797cf48d611273399fffc0b79f4 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Wed, 6 Dec 2023 14:37:51 -0800 Subject: [PATCH 070/118] Cleanup GitHub Action Workflow YAML for .NET Core 8.0 on Windows & Linux --- .../workflows/8_0_Core_Unit_Tests_Linux.yaml | 42 +++++++------------ .../workflows/8_0_Core_Unit_Tests_Win.yaml | 37 +++++++--------- 2 files changed, 31 insertions(+), 48 deletions(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index fa5e52d49..d9f3c7b80 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -59,41 +59,29 @@ jobs: dotnet-version: ${{ env.DOTNET_VERSION }} - name: Setup Step CLI - run: wget https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.23.0/step-cli_0.23.0_amd64.deb && sudo dpkg -i step-cli_0.23.0_amd64.deb + run: | + wget https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.23.0/step-cli_0.23.0_amd64.deb + sudo dpkg -i step-cli_0.23.0_amd64.deb - name: Pull step-ca Docker Image run: docker pull smallstep/step-ca - - name: Install Test Report Tools - run: dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 && dotnet tool install --global LiquidTestReports.Cli --version 1.4.3-beta - - name: Install Dependencies & Build Certify.Core.Tests.Unit - run: dotnet add package GitHubActionsTestLogger && dotnet build -c Debug -f net8.0 --property WarningLevel=0 /clp:ErrorsOnly + run: | + dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 + dotnet add package GitHubActionsTestLogger + dotnet build -c Debug -f net8.0 --property WarningLevel=0 /clp:ErrorsOnly working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Run Certify.Core.Tests.Unit Tests - run: echo GITHUB_WORKSPACE = $GITHUB_WORKSPACE && export GITHUB_WORKSPACE="/home/runner/work/certify/certify/certify" && echo GITHUB_WORKSPACE = $GITHUB_WORKSPACE && dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 -- RunConfiguration.CollectSourceInformation=true + run: | + export GITHUB_WORKSPACE="$GITHUB_WORKSPACE/certify" + echo "# Test Results\n\n" > $GITHUB_STEP_SUMMARY + dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 -- RunConfiguration.CollectSourceInformation=true working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - # - name: Generated Test Results Report - # if: success() || failure() # run this step even if previous step failed - # run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx;Format=Trx" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md --title "Test Results" && cat ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md > $GITHUB_STEP_SUMMARY - - # uses: dorny/test-reporter@v1 - # if: success() || failure() # run this step even if previous step failed - # with: - # name: Test Results # Name of the check run which will be created - # path: ./src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx # Path to test results - # reporter: dotnet-trx # Format of test results - # working-directory: ./certify - # max-annotations: '50' - - name: Generated Test Coverage Report - if: success() || failure() # run this step even if previous step failed - run: echo "GITHUB_WORKSPACE = $GITHUB_WORKSPACE" && reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" && cat ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/SummaryGithub.md > $GITHUB_STEP_SUMMARY - - # - name: Publish Test Results - # uses: EnricoMi/publish-unit-test-result-action@v2 - # if: always() - # with: - # files: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx + run: | + reportgenerator -reports:./TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" + cat ./TestResults-8_0-${{ runner.os }}/SummaryGithub.md > $GITHUB_STEP_SUMMARY + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 6af97a835..e179e9f63 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -59,35 +59,30 @@ jobs: dotnet-version: ${{ env.DOTNET_VERSION }} - name: Setup Step CLI - run: "Invoke-WebRequest -Method 'GET' -uri 'https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.24.4/step_windows_0.24.4_amd64.zip' -Outfile 'C:\\temp\\step_windows_0.24.4_amd64.zip'; tar -oxzf C:\\temp\\step_windows_0.24.4_amd64.zip -C 'C:\\Program Files';" - - - name: Add Step CLI to PATH - run: echo "C:\Program Files\step_0.24.4\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + run: | + Invoke-WebRequest -Method 'GET' -uri 'https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.24.4/step_windows_0.24.4_amd64.zip' -Outfile 'C:\temp\step_windows_0.24.4_amd64.zip' + tar -oxzf C:\temp\step_windows_0.24.4_amd64.zip -C "C:\Program Files" + echo "C:\Program Files\step_0.24.4\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Pull step-ca Docker Image run: docker pull jrnelson90/step-ca-win - - name: Install Test Report Tools - run: dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 && dotnet tool install --global LiquidTestReports.Cli --version 1.4.3-beta - - name: Install Dependencies & Build Certify.Core.Tests.Unit - run: dotnet build -c Debug -f net8.0 --property WarningLevel=0 /clp:ErrorsOnly + run: | + dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 + dotnet add package GitHubActionsTestLogger + dotnet build -c Debug -f net8.0 --property WarningLevel=0 /clp:ErrorsOnly working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Run Certify.Core.Tests.Unit Tests - run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 --logger trx --logger html --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 + run: | + echo "\certify" | Out-File -FilePath $env:GITHUB_WORKSPACE -Encoding utf8 -Append + echo "# Test Results\n\n" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 + dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 -- RunConfiguration.CollectSourceInformation=true working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - - name: Generated Test Results Report - if: success() || failure() # run this step even if previous step failed - run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx;Format=Trx" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md --title "Test Results" && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/test_results.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY - - name: Generated Test Coverage Report - if: success() || failure() # run this step even if previous step failed - run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY - - # - name: Publish Test Results - # uses: EnricoMi/publish-unit-test-result-action/composite@v2 - # if: always() - # with: - # files: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }}/*.trx + run: | + reportgenerator -reports:./TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" + Get-Content -Path ./TestResults-4_6_2-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 From 7f50dd9bf5557ea9bd86f55b8306f05d0b969881 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Wed, 6 Dec 2023 14:53:52 -0800 Subject: [PATCH 071/118] Fix GitHub Action Workflow YAML for .NET Core 8.0 on Windows & Linux --- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 2 +- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index d9f3c7b80..3a3c4909c 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -76,7 +76,7 @@ jobs: - name: Run Certify.Core.Tests.Unit Tests run: | export GITHUB_WORKSPACE="$GITHUB_WORKSPACE/certify" - echo "# Test Results\n\n" > $GITHUB_STEP_SUMMARY + echo "# Test Results" > $GITHUB_STEP_SUMMARY dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 -- RunConfiguration.CollectSourceInformation=true working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index e179e9f63..566c5ba36 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -76,8 +76,8 @@ jobs: - name: Run Certify.Core.Tests.Unit Tests run: | - echo "\certify" | Out-File -FilePath $env:GITHUB_WORKSPACE -Encoding utf8 -Append - echo "# Test Results\n\n" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 + echo "D:\a\certify\certify\certify" | Out-File -FilePath $env:GITHUB_WORKSPACE -Encoding utf8 + echo "# Test Results" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 -- RunConfiguration.CollectSourceInformation=true working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 From 9d8d0b15a73ecf68a08d29c6ffa95b7667586010 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Wed, 6 Dec 2023 15:09:52 -0800 Subject: [PATCH 072/118] Tweak to GitHub Action Workflow YAML for .NET Core 8.0 on Windows --- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 566c5ba36..6ecb576c0 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -76,9 +76,12 @@ jobs: - name: Run Certify.Core.Tests.Unit Tests run: | - echo "D:\a\certify\certify\certify" | Out-File -FilePath $env:GITHUB_WORKSPACE -Encoding utf8 - echo "# Test Results" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 + # echo "D:\a\certify\certify\certify" | Out-File -FilePath $env:GITHUB_WORKSPACE -Encoding utf8 + $env:GITHUB_WORKSPACE="D:\a\certify\certify\certify" + $env:GITHUB_STEP_SUMMARY="./test-summary.md" + # echo "# Test Results" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 -- RunConfiguration.CollectSourceInformation=true + Get-Content -Path ./TestResults-4_6_2-${{ runner.os }}/test-summary.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - name: Generated Test Coverage Report From 59dfc076190f36216fe86076a42fbd2b8c80d19f Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Wed, 6 Dec 2023 15:29:08 -0800 Subject: [PATCH 073/118] Fix paths in dotnet test step for Windows .NET Core Action --- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 2 +- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 3a3c4909c..7a5b4b9ba 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -77,7 +77,7 @@ jobs: run: | export GITHUB_WORKSPACE="$GITHUB_WORKSPACE/certify" echo "# Test Results" > $GITHUB_STEP_SUMMARY - dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 -- RunConfiguration.CollectSourceInformation=true + dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 -- RunConfiguration.CollectSourceInformation=true working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - name: Generated Test Coverage Report diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 6ecb576c0..d2c7179b9 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -78,14 +78,14 @@ jobs: run: | # echo "D:\a\certify\certify\certify" | Out-File -FilePath $env:GITHUB_WORKSPACE -Encoding utf8 $env:GITHUB_WORKSPACE="D:\a\certify\certify\certify" - $env:GITHUB_STEP_SUMMARY="./test-summary.md" + $env:GITHUB_STEP_SUMMARY="./TestResults-8_0-${{ runner.os }}/test-summary.md" # echo "# Test Results" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 - dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 -- RunConfiguration.CollectSourceInformation=true - Get-Content -Path ./TestResults-4_6_2-${{ runner.os }}/test-summary.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY + dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 -- RunConfiguration.CollectSourceInformation=true + Get-Content -Path ./TestResults-8_0-${{ runner.os }}/test-summary.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - name: Generated Test Coverage Report run: | reportgenerator -reports:./TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" - Get-Content -Path ./TestResults-4_6_2-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY + Get-Content -Path ./TestResults-8_0-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 From 26845dd27b5e043b30c78fedc196ba56777b21d8 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Wed, 6 Dec 2023 15:46:02 -0800 Subject: [PATCH 074/118] Debug Windows .NET Core 8.0 Test Result Generation --- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index d2c7179b9..e865cce9d 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -76,12 +76,13 @@ jobs: - name: Run Certify.Core.Tests.Unit Tests run: | - # echo "D:\a\certify\certify\certify" | Out-File -FilePath $env:GITHUB_WORKSPACE -Encoding utf8 $env:GITHUB_WORKSPACE="D:\a\certify\certify\certify" - $env:GITHUB_STEP_SUMMARY="./TestResults-8_0-${{ runner.os }}/test-summary.md" - # echo "# Test Results" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 + $env:GITHUB_STEP_SUMMARY=".\TestResults-8_0-${{ runner.os }}\test-summary.md" dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 -- RunConfiguration.CollectSourceInformation=true - Get-Content -Path ./TestResults-8_0-${{ runner.os }}/test-summary.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY + dir .\TestResults-8_0-${{ runner.os }} + dir . + echo "# Test Results" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 -Encoding utf8 -Append + Get-Content -Path .\TestResults-8_0-${{ runner.os }}\test-summary.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - name: Generated Test Coverage Report From 477fccac6788a00a82f75b5c8eceab9e75c13e2f Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Wed, 6 Dec 2023 16:01:49 -0800 Subject: [PATCH 075/118] Fix Windows .NET Core 8.0 Test Result Generation --- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index e865cce9d..d47417cc4 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -79,10 +79,8 @@ jobs: $env:GITHUB_WORKSPACE="D:\a\certify\certify\certify" $env:GITHUB_STEP_SUMMARY=".\TestResults-8_0-${{ runner.os }}\test-summary.md" dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 -- RunConfiguration.CollectSourceInformation=true - dir .\TestResults-8_0-${{ runner.os }} - dir . - echo "# Test Results" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 -Encoding utf8 -Append - Get-Content -Path .\TestResults-8_0-${{ runner.os }}\test-summary.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY + echo "# Test Results\n" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 + Get-Content -Path .\TestResults-8_0-${{ runner.os }}\test-summary.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 -Append working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - name: Generated Test Coverage Report From e71ab43665d6b54bde8cf0380250c1191a953e72 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Wed, 6 Dec 2023 16:22:45 -0800 Subject: [PATCH 076/118] Separate Test Run and Test Results step for Windows Runner .NET Core 8.0 --- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index d47417cc4..e4c8b0bee 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -79,6 +79,9 @@ jobs: $env:GITHUB_WORKSPACE="D:\a\certify\certify\certify" $env:GITHUB_STEP_SUMMARY=".\TestResults-8_0-${{ runner.os }}\test-summary.md" dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 -- RunConfiguration.CollectSourceInformation=true + + - name: Generate Test Results Report + run: | echo "# Test Results\n" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 Get-Content -Path .\TestResults-8_0-${{ runner.os }}\test-summary.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 -Append working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 From 41d4eb8308a6a07c08c79e848d3db5e752bed848 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Wed, 6 Dec 2023 16:29:38 -0800 Subject: [PATCH 077/118] Restore working directory info to Windows test run step --- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index e4c8b0bee..4449514a1 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -79,7 +79,8 @@ jobs: $env:GITHUB_WORKSPACE="D:\a\certify\certify\certify" $env:GITHUB_STEP_SUMMARY=".\TestResults-8_0-${{ runner.os }}\test-summary.md" dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 -- RunConfiguration.CollectSourceInformation=true - + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 + - name: Generate Test Results Report run: | echo "# Test Results\n" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 From 78886210f52e806a08a49cf132d39d26b5baec3c Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Wed, 6 Dec 2023 17:05:18 -0800 Subject: [PATCH 078/118] More YAML action updates for Linux and Windows .NET Core 8.0 runners --- .../workflows/8_0_Core_Unit_Tests_Linux.yaml | 18 +++++++++++++++++- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 14 ++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 7a5b4b9ba..fa6c7484c 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -76,12 +76,28 @@ jobs: - name: Run Certify.Core.Tests.Unit Tests run: | export GITHUB_WORKSPACE="$GITHUB_WORKSPACE/certify" - echo "# Test Results" > $GITHUB_STEP_SUMMARY + export GITHUB_STEP_SUMMARY="./TestResults-8_0-${{ runner.os }}/test-summary.md dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 -- RunConfiguration.CollectSourceInformation=true working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 + - name: Generate Test Results Report + run: | + echo "# Test Results" > $GITHUB_STEP_SUMMARY + cat ./TestResults-8_0-${{ runner.os }}/test-summary.md >> $GITHUB_STEP_SUMMARY + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 + if: ${{ always() }} + - name: Generated Test Coverage Report run: | reportgenerator -reports:./TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" cat ./TestResults-8_0-${{ runner.os }}/SummaryGithub.md > $GITHUB_STEP_SUMMARY working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 + if: ${{ always() }} + + - name: Upload dotnet test Artifacts + uses: actions/upload-artifact@master + with: + name: dotnet-results-${{ runner.os }}-${{ env.DOTNET_VERSION }} + path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} + # Use always() to always run this step to publish test results when there are test failures + if: ${{ always() }} diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 4449514a1..1c56ea2b8 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -76,19 +76,29 @@ jobs: - name: Run Certify.Core.Tests.Unit Tests run: | - $env:GITHUB_WORKSPACE="D:\a\certify\certify\certify" + $env:GITHUB_WORKSPACE="$env:GITHUB_WORKSPACE\certify" $env:GITHUB_STEP_SUMMARY=".\TestResults-8_0-${{ runner.os }}\test-summary.md" dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 -- RunConfiguration.CollectSourceInformation=true working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - name: Generate Test Results Report run: | - echo "# Test Results\n" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 + echo "# Test Results" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 Get-Content -Path .\TestResults-8_0-${{ runner.os }}\test-summary.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 -Append working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 + if: ${{ always() }} - name: Generated Test Coverage Report run: | reportgenerator -reports:./TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" Get-Content -Path ./TestResults-8_0-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 + if: ${{ always() }} + + - name: Upload dotnet test Artifacts + uses: actions/upload-artifact@master + with: + name: dotnet-results-${{ runner.os }}-${{ env.DOTNET_VERSION }} + path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} + # Use always() to always run this step to publish test results when there are test failures + if: ${{ always() }} From 726439deca746361a3914a8b999855fe47332e03 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Wed, 6 Dec 2023 17:57:18 -0800 Subject: [PATCH 079/118] More tweaks to GitHub Actions for test runs on Windows and Linux --- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 3 ++- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index fa6c7484c..7e12ac742 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -77,12 +77,13 @@ jobs: run: | export GITHUB_WORKSPACE="$GITHUB_WORKSPACE/certify" export GITHUB_STEP_SUMMARY="./TestResults-8_0-${{ runner.os }}/test-summary.md - dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 -- RunConfiguration.CollectSourceInformation=true + dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 -- RunConfiguration.CollectSourceInformation=true working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - name: Generate Test Results Report run: | echo "# Test Results" > $GITHUB_STEP_SUMMARY + sed -i 's/
/
/g' ./TestResults-8_0-${{ runner.os }}/test-summary.md cat ./TestResults-8_0-${{ runner.os }}/test-summary.md >> $GITHUB_STEP_SUMMARY working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 if: ${{ always() }} diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 1c56ea2b8..a994eb62e 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -84,7 +84,7 @@ jobs: - name: Generate Test Results Report run: | echo "# Test Results" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 - Get-Content -Path .\TestResults-8_0-${{ runner.os }}\test-summary.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 -Append + (Get-Content -Path .\TestResults-8_0-${{ runner.os }}\test-summary.md).Replace('
', '
') | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 -Append working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 if: ${{ always() }} From 687243b6291ce8261d11cca84c14985618c41a26 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Wed, 6 Dec 2023 18:00:20 -0800 Subject: [PATCH 080/118] Fix to running tests in Linux GitHub Action --- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 7e12ac742..a60832744 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -76,7 +76,7 @@ jobs: - name: Run Certify.Core.Tests.Unit Tests run: | export GITHUB_WORKSPACE="$GITHUB_WORKSPACE/certify" - export GITHUB_STEP_SUMMARY="./TestResults-8_0-${{ runner.os }}/test-summary.md + export GITHUB_STEP_SUMMARY="./TestResults-8_0-${{ runner.os }}/test-summary.md" dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 -- RunConfiguration.CollectSourceInformation=true working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 From 6999dc710b52c4df000163683a1af5ab3cef8e4f Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Wed, 6 Dec 2023 18:03:25 -0800 Subject: [PATCH 081/118] Fix to path to Coverlet on Linux test runner --- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index a60832744..4a4215c88 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -77,7 +77,7 @@ jobs: run: | export GITHUB_WORKSPACE="$GITHUB_WORKSPACE/certify" export GITHUB_STEP_SUMMARY="./TestResults-8_0-${{ runner.os }}/test-summary.md" - dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 -- RunConfiguration.CollectSourceInformation=true + dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 -- RunConfiguration.CollectSourceInformation=true working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - name: Generate Test Results Report From 5c7058f7283bc559e329b5eb2ab353a396712964 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 7 Dec 2023 10:10:17 -0800 Subject: [PATCH 082/118] Lint cleanup for ChallengeConfigMatchTests Certify Core Unit Tests --- .../Certify.Core.Tests.Unit/ChallengeConfigMatchTests.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/ChallengeConfigMatchTests.cs b/src/Certify.Tests/Certify.Core.Tests.Unit/ChallengeConfigMatchTests.cs index 2053786f1..7ef2d122a 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Unit/ChallengeConfigMatchTests.cs +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/ChallengeConfigMatchTests.cs @@ -144,8 +144,6 @@ public void ChallengeDelegationRuleTests() [TestMethod, Description("Ensure correct challenge config selected when rule is blank")] public void ChallengeDelegationRuleBlankRule() { - // wildcard rule tests [any subdomain source, any subdomain target] - var testRule = "*.test.com:*.auth.test.co.uk"; var result = Management.Challenges.DnsChallengeHelper.ApplyChallengeDelegationRule("test.com", "_acme-challenge.test.com", null); Assert.AreEqual("_acme-challenge.test.com", result); } From df28717e84220bfa922195be90fb3f70f42871ce Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 7 Dec 2023 10:11:05 -0800 Subject: [PATCH 083/118] Refactors to speed up execution of CertifyManagerAccountTests Unit Tests --- .../CertifyManagerAccountTests.cs | 153 ++++++++++-------- 1 file changed, 82 insertions(+), 71 deletions(-) diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs b/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs index ec349e862..cd27dc61e 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs @@ -21,38 +21,91 @@ namespace Certify.Core.Tests.Unit { [TestClass] - public class CertifyManagerAccountTests : IDisposable + public class CertifyManagerAccountTests { - private readonly CertifyManager _certifyManager; - private readonly bool _isContainer = Environment.GetEnvironmentVariable("DOTNET_RUNNING_IN_CONTAINER") == "true"; - private readonly bool _isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows); - private readonly bool _isWindowsGitlabRunner = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && Environment.GetEnvironmentVariable("GITHUB_WORKSPACE") != null; - private readonly string _caDomain; - private readonly int _caPort; - private IContainer _caContainer; - private IVolume _stepVolume; + private static readonly bool _isContainer = Environment.GetEnvironmentVariable("DOTNET_RUNNING_IN_CONTAINER") == "true"; + private static readonly bool _isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows); + private static readonly bool _isWindowsGitlabRunner = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && Environment.GetEnvironmentVariable("GITHUB_WORKSPACE") != null; + private static readonly string _winRunnerTempDir = "C:\\Temp\\.step"; + private static string _caDomain; + private static int _caPort; + private static IContainer _caContainer; + private static IVolume _stepVolume; + private static Loggy _log; + private CertifyManager _certifyManager; private CertificateAuthority _customCa; private AccountDetails _customCaAccount; - private readonly Loggy _log; - private readonly string _winRunnerTempDir = "C:\\Temp\\.step"; - public CertifyManagerAccountTests() + [ClassInitialize] + public static async Task ClassInit(TestContext context) { - _certifyManager = new CertifyManager(); - _certifyManager.Init().Wait(); _log = new Loggy(new LoggerConfiguration().WriteTo.Debug().CreateLogger()); _caDomain = _isContainer ? "step-ca" : "localhost"; _caPort = 9000; - BootstrapStepCa().Wait(); - CheckCustomCaIsRunning().Wait(); - AddCustomCa().Wait(); - CheckForExistingLeAccount().Wait(); - AddNewCustomCaAccount().Wait(); + await BootstrapStepCa(); + await CheckCustomCaIsRunning(); + } + + [TestInitialize] + public async Task TestInit() + { + _certifyManager = new CertifyManager(); + _certifyManager.Init().Wait(); + + await AddCustomCa(); + await AddNewCustomCaAccount(); + await CheckForExistingLeAccount(); + } + + [TestCleanup] + public async Task Cleanup() + { + if (_customCaAccount != null) + { + await _certifyManager.RemoveAccount(_customCaAccount.StorageKey, true); + } + + if (_customCa != null) + { + await _certifyManager.RemoveCertificateAuthority(_customCa.Id); + } + + _certifyManager?.Dispose(); } - private async Task BootstrapStepCa() + [ClassCleanup(ClassCleanupBehavior.EndOfClass)] + public static async Task ClassCleanup() + { + if (!_isContainer) + { + await _caContainer.DisposeAsync(); + if (_stepVolume != null) + { + await _stepVolume.DeleteAsync(); + await _stepVolume.DisposeAsync(); + } + else + { + Directory.Delete("C:\\Temp\\.step", true); + } + } + + var stepConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".step", "config"); + if (Directory.Exists(stepConfigPath)) + { + Directory.Delete(stepConfigPath, true); + } + + var stepCertsPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".step", "certs"); + if (Directory.Exists(stepCertsPath)) + { + Directory.Delete(stepCertsPath, true); + } + } + + private static async Task BootstrapStepCa() { string stepCaFingerprint; @@ -89,12 +142,11 @@ private async Task BootstrapStepCa() } // Run bootstrap command - //var command = $"ca bootstrap -f --ca-url https://{_caDomain}:{_caPort} --fingerprint {stepCaFingerprint} --install"; - var command = $"ca bootstrap -f --ca-url https://{_caDomain}:{_caPort} --fingerprint {stepCaFingerprint}"; - RunCommand("step", command, "Bootstrap Step CA Script", 1000 * 30); + var args = $"ca bootstrap -f --ca-url https://{_caDomain}:{_caPort} --fingerprint {stepCaFingerprint}"; + RunCommand("step", args, "Bootstrap Step CA Script", 1000 * 30); } - private async Task StartStepCaContainer() + private static async Task StartStepCaContainer() { try { @@ -120,7 +172,8 @@ private async Task StartStepCaContainer() .WithWaitStrategy(Wait.ForUnixContainer().UntilMessageIsLogged($"Serving HTTPS on :{_caPort} ...")) // Build the container configuration. .Build(); - } else + } + else { // Create new volume for step-ca container _stepVolume = new VolumeBuilder().WithName("step").Build(); @@ -190,7 +243,7 @@ private class StepCaConfig public string root; } - private void RunCommand(string program, string args, string description = null, int timeoutMS = 1000 * 5) + private static void RunCommand(string program, string args, string description = null, int timeoutMS = 1000 * 5) { if (description == null) { description = string.Concat(program, " ", args); } @@ -246,7 +299,7 @@ private void RunCommand(string program, string args, string description = null, _log.Information($"{description} Successful"); } - private async Task CheckCustomCaIsRunning() + private static async Task CheckCustomCaIsRunning() { var httpHandler = new HttpClientHandler(); @@ -280,7 +333,8 @@ private async Task AddCustomCa() CertAuthoritySupportedRequests.DOMAIN_MULTIPLE_SAN.ToString(), CertAuthoritySupportedRequests.DOMAIN_WILDCARD.ToString() }, - SupportedKeyTypes = new List{ + SupportedKeyTypes = new List + { StandardKeyTypes.ECDSA256, } }; @@ -329,49 +383,6 @@ private async Task CheckForExistingLeAccount() } } - public void Dispose() => Cleanup().Wait(); - - private async Task Cleanup() - { - if (_customCaAccount != null) - { - await _certifyManager.RemoveAccount(_customCaAccount.StorageKey, true); - } - - if (_customCa != null) - { - await _certifyManager.RemoveCertificateAuthority(_customCa.Id); - } - - if (!_isContainer) - { - await _caContainer.DisposeAsync(); - if (_stepVolume != null) - { - await _stepVolume.DeleteAsync(); - await _stepVolume.DisposeAsync(); - } - else - { - Directory.Delete("C:\\Temp\\.step", true); - } - } - - var stepConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".step", "config"); - if (Directory.Exists(stepConfigPath)) - { - Directory.Delete(stepConfigPath, true); - } - - var stepCertsPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".step", "certs"); - if (Directory.Exists(stepCertsPath)) - { - Directory.Delete(stepCertsPath, true); - } - - _certifyManager?.Dispose(); - } - [TestMethod, Description("Happy path test for using CertifyManager.GetAccountDetails()")] public async Task TestCertifyManagerGetAccountDetails() { From 0761cdaf48caaeac5741a64e3f8ae012e3e34d45 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 7 Dec 2023 12:45:48 -0800 Subject: [PATCH 084/118] Test out using Linux Docker containers on Windows GitHub Action Runner --- .../workflows/8_0_Core_Unit_Tests_Win.yaml | 8 ++++- .../CertifyManagerAccountTests.cs | 33 ++++++++++++------- 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index a994eb62e..3ae521834 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -64,8 +64,14 @@ jobs: tar -oxzf C:\temp\step_windows_0.24.4_amd64.zip -C "C:\Program Files" echo "C:\Program Files\step_0.24.4\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + # - name: Pull step-ca Docker Image + # run: docker pull jrnelson90/step-ca-win + - name: Pull step-ca Docker Image - run: docker pull jrnelson90/step-ca-win + run: | + cd "C:\Program Files\Docker\Docker" + .\DockerCli.exe -SwitchLinuxEngine + docker pull smallstep/step-ca - name: Install Dependencies & Build Certify.Core.Tests.Unit run: | diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs b/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs index cd27dc61e..56a2d4b5f 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs @@ -6,6 +6,7 @@ using System.Net.Http; using System.Runtime.InteropServices; using System.Text; +using System.Threading; using System.Threading.Tasks; using Certify.ACME.Anvil; using Certify.Management; @@ -25,7 +26,6 @@ public class CertifyManagerAccountTests { private static readonly bool _isContainer = Environment.GetEnvironmentVariable("DOTNET_RUNNING_IN_CONTAINER") == "true"; private static readonly bool _isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows); - private static readonly bool _isWindowsGitlabRunner = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && Environment.GetEnvironmentVariable("GITHUB_WORKSPACE") != null; private static readonly string _winRunnerTempDir = "C:\\Temp\\.step"; private static string _caDomain; private static int _caPort; @@ -88,7 +88,7 @@ public static async Task ClassCleanup() } else { - Directory.Delete("C:\\Temp\\.step", true); + Directory.Delete(_winRunnerTempDir, true); } } @@ -124,11 +124,14 @@ private static async Task BootstrapStepCa() } else { + var dockerInfo = RunCommand("docker", "info", "Get Docker Info"); + var runningWindowsDockerEngine = dockerInfo.output.Contains("OSType: windows"); + // Start new step-ca container - await StartStepCaContainer(); + await StartStepCaContainer(runningWindowsDockerEngine); // Read step-ca fingerprint from config file - if (_isWindowsGitlabRunner) + if (_isWindows && runningWindowsDockerEngine) { // Read step-ca fingerprint from config file var stepCaConfigJson = JsonReader.ReadFile($"{_winRunnerTempDir}\\config\\defaults.json"); @@ -146,11 +149,11 @@ private static async Task BootstrapStepCa() RunCommand("step", args, "Bootstrap Step CA Script", 1000 * 30); } - private static async Task StartStepCaContainer() + private static async Task StartStepCaContainer(bool runningWindowsDockerEngine) { try { - if (_isWindowsGitlabRunner) + if (_isWindows && runningWindowsDockerEngine) { if (!Directory.Exists(_winRunnerTempDir)) { Directory.CreateDirectory(_winRunnerTempDir); @@ -159,7 +162,7 @@ private static async Task StartStepCaContainer() // Create new step-ca container _caContainer = new ContainerBuilder() .WithName("step-ca") - // Set the image for the container to "smallstep/step-ca:latest". + // Set the image for the container to "jrnelson90/step-ca-win:latest". .WithImage("jrnelson90/step-ca-win:latest") .WithBindMount(_winRunnerTempDir, "C:\\Users\\ContainerUser\\.step") // Bind port 9000 of the container to port 9000 on the host. @@ -243,7 +246,7 @@ private class StepCaConfig public string root; } - private static void RunCommand(string program, string args, string description = null, int timeoutMS = 1000 * 5) + private static CommandOutput RunCommand(string program, string args, string description = null, int timeoutMS = Timeout.Infinite) { if (description == null) { description = string.Concat(program, " ", args); } @@ -254,7 +257,6 @@ private static void RunCommand(string program, string args, string description = { FileName = program, Arguments = args, - RedirectStandardInput = true, RedirectStandardOutput = true, RedirectStandardError = true, UseShellExecute = false, @@ -288,7 +290,7 @@ private static void RunCommand(string program, string args, string description = process.BeginOutputReadLine(); process.BeginErrorReadLine(); - process.WaitForExit(timeoutMS); + process.WaitForExit(timeoutMS); } catch (Exception exp) { @@ -296,7 +298,16 @@ private static void RunCommand(string program, string args, string description = throw; } - _log.Information($"{description} Successful"); + _log.Information($"{description} is Finished"); + + return new CommandOutput { errorOutput = errorOutput, output = output, exitCode = process.ExitCode }; + } + + private struct CommandOutput + { + public string errorOutput { get; set; } + public string output { get; set; } + public int exitCode { get; set; } } private static async Task CheckCustomCaIsRunning() From 7ce2bca55ae6ea9824678e05a00f76061322cbf8 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 7 Dec 2023 12:54:46 -0800 Subject: [PATCH 085/118] Debug Docker location in GitHub Actions Windows Runner --- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 3ae521834..f29e563a4 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -69,6 +69,7 @@ jobs: - name: Pull step-ca Docker Image run: | + docker info cd "C:\Program Files\Docker\Docker" .\DockerCli.exe -SwitchLinuxEngine docker pull smallstep/step-ca From 68a14ecd776997d66175e6b68488edda3a708d55 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 7 Dec 2023 12:59:47 -0800 Subject: [PATCH 086/118] More debugging DockerCli.exe location in GitHub Actions Windows Runner --- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index f29e563a4..87bfe8e99 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -70,7 +70,8 @@ jobs: - name: Pull step-ca Docker Image run: | docker info - cd "C:\Program Files\Docker\Docker" + dir "C:\ProgramData\Docker" + cd "C:\ProgramData\Docker\Docker" .\DockerCli.exe -SwitchLinuxEngine docker pull smallstep/step-ca From 35fbbe5940c0a613e6ab7a99d056db9601410908 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 7 Dec 2023 13:04:10 -0800 Subject: [PATCH 087/118] More debugging DockerCli.exe location in GitHub Actions Windows Runner --- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 87bfe8e99..5451f7a2f 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -70,6 +70,7 @@ jobs: - name: Pull step-ca Docker Image run: | docker info + dir "C:\Program Files\Docker" dir "C:\ProgramData\Docker" cd "C:\ProgramData\Docker\Docker" .\DockerCli.exe -SwitchLinuxEngine From 456e71014584aa23d6acdbb3540c3981509e85ae Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 7 Dec 2023 13:07:17 -0800 Subject: [PATCH 088/118] More debugging DockerCli.exe location in GitHub Actions Windows Runner --- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 5451f7a2f..530f0203a 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -70,7 +70,8 @@ jobs: - name: Pull step-ca Docker Image run: | docker info - dir "C:\Program Files\Docker" + docker version + dir "C:\Program Files(x86)\Docker" dir "C:\ProgramData\Docker" cd "C:\ProgramData\Docker\Docker" .\DockerCli.exe -SwitchLinuxEngine From dd8ce6ec7e1a9860e688f27e18e6a29f25e911b9 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 7 Dec 2023 13:15:46 -0800 Subject: [PATCH 089/118] More debugging DockerCli.exe location in GitHub Actions Windows Runner --- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 530f0203a..76bec3303 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -71,6 +71,7 @@ jobs: run: | docker info docker version + docker context ls dir "C:\Program Files(x86)\Docker" dir "C:\ProgramData\Docker" cd "C:\ProgramData\Docker\Docker" From b865cd53f3883418ab10952640ea1db7f7d69cfe Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 7 Dec 2023 13:37:09 -0800 Subject: [PATCH 090/118] Simplify Docker Info command output in CertifyManagerAccountTests --- .../Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs b/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs index 56a2d4b5f..44ca2ef33 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyManagerAccountTests.cs @@ -124,8 +124,8 @@ private static async Task BootstrapStepCa() } else { - var dockerInfo = RunCommand("docker", "info", "Get Docker Info"); - var runningWindowsDockerEngine = dockerInfo.output.Contains("OSType: windows"); + var dockerInfo = RunCommand("docker", "info --format \"{{ .OSType }}\"", "Get Docker Info"); + var runningWindowsDockerEngine = dockerInfo.output.Contains("windows"); // Start new step-ca container await StartStepCaContainer(runningWindowsDockerEngine); From 93b457016d076b354d410a6db77bbcd5255766bf Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 7 Dec 2023 13:39:05 -0800 Subject: [PATCH 091/118] More debugging DockerCli.exe location in GitHub Actions Windows Runner --- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 76bec3303..0ccbffdaf 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -72,7 +72,10 @@ jobs: docker info docker version docker context ls - dir "C:\Program Files(x86)\Docker" + dir "C:\Program Files(x86)" + dir "C:\Program Files" + dir "D:\" + dir "D:\a" dir "C:\ProgramData\Docker" cd "C:\ProgramData\Docker\Docker" .\DockerCli.exe -SwitchLinuxEngine From a578712e0fd5d93cf1d286f38b4cbff077c59781 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 7 Dec 2023 13:41:29 -0800 Subject: [PATCH 092/118] More debugging DockerCli.exe location in GitHub Actions Windows Runner --- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 0ccbffdaf..fed1b94cd 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -72,7 +72,6 @@ jobs: docker info docker version docker context ls - dir "C:\Program Files(x86)" dir "C:\Program Files" dir "D:\" dir "D:\a" From 2967632de3dac07ddddb6dcc8805f09e061cb086 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 7 Dec 2023 13:47:26 -0800 Subject: [PATCH 093/118] More debugging DockerCli.exe location in GitHub Actions Windows Runner --- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index fed1b94cd..d5c708a17 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -76,6 +76,8 @@ jobs: dir "D:\" dir "D:\a" dir "C:\ProgramData\Docker" + $env:GITHUB_PATH -split ";" + $env:path -split ";" cd "C:\ProgramData\Docker\Docker" .\DockerCli.exe -SwitchLinuxEngine docker pull smallstep/step-ca From 0da37c9ee2cf21fa8e3bc2fa2ed3db77da4d1902 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 7 Dec 2023 13:58:22 -0800 Subject: [PATCH 094/118] More debugging DockerCli.exe location in GitHub Actions Windows Runner --- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index d5c708a17..6d258db77 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -72,11 +72,18 @@ jobs: docker info docker version docker context ls + dir "C:\" dir "C:\Program Files" + dir "C:\Program Files (x86)" + dir "C:\hostedtoolcache" + dir "C:\tools" dir "D:\" dir "D:\a" + dir "D:\a\temp" dir "C:\ProgramData\Docker" + echo GITHUB_PATH $env:GITHUB_PATH -split ";" + echo PATH $env:path -split ";" cd "C:\ProgramData\Docker\Docker" .\DockerCli.exe -SwitchLinuxEngine From ee0e9ce6eaeb239e775c6126fbd7423511c8aef0 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 7 Dec 2023 14:01:18 -0800 Subject: [PATCH 095/118] More debugging DockerCli.exe location in GitHub Actions Windows Runner --- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 6d258db77..ca2884ccf 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -79,7 +79,7 @@ jobs: dir "C:\tools" dir "D:\" dir "D:\a" - dir "D:\a\temp" + dir "D:\a\_temp" dir "C:\ProgramData\Docker" echo GITHUB_PATH $env:GITHUB_PATH -split ";" From 5bfff04e149efbfcfc08076eb351697c038e14a2 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 7 Dec 2023 14:23:31 -0800 Subject: [PATCH 096/118] Restore using Windows Docker Image for Windows Runners in GitHub Actions --- .../workflows/8_0_Core_Unit_Tests_Win.yaml | 24 +------------------ 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index ca2884ccf..a994eb62e 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -64,30 +64,8 @@ jobs: tar -oxzf C:\temp\step_windows_0.24.4_amd64.zip -C "C:\Program Files" echo "C:\Program Files\step_0.24.4\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - # - name: Pull step-ca Docker Image - # run: docker pull jrnelson90/step-ca-win - - name: Pull step-ca Docker Image - run: | - docker info - docker version - docker context ls - dir "C:\" - dir "C:\Program Files" - dir "C:\Program Files (x86)" - dir "C:\hostedtoolcache" - dir "C:\tools" - dir "D:\" - dir "D:\a" - dir "D:\a\_temp" - dir "C:\ProgramData\Docker" - echo GITHUB_PATH - $env:GITHUB_PATH -split ";" - echo PATH - $env:path -split ";" - cd "C:\ProgramData\Docker\Docker" - .\DockerCli.exe -SwitchLinuxEngine - docker pull smallstep/step-ca + run: docker pull jrnelson90/step-ca-win - name: Install Dependencies & Build Certify.Core.Tests.Unit run: | From 4482918727bd83c0d89d62bad4aa2cc0718c3397 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 7 Dec 2023 14:43:16 -0800 Subject: [PATCH 097/118] Test Caching NuGet Dependencies for Linux and Windows GitHub Actions --- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 9 +++++++++ .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 11 ++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 4a4215c88..859f05302 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -66,6 +66,15 @@ jobs: - name: Pull step-ca Docker Image run: docker pull smallstep/step-ca + - name: Cache NuGet Dependencies + uses: actions/cache@v3 + with: + path: $HOME/.nuget/packages + # Look to see if there is a cache hit for the corresponding requirements file + key: ${{ runner.os }}-nuget-${{ hashFiles('./certify/src/Certify.Tests/Certify.Core.Tests.Unit/*.csproj') }} + restore-keys: | + ${{ runner.os }}-nuget + - name: Install Dependencies & Build Certify.Core.Tests.Unit run: | dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index a994eb62e..9a3ad38ce 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -67,13 +67,22 @@ jobs: - name: Pull step-ca Docker Image run: docker pull jrnelson90/step-ca-win + - name: Cache NuGet Dependencies + uses: actions/cache@v3 + with: + path: C:\%HOME_PATH%\.nuget\packages + # Look to see if there is a cache hit for the corresponding requirements file + key: ${{ runner.os }}-nuget-${{ hashFiles('./certify/src/Certify.Tests/Certify.Core.Tests.Unit/*.csproj') }} + restore-keys: | + ${{ runner.os }}-nuget + - name: Install Dependencies & Build Certify.Core.Tests.Unit run: | dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 dotnet add package GitHubActionsTestLogger dotnet build -c Debug -f net8.0 --property WarningLevel=0 /clp:ErrorsOnly working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - + - name: Run Certify.Core.Tests.Unit Tests run: | $env:GITHUB_WORKSPACE="$env:GITHUB_WORKSPACE\certify" From 9732fef31afab90860dcbd13a78b55530894d56c Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 7 Dec 2023 17:29:57 -0800 Subject: [PATCH 098/118] Remove blank Constructor methods to enable debugging in .NET 4.6.2 --- .../Certify.Core.Tests.Integration/RdapTests.cs | 6 ------ src/Certify.Tests/Certify.Core.Tests.Unit/MiscTests.cs | 8 +------- src/Certify.Tests/Certify.Core.Tests.Unit/RdapTests.cs | 6 ------ 3 files changed, 1 insertion(+), 19 deletions(-) diff --git a/src/Certify.Tests/Certify.Core.Tests.Integration/RdapTests.cs b/src/Certify.Tests/Certify.Core.Tests.Integration/RdapTests.cs index 743806cf8..62292dba2 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Integration/RdapTests.cs +++ b/src/Certify.Tests/Certify.Core.Tests.Integration/RdapTests.cs @@ -8,12 +8,6 @@ namespace Certify.Core.Tests [TestClass] public class RdapTests { - - public RdapTests() - { - - } - [TestMethod, Description("Test Rdap Query")] [DataTestMethod] [DataRow("example.com", "OK", null)] diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/MiscTests.cs b/src/Certify.Tests/Certify.Core.Tests.Unit/MiscTests.cs index ec3a8506b..5ab938731 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Unit/MiscTests.cs +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/MiscTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading.Tasks; using Certify.Models.API; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -8,12 +8,6 @@ namespace Certify.Core.Tests.Unit [TestClass] public class MiscTests { - - public MiscTests() - { - - } - [TestMethod, Description("Test null/blank coalesce of string")] public void TestNullOrBlankCoalesce() { diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/RdapTests.cs b/src/Certify.Tests/Certify.Core.Tests.Unit/RdapTests.cs index 6e4d50931..cb6c25d63 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Unit/RdapTests.cs +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/RdapTests.cs @@ -7,12 +7,6 @@ namespace Certify.Core.Tests.Unit [TestClass] public class RdapTests { - - public RdapTests() - { - - } - [TestMethod, Description("Test domain TLD check")] [DataTestMethod] [DataRow("example.com", "com")] From 2130c9e9db3e0c0afcd34082d3ff00b4bc869b72 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 7 Dec 2023 17:36:47 -0800 Subject: [PATCH 099/118] Fix Unit/Integration tests stalling in 4.6.2 when using CertifyManager --- .../Management/CertifyManager/CertifyManager.cs | 11 ++++++++++- .../CertRequestTests.cs | 3 ++- .../CertifyManagerServerTypeTests.cs | 1 + .../CertifyManagerTests.cs | 5 +++++ .../DeploymentPreviewTests.cs | 1 + .../DeploymentTaskTests.cs | 6 ++++++ 6 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/Certify.Core/Management/CertifyManager/CertifyManager.cs b/src/Certify.Core/Management/CertifyManager/CertifyManager.cs index 8703a2596..9407ceafb 100644 --- a/src/Certify.Core/Management/CertifyManager/CertifyManager.cs +++ b/src/Certify.Core/Management/CertifyManager/CertifyManager.cs @@ -537,7 +537,16 @@ public async Task PerformRenewalTasks() return await Task.FromResult(true); } - public void Dispose() => ManagedCertificateLog.DisposeLoggers(); + public void Dispose() => Cleanup(); + + private void Cleanup() + { + ManagedCertificateLog.DisposeLoggers(); + if(_tc != null) + { + _tc.Dispose(); + } + } /// /// Perform (or preview) an import of settings from another instance diff --git a/src/Certify.Tests/Certify.Core.Tests.Integration/CertRequestTests.cs b/src/Certify.Tests/Certify.Core.Tests.Integration/CertRequestTests.cs index 501c071eb..0e89e1cf3 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Integration/CertRequestTests.cs +++ b/src/Certify.Tests/Certify.Core.Tests.Integration/CertRequestTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; @@ -81,6 +81,7 @@ public async Task TeardownIIS() { await iisManager.DeleteSite(testSiteName); Assert.IsFalse(await iisManager.SiteExists(testSiteName)); + certifyManager.Dispose(); } [TestMethod, TestCategory("MegaTest")] diff --git a/src/Certify.Tests/Certify.Core.Tests.Integration/CertifyManagerServerTypeTests.cs b/src/Certify.Tests/Certify.Core.Tests.Integration/CertifyManagerServerTypeTests.cs index cfa981f6b..8fcc9840e 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Integration/CertifyManagerServerTypeTests.cs +++ b/src/Certify.Tests/Certify.Core.Tests.Integration/CertifyManagerServerTypeTests.cs @@ -46,6 +46,7 @@ public async Task TeardownIIS() { await _iisManager.DeleteSite(_testSiteName); Assert.IsFalse(await _iisManager.SiteExists(_testSiteName)); + _certifyManager.Dispose(); } [TestMethod, Description("Happy path test for using CertifyManager.GetPrimaryWebSites() for IIS")] diff --git a/src/Certify.Tests/Certify.Core.Tests.Integration/CertifyManagerTests.cs b/src/Certify.Tests/Certify.Core.Tests.Integration/CertifyManagerTests.cs index 9f3f4c649..d5052a534 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Integration/CertifyManagerTests.cs +++ b/src/Certify.Tests/Certify.Core.Tests.Integration/CertifyManagerTests.cs @@ -19,6 +19,11 @@ public CertifyManagerTests() _certifyManager.Init().Wait(); } + [TestCleanup] public void Cleanup() + { + _certifyManager.Dispose(); + } + [TestMethod, Description("Happy path test for using CertifyManager.GetACMEProvider()")] public async Task TestCertifyManagerGetACMEProvider() { diff --git a/src/Certify.Tests/Certify.Core.Tests.Integration/DeploymentPreviewTests.cs b/src/Certify.Tests/Certify.Core.Tests.Integration/DeploymentPreviewTests.cs index 038c76688..2970281ff 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Integration/DeploymentPreviewTests.cs +++ b/src/Certify.Tests/Certify.Core.Tests.Integration/DeploymentPreviewTests.cs @@ -74,6 +74,7 @@ public async Task TeardownIIS() { await iisManager.DeleteSite(testSiteName); Assert.IsFalse(await iisManager.SiteExists(testSiteName)); + certifyManager.Dispose(); } [TestMethod] diff --git a/src/Certify.Tests/Certify.Core.Tests.Integration/DeploymentTaskTests.cs b/src/Certify.Tests/Certify.Core.Tests.Integration/DeploymentTaskTests.cs index 3af000cd7..3022f1216 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Integration/DeploymentTaskTests.cs +++ b/src/Certify.Tests/Certify.Core.Tests.Integration/DeploymentTaskTests.cs @@ -36,6 +36,12 @@ public DeploymentTaskTests() PrimaryTestDomain = ConfigSettings["Cloudflare_TestDomain"]; } + [TestCleanup] + public void Cleanup() + { + certifyManager?.Dispose(); + } + private DeploymentTaskConfig GetMockTaskConfig( string name, string msg = "Hello World", From 06f7675156c316edee5d1bd6099af587d19845aa Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 7 Dec 2023 18:14:57 -0800 Subject: [PATCH 100/118] Re-enable Windows 4.6.2 Certify Core Unit Test GitHub Action Workflow --- .../workflows/4_6_2_Core_Unit_Tests_Win.yaml | 61 ++++++++++++------- .../workflows/8_0_Core_Unit_Tests_Linux.yaml | 4 +- .../workflows/8_0_Core_Unit_Tests_Win.yaml | 4 +- 3 files changed, 44 insertions(+), 25 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index 7a167bfd9..daa9511de 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -13,8 +13,7 @@ env: jobs: build-and-test: - # TODO: Re-enable once we determine the cause of the .NET Framework 4.6.2 tests stalling (test runner doesn't quit when done') - if: ${{ ! always() }} + # if: ${{ ! always() }} name: build-and-test-windows runs-on: windows-latest steps: @@ -60,35 +59,55 @@ jobs: dotnet-version: ${{ env.DOTNET_VERSION }} - name: Setup Step CLI - run: "Invoke-WebRequest -Method 'GET' -uri 'https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.24.4/step_windows_0.24.4_amd64.zip' -Outfile 'C:\\temp\\step_windows_0.24.4_amd64.zip'; tar -oxzf C:\\temp\\step_windows_0.24.4_amd64.zip -C 'C:\\Program Files';" - - - name: Add Step CLI to PATH - run: echo "C:\Program Files\step_0.24.4\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + run: | + Invoke-WebRequest -Method 'GET' -uri 'https://dl.smallstep.com/gh-release/cli/docs-cli-install/v0.24.4/step_windows_0.24.4_amd64.zip' -Outfile 'C:\temp\step_windows_0.24.4_amd64.zip' + tar -oxzf C:\temp\step_windows_0.24.4_amd64.zip -C "C:\Program Files" + echo "C:\Program Files\step_0.24.4\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Pull step-ca Docker Image run: docker pull jrnelson90/step-ca-win - - name: Install Test Report Tools - run: dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 && dotnet tool install --global LiquidTestReports.Cli --version 1.4.3-beta + - name: Cache NuGet Dependencies + uses: actions/cache@v3 + with: + path: C:\%HOME_PATH%\.nuget\packages + # Look to see if there is a cache hit for the corresponding requirements file + key: ${{ runner.os }}-${{ env.DOTNET_VERSION }}-nuget-${{ hashFiles('./certify/src/Certify.Tests/Certify.Core.Tests.Unit/*.csproj') }} + restore-keys: | + ${{ runner.os }}-${{ env.DOTNET_VERSION }}-nuget - name: Install Dependencies & Build Certify.Core.Tests.Unit - run: dotnet build -c Debug -f net462 --property WarningLevel=0 /clp:ErrorsOnly + run: | + dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 + dotnet add package GitHubActionsTestLogger + dotnet build -c Debug -f net462 --property WarningLevel=0 /clp:ErrorsOnly working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Run Certify.Core.Tests.Unit Tests - run: dotnet test Certify.Core.Tests.Unit.dll -v normal -f net462 --logger trx --logger html --collect:"XPlat Code Coverage" --results-directory "TestResults-4_6_2-${{ runner.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 - working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462 + run: | + $env:GITHUB_WORKSPACE="$env:GITHUB_WORKSPACE\certify" + $env:GITHUB_STEP_SUMMARY=".\bin\Debug\net462\TestResults-4_6_2-${{ runner.os }}\test-summary.md" + dotnet test Certify.Core.Tests.Unit.csproj --no-build -v normal -f net462 --l trx --l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --results-directory ".\bin\Debug\net462\TestResults-4_6_2-${{ runner.os }}" /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.msbuild\6.0.0\build -- RunConfiguration.CollectSourceInformation=true + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Generated Test Results Report - if: success() || failure() # run this step even if previous step failed - run: liquid --inputs "File=./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/*.trx;Format=Trx"" --output-file ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/test_results.md --title "Test Results" && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/test_results.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY + run: | + echo "# Test Results" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 + (Get-Content -Path .\TestResults-4_6_2-${{ runner.os }}\test-summary.md).Replace('
', '
') | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 -Append + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462 + if: ${{ always() }} - name: Generated Test Coverage Report - if: success() || failure() # run this step even if previous step failed - run: reportgenerator -reports:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" && Get-Content -Path ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY - - # - name: Publish Test Results - # uses: EnricoMi/publish-unit-test-result-action/composite@v2 - # if: always() - # with: - # files: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }}/*.trx + run: | + reportgenerator -reports:./TestResults-4_6_2-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./TestResults-4_6_2-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" + Get-Content -Path ./TestResults-4_6_2-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462 + if: ${{ always() }} + + - name: Upload dotnet test Artifacts + uses: actions/upload-artifact@master + with: + name: dotnet-results-${{ runner.os }}-${{ env.DOTNET_VERSION }} + path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }} + # Use always() to always run this step to publish test results when there are test failures + if: ${{ always() }} diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 859f05302..9cfb2faaa 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -71,9 +71,9 @@ jobs: with: path: $HOME/.nuget/packages # Look to see if there is a cache hit for the corresponding requirements file - key: ${{ runner.os }}-nuget-${{ hashFiles('./certify/src/Certify.Tests/Certify.Core.Tests.Unit/*.csproj') }} + key: ${{ runner.os }}-${{ env.DOTNET_VERSION }}-nuget-${{ hashFiles('./certify/src/Certify.Tests/Certify.Core.Tests.Unit/*.csproj') }} restore-keys: | - ${{ runner.os }}-nuget + ${{ runner.os }}-${{ env.DOTNET_VERSION }}-nuget - name: Install Dependencies & Build Certify.Core.Tests.Unit run: | diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 9a3ad38ce..8251e6a55 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -72,9 +72,9 @@ jobs: with: path: C:\%HOME_PATH%\.nuget\packages # Look to see if there is a cache hit for the corresponding requirements file - key: ${{ runner.os }}-nuget-${{ hashFiles('./certify/src/Certify.Tests/Certify.Core.Tests.Unit/*.csproj') }} + key: ${{ runner.os }}-${{ env.DOTNET_VERSION }}-nuget-${{ hashFiles('./certify/src/Certify.Tests/Certify.Core.Tests.Unit/*.csproj') }} restore-keys: | - ${{ runner.os }}-nuget + ${{ runner.os }}-${{ env.DOTNET_VERSION }}-nuget - name: Install Dependencies & Build Certify.Core.Tests.Unit run: | From 5ee76ac3acb00b31630f15ccbd1451ceaf944fad Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 7 Dec 2023 18:29:25 -0800 Subject: [PATCH 101/118] Fix to Windows .NET 4.6.2 test run GitHub Action Workflow --- .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index daa9511de..34af7f5e4 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -87,7 +87,7 @@ jobs: run: | $env:GITHUB_WORKSPACE="$env:GITHUB_WORKSPACE\certify" $env:GITHUB_STEP_SUMMARY=".\bin\Debug\net462\TestResults-4_6_2-${{ runner.os }}\test-summary.md" - dotnet test Certify.Core.Tests.Unit.csproj --no-build -v normal -f net462 --l trx --l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --results-directory ".\bin\Debug\net462\TestResults-4_6_2-${{ runner.os }}" /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.msbuild\6.0.0\build -- RunConfiguration.CollectSourceInformation=true + dotnet test Certify.Core.Tests.Unit.csproj --no-build -v normal -f net462 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --results-directory ".\bin\Debug\net462\TestResults-4_6_2-${{ runner.os }}" /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.msbuild\6.0.0\build -- RunConfiguration.CollectSourceInformation=true working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Generated Test Results Report From 5fc6963a3e1264d6d82ebc799eb9a890ba1975aa Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 7 Dec 2023 20:36:15 -0800 Subject: [PATCH 102/118] Disable Coverage Report for .NET 4.6.2 until issue can be determined --- .../workflows/4_6_2_Core_Unit_Tests_Win.yaml | 18 +++++++++--------- .../workflows/8_0_Core_Unit_Tests_Linux.yaml | 2 +- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index 34af7f5e4..7edf38f13 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -86,9 +86,9 @@ jobs: - name: Run Certify.Core.Tests.Unit Tests run: | $env:GITHUB_WORKSPACE="$env:GITHUB_WORKSPACE\certify" - $env:GITHUB_STEP_SUMMARY=".\bin\Debug\net462\TestResults-4_6_2-${{ runner.os }}\test-summary.md" - dotnet test Certify.Core.Tests.Unit.csproj --no-build -v normal -f net462 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --results-directory ".\bin\Debug\net462\TestResults-4_6_2-${{ runner.os }}" /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.msbuild\6.0.0\build -- RunConfiguration.CollectSourceInformation=true - working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit + $env:GITHUB_STEP_SUMMARY=".TestResults-4_6_2-${{ runner.os }}\test-summary.md" + dotnet test Certify.Core.Tests.Unit.dll -v normal -f net462 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --results-directory "TestResults-4_6_2-${{ runner.os }}" -- RunConfiguration.CollectSourceInformation=true + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462 - name: Generated Test Results Report run: | @@ -97,12 +97,12 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462 if: ${{ always() }} - - name: Generated Test Coverage Report - run: | - reportgenerator -reports:./TestResults-4_6_2-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./TestResults-4_6_2-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" - Get-Content -Path ./TestResults-4_6_2-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY - working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462 - if: ${{ always() }} + # - name: Generated Test Coverage Report + # run: | + # reportgenerator -reports:./TestResults-4_6_2-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./TestResults-4_6_2-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" + # Get-Content -Path ./TestResults-4_6_2-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY + # working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462 + # if: ${{ always() }} - name: Upload dotnet test Artifacts uses: actions/upload-artifact@master diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 9cfb2faaa..0428297e5 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -86,7 +86,7 @@ jobs: run: | export GITHUB_WORKSPACE="$GITHUB_WORKSPACE/certify" export GITHUB_STEP_SUMMARY="./TestResults-8_0-${{ runner.os }}/test-summary.md" - dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0 -- RunConfiguration.CollectSourceInformation=true + dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --results-directory "TestResults-8_0-${{ runner.os }}" --collect:"XPlat Code Coverage" --test-adapter-path "$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0" -- RunConfiguration.CollectSourceInformation=true working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - name: Generate Test Results Report diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 8251e6a55..9cc1dc566 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -87,7 +87,7 @@ jobs: run: | $env:GITHUB_WORKSPACE="$env:GITHUB_WORKSPACE\certify" $env:GITHUB_STEP_SUMMARY=".\TestResults-8_0-${{ runner.os }}\test-summary.md" - dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --collect:"XPlat Code Coverage" --results-directory "TestResults-8_0-${{ runner.os }}" /testadapterpath:C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0 -- RunConfiguration.CollectSourceInformation=true + dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --results-directory "TestResults-8_0-${{ runner.os }}" --collect:"XPlat Code Coverage" --test-adapter-path "C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0" -- RunConfiguration.CollectSourceInformation=true working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 - name: Generate Test Results Report From 352477f3935fb84d6ad66e4ebb8828fa21426ec0 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 7 Dec 2023 20:44:29 -0800 Subject: [PATCH 103/118] Fix Test Result generation for Windows .NET 4.6.2 runs --- .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index 7edf38f13..0c69854ed 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -86,7 +86,7 @@ jobs: - name: Run Certify.Core.Tests.Unit Tests run: | $env:GITHUB_WORKSPACE="$env:GITHUB_WORKSPACE\certify" - $env:GITHUB_STEP_SUMMARY=".TestResults-4_6_2-${{ runner.os }}\test-summary.md" + $env:GITHUB_STEP_SUMMARY=".\TestResults-4_6_2-${{ runner.os }}\test-summary.md" dotnet test Certify.Core.Tests.Unit.dll -v normal -f net462 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --results-directory "TestResults-4_6_2-${{ runner.os }}" -- RunConfiguration.CollectSourceInformation=true working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462 From 6069c82cfca512bbd79dd974dd5c8623270b5c22 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 7 Dec 2023 21:50:12 -0800 Subject: [PATCH 104/118] Fix for enabling Coverage Report on 4.6.2 Windows Test Runs --- .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index 0c69854ed..d3c0a11b7 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -87,7 +87,7 @@ jobs: run: | $env:GITHUB_WORKSPACE="$env:GITHUB_WORKSPACE\certify" $env:GITHUB_STEP_SUMMARY=".\TestResults-4_6_2-${{ runner.os }}\test-summary.md" - dotnet test Certify.Core.Tests.Unit.dll -v normal -f net462 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --results-directory "TestResults-4_6_2-${{ runner.os }}" -- RunConfiguration.CollectSourceInformation=true + dotnet test Certify.Core.Tests.Unit.dll -v normal -f net462 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --results-directory "TestResults-4_6_2-${{ runner.os }}" --collect:"Code Coverage" --test-adapter-path C:\%HOMEPATH%\.nuget\packages\microsoft.codecoverage\17.8.0\build\netstandard2.0 -- RunConfiguration.CollectSourceInformation=true working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462 - name: Generated Test Results Report @@ -97,12 +97,13 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462 if: ${{ always() }} - # - name: Generated Test Coverage Report - # run: | - # reportgenerator -reports:./TestResults-4_6_2-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./TestResults-4_6_2-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" - # Get-Content -Path ./TestResults-4_6_2-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY - # working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462 - # if: ${{ always() }} + - name: Generated Test Coverage Report + run: | + C:\%HOMEPATH%\.nuget\packages\microsoft.codecoverage\17.8.0\build\netstandard2.0\CodeCoverage\CodeCoverage.exe analyze /output:./TestResults-4_6_2-${{ runner.os }}/DynamicCodeCoverage.coverage.xml ./TestResults-4_6_2-${{ runner.os }}/**/*.coverage + reportgenerator -reports:./TestResults-4_6_2-${{ runner.os }}/DynamicCodeCoverage.coverage.xml -targetdir:./TestResults-4_6_2-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" + Get-Content -Path ./TestResults-4_6_2-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462 + if: ${{ always() }} - name: Upload dotnet test Artifacts uses: actions/upload-artifact@master From 80770d04946b4af1c7284eedc33ab32a3f80e39d Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 7 Dec 2023 22:21:24 -0800 Subject: [PATCH 105/118] Another fix for enabling Coverage Report on 4.6.2 Windows Test Runs --- .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index d3c0a11b7..f732fd837 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -99,8 +99,8 @@ jobs: - name: Generated Test Coverage Report run: | - C:\%HOMEPATH%\.nuget\packages\microsoft.codecoverage\17.8.0\build\netstandard2.0\CodeCoverage\CodeCoverage.exe analyze /output:./TestResults-4_6_2-${{ runner.os }}/DynamicCodeCoverage.coverage.xml ./TestResults-4_6_2-${{ runner.os }}/**/*.coverage - reportgenerator -reports:./TestResults-4_6_2-${{ runner.os }}/DynamicCodeCoverage.coverage.xml -targetdir:./TestResults-4_6_2-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" + & C:\$env:HOMEPATH\.nuget\packages\microsoft.codecoverage\17.8.0\build\netstandard2.0\CodeCoverage\CodeCoverage.exe analyze /output:./TestResults-4_6_2-${{ runner.os }}/DynamicCodeCoverage.coveragexml ./TestResults-4_6_2-${{ runner.os }}/**/*.coverage + reportgenerator -reports:./TestResults-4_6_2-${{ runner.os }}/DynamicCodeCoverage.coveragexml -targetdir:./TestResults-4_6_2-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" Get-Content -Path ./TestResults-4_6_2-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462 if: ${{ always() }} From 86dca0d765faf5117aa163c934d06be32badedb1 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 7 Dec 2023 23:18:37 -0800 Subject: [PATCH 106/118] Script fix for enabling Coverage Report on 4.6.2 Windows Test Runs --- .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index f732fd837..dd9c9a93a 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -99,8 +99,10 @@ jobs: - name: Generated Test Coverage Report run: | - & C:\$env:HOMEPATH\.nuget\packages\microsoft.codecoverage\17.8.0\build\netstandard2.0\CodeCoverage\CodeCoverage.exe analyze /output:./TestResults-4_6_2-${{ runner.os }}/DynamicCodeCoverage.coveragexml ./TestResults-4_6_2-${{ runner.os }}/**/*.coverage - reportgenerator -reports:./TestResults-4_6_2-${{ runner.os }}/DynamicCodeCoverage.coveragexml -targetdir:./TestResults-4_6_2-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" + Move-Item -Path .\TestResults-4_6_2-${{ runner.os }}\**\*.coverage -Destination .\TestResults-4_6_2-${{ runner.os }} + Get-Item -Path ".\TestResults-4_6_2-${{ runner.os }}\*.coverage" | Rename-Item -NewName "results.coverage" + & C:\$env:HOMEPATH\.nuget\packages\microsoft.codecoverage\17.8.0\build\netstandard2.0\CodeCoverage\CodeCoverage.exe analyze /output:./TestResults-4_6_2-${{ runner.os }}/results.xml ./TestResults-4_6_2-${{ runner.os }}/results.coverage + reportgenerator -reports:./TestResults-4_6_2-${{ runner.os }}/results.xml -targetdir:./TestResults-4_6_2-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" Get-Content -Path ./TestResults-4_6_2-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462 if: ${{ always() }} From 4403a99bbb1ffd53c50dc7da7dca6aacaf5566da Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 7 Dec 2023 23:35:34 -0800 Subject: [PATCH 107/118] YAML fixes for caching NuGet dependencies --- .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml | 2 +- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 2 +- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index dd9c9a93a..f03cd5c23 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -70,7 +70,7 @@ jobs: - name: Cache NuGet Dependencies uses: actions/cache@v3 with: - path: C:\%HOME_PATH%\.nuget\packages + path: C:\${{ env.HOMEPATH }}\.nuget\packages # Look to see if there is a cache hit for the corresponding requirements file key: ${{ runner.os }}-${{ env.DOTNET_VERSION }}-nuget-${{ hashFiles('./certify/src/Certify.Tests/Certify.Core.Tests.Unit/*.csproj') }} restore-keys: | diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 0428297e5..aa13fc3fd 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -69,7 +69,7 @@ jobs: - name: Cache NuGet Dependencies uses: actions/cache@v3 with: - path: $HOME/.nuget/packages + path: ~/.nuget/packages # Look to see if there is a cache hit for the corresponding requirements file key: ${{ runner.os }}-${{ env.DOTNET_VERSION }}-nuget-${{ hashFiles('./certify/src/Certify.Tests/Certify.Core.Tests.Unit/*.csproj') }} restore-keys: | diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 9cc1dc566..af8f1a21e 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -70,7 +70,7 @@ jobs: - name: Cache NuGet Dependencies uses: actions/cache@v3 with: - path: C:\%HOME_PATH%\.nuget\packages + path: C:\${{ env.HOMEPATH }}\.nuget\packages # Look to see if there is a cache hit for the corresponding requirements file key: ${{ runner.os }}-${{ env.DOTNET_VERSION }}-nuget-${{ hashFiles('./certify/src/Certify.Tests/Certify.Core.Tests.Unit/*.csproj') }} restore-keys: | From 970c9867cf0252c75de5fa7d79136a7f386d2b9c Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 7 Dec 2023 23:47:44 -0800 Subject: [PATCH 108/118] Fixes to Windows NuGet dependency caching --- .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml | 2 +- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index f03cd5c23..45da9914a 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -70,7 +70,7 @@ jobs: - name: Cache NuGet Dependencies uses: actions/cache@v3 with: - path: C:\${{ env.HOMEPATH }}\.nuget\packages + path: ~/.nuget/packages # Look to see if there is a cache hit for the corresponding requirements file key: ${{ runner.os }}-${{ env.DOTNET_VERSION }}-nuget-${{ hashFiles('./certify/src/Certify.Tests/Certify.Core.Tests.Unit/*.csproj') }} restore-keys: | diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index af8f1a21e..6806f39f2 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -70,7 +70,7 @@ jobs: - name: Cache NuGet Dependencies uses: actions/cache@v3 with: - path: C:\${{ env.HOMEPATH }}\.nuget\packages + path: ~/.nuget/packages # Look to see if there is a cache hit for the corresponding requirements file key: ${{ runner.os }}-${{ env.DOTNET_VERSION }}-nuget-${{ hashFiles('./certify/src/Certify.Tests/Certify.Core.Tests.Unit/*.csproj') }} restore-keys: | From 7f2b8421297571152882150fcf5351ff7e134c0b Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Thu, 7 Dec 2023 23:58:55 -0800 Subject: [PATCH 109/118] Disable archiving Test Artifacts on all GitHub Actions Test Jobs --- .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml | 14 +++++++------- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 14 +++++++------- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 14 +++++++------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index 45da9914a..7326bb447 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -107,10 +107,10 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462 if: ${{ always() }} - - name: Upload dotnet test Artifacts - uses: actions/upload-artifact@master - with: - name: dotnet-results-${{ runner.os }}-${{ env.DOTNET_VERSION }} - path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }} - # Use always() to always run this step to publish test results when there are test failures - if: ${{ always() }} + # - name: Upload dotnet test Artifacts + # uses: actions/upload-artifact@master + # with: + # name: dotnet-results-${{ runner.os }}-${{ env.DOTNET_VERSION }} + # path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }} + # # Use always() to always run this step to publish test results when there are test failures + # if: ${{ always() }} diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index aa13fc3fd..243ddd97c 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -104,10 +104,10 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 if: ${{ always() }} - - name: Upload dotnet test Artifacts - uses: actions/upload-artifact@master - with: - name: dotnet-results-${{ runner.os }}-${{ env.DOTNET_VERSION }} - path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} - # Use always() to always run this step to publish test results when there are test failures - if: ${{ always() }} + # - name: Upload dotnet test Artifacts + # uses: actions/upload-artifact@master + # with: + # name: dotnet-results-${{ runner.os }}-${{ env.DOTNET_VERSION }} + # path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} + # # Use always() to always run this step to publish test results when there are test failures + # if: ${{ always() }} diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 6806f39f2..6a18b4361 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -104,10 +104,10 @@ jobs: working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 if: ${{ always() }} - - name: Upload dotnet test Artifacts - uses: actions/upload-artifact@master - with: - name: dotnet-results-${{ runner.os }}-${{ env.DOTNET_VERSION }} - path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} - # Use always() to always run this step to publish test results when there are test failures - if: ${{ always() }} + # - name: Upload dotnet test Artifacts + # uses: actions/upload-artifact@master + # with: + # name: dotnet-results-${{ runner.os }}-${{ env.DOTNET_VERSION }} + # path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} + # # Use always() to always run this step to publish test results when there are test failures + # if: ${{ always() }} From 9b286ce2ae539ec4c0758812b23e3d2700578281 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Fri, 8 Dec 2023 00:15:43 -0800 Subject: [PATCH 110/118] More tweaks to NuGet Dependency caching in GitHub Actions --- .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml | 5 +++-- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 1 + .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 1 + .../Certify.Core.Tests.Unit/Certify.Core.Tests.Unit.csproj | 4 ---- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index 7326bb447..26d7b8d81 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -72,14 +72,15 @@ jobs: with: path: ~/.nuget/packages # Look to see if there is a cache hit for the corresponding requirements file - key: ${{ runner.os }}-${{ env.DOTNET_VERSION }}-nuget-${{ hashFiles('./certify/src/Certify.Tests/Certify.Core.Tests.Unit/*.csproj') }} + key: ${{ runner.os }}-4.6.2-nuget-${{ hashFiles('./certify/src/Certify.Tests/Certify.Core.Tests.Unit/*.csproj') }} restore-keys: | - ${{ runner.os }}-${{ env.DOTNET_VERSION }}-nuget + ${{ runner.os }}-4.6.2-nuget - name: Install Dependencies & Build Certify.Core.Tests.Unit run: | dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 dotnet add package GitHubActionsTestLogger + dotnet add package coverlet.collector dotnet build -c Debug -f net462 --property WarningLevel=0 /clp:ErrorsOnly working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 243ddd97c..4fa88f42a 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -79,6 +79,7 @@ jobs: run: | dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 dotnet add package GitHubActionsTestLogger + dotnet add package coverlet.collector dotnet build -c Debug -f net8.0 --property WarningLevel=0 /clp:ErrorsOnly working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 6a18b4361..5362c27aa 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -80,6 +80,7 @@ jobs: run: | dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0 dotnet add package GitHubActionsTestLogger + dotnet add package coverlet.collector dotnet build -c Debug -f net8.0 --property WarningLevel=0 /clp:ErrorsOnly working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/Certify.Core.Tests.Unit.csproj b/src/Certify.Tests/Certify.Core.Tests.Unit/Certify.Core.Tests.Unit.csproj index df5a1dbf3..1273b3f7d 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Unit/Certify.Core.Tests.Unit.csproj +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/Certify.Core.Tests.Unit.csproj @@ -132,10 +132,6 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - From 58afd1436e151f671e2eb1c0d2e468bd133b9384 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Fri, 8 Dec 2023 16:03:35 -0800 Subject: [PATCH 111/118] Simplify Code Coverage Generation for 4.6.2 runs --- .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index 26d7b8d81..7c2cb70bb 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -88,7 +88,7 @@ jobs: run: | $env:GITHUB_WORKSPACE="$env:GITHUB_WORKSPACE\certify" $env:GITHUB_STEP_SUMMARY=".\TestResults-4_6_2-${{ runner.os }}\test-summary.md" - dotnet test Certify.Core.Tests.Unit.dll -v normal -f net462 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --results-directory "TestResults-4_6_2-${{ runner.os }}" --collect:"Code Coverage" --test-adapter-path C:\%HOMEPATH%\.nuget\packages\microsoft.codecoverage\17.8.0\build\netstandard2.0 -- RunConfiguration.CollectSourceInformation=true + dotnet test Certify.Core.Tests.Unit.dll -v normal -f net462 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --results-directory "TestResults-4_6_2-${{ runner.os }}" --collect:"Code Coverage;Format=Cobertura" --test-adapter-path C:\%HOMEPATH%\.nuget\packages\microsoft.codecoverage\17.8.0\build\netstandard2.0 -- RunConfiguration.CollectSourceInformation=true working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462 - name: Generated Test Results Report @@ -100,10 +100,7 @@ jobs: - name: Generated Test Coverage Report run: | - Move-Item -Path .\TestResults-4_6_2-${{ runner.os }}\**\*.coverage -Destination .\TestResults-4_6_2-${{ runner.os }} - Get-Item -Path ".\TestResults-4_6_2-${{ runner.os }}\*.coverage" | Rename-Item -NewName "results.coverage" - & C:\$env:HOMEPATH\.nuget\packages\microsoft.codecoverage\17.8.0\build\netstandard2.0\CodeCoverage\CodeCoverage.exe analyze /output:./TestResults-4_6_2-${{ runner.os }}/results.xml ./TestResults-4_6_2-${{ runner.os }}/results.coverage - reportgenerator -reports:./TestResults-4_6_2-${{ runner.os }}/results.xml -targetdir:./TestResults-4_6_2-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" + reportgenerator -reports:./TestResults-4_6_2-${{ runner.os }}/**/*.cobertura.xml -targetdir:./TestResults-4_6_2-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" Get-Content -Path ./TestResults-4_6_2-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462 if: ${{ always() }} From 7bce65096d085b14992cf5a74534560112ec8c24 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Fri, 8 Dec 2023 22:47:41 -0800 Subject: [PATCH 112/118] Simplify testing commands for GitHub Actions using .runsettings files --- .../workflows/4_6_2_Core_Unit_Tests_Win.yaml | 10 ++-- .../workflows/8_0_Core_Unit_Tests_Linux.yaml | 10 ++-- .../workflows/8_0_Core_Unit_Tests_Win.yaml | 10 ++-- .../Certify.Core.Tests.Unit.csproj | 9 ++++ .../unit-test-462.runsettings | 48 +++++++++++++++++++ .../unit-test-8-0-linux.runsettings | 36 ++++++++++++++ .../unit-test-8-0.runsettings | 36 ++++++++++++++ 7 files changed, 144 insertions(+), 15 deletions(-) create mode 100644 src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-462.runsettings create mode 100644 src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-8-0-linux.runsettings create mode 100644 src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-8-0.runsettings diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index 7c2cb70bb..38ad0561c 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -88,27 +88,27 @@ jobs: run: | $env:GITHUB_WORKSPACE="$env:GITHUB_WORKSPACE\certify" $env:GITHUB_STEP_SUMMARY=".\TestResults-4_6_2-${{ runner.os }}\test-summary.md" - dotnet test Certify.Core.Tests.Unit.dll -v normal -f net462 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --results-directory "TestResults-4_6_2-${{ runner.os }}" --collect:"Code Coverage;Format=Cobertura" --test-adapter-path C:\%HOMEPATH%\.nuget\packages\microsoft.codecoverage\17.8.0\build\netstandard2.0 -- RunConfiguration.CollectSourceInformation=true - working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462 + dotnet test --no-build -f net462 -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Generated Test Results Report run: | echo "# Test Results" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 (Get-Content -Path .\TestResults-4_6_2-${{ runner.os }}\test-summary.md).Replace('
', '
') | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 -Append - working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462 + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit if: ${{ always() }} - name: Generated Test Coverage Report run: | reportgenerator -reports:./TestResults-4_6_2-${{ runner.os }}/**/*.cobertura.xml -targetdir:./TestResults-4_6_2-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" Get-Content -Path ./TestResults-4_6_2-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY - working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462 + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit if: ${{ always() }} # - name: Upload dotnet test Artifacts # uses: actions/upload-artifact@master # with: # name: dotnet-results-${{ runner.os }}-${{ env.DOTNET_VERSION }} - # path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net462/TestResults-4_6_2-${{ runner.os }} + # path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/TestResults-4_6_2-${{ runner.os }} # # Use always() to always run this step to publish test results when there are test failures # if: ${{ always() }} diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 4fa88f42a..9688cc5d9 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -87,28 +87,28 @@ jobs: run: | export GITHUB_WORKSPACE="$GITHUB_WORKSPACE/certify" export GITHUB_STEP_SUMMARY="./TestResults-8_0-${{ runner.os }}/test-summary.md" - dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --results-directory "TestResults-8_0-${{ runner.os }}" --collect:"XPlat Code Coverage" --test-adapter-path "$HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0" -- RunConfiguration.CollectSourceInformation=true - working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 + dotnet test --no-build -f net8.0 -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Generate Test Results Report run: | echo "# Test Results" > $GITHUB_STEP_SUMMARY sed -i 's/
/
/g' ./TestResults-8_0-${{ runner.os }}/test-summary.md cat ./TestResults-8_0-${{ runner.os }}/test-summary.md >> $GITHUB_STEP_SUMMARY - working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit if: ${{ always() }} - name: Generated Test Coverage Report run: | reportgenerator -reports:./TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" cat ./TestResults-8_0-${{ runner.os }}/SummaryGithub.md > $GITHUB_STEP_SUMMARY - working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit if: ${{ always() }} # - name: Upload dotnet test Artifacts # uses: actions/upload-artifact@master # with: # name: dotnet-results-${{ runner.os }}-${{ env.DOTNET_VERSION }} - # path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} + # path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/TestResults-8_0-${{ runner.os }} # # Use always() to always run this step to publish test results when there are test failures # if: ${{ always() }} diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index 5362c27aa..b82f95695 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -88,27 +88,27 @@ jobs: run: | $env:GITHUB_WORKSPACE="$env:GITHUB_WORKSPACE\certify" $env:GITHUB_STEP_SUMMARY=".\TestResults-8_0-${{ runner.os }}\test-summary.md" - dotnet test Certify.Core.Tests.Unit.dll -v normal -f net8.0 -l trx -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" --results-directory "TestResults-8_0-${{ runner.os }}" --collect:"XPlat Code Coverage" --test-adapter-path "C:\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0" -- RunConfiguration.CollectSourceInformation=true - working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 + dotnet test --no-build -f net8.0 -l "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.messageFormat=@error\n@trace" + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit - name: Generate Test Results Report run: | echo "# Test Results" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 (Get-Content -Path .\TestResults-8_0-${{ runner.os }}\test-summary.md).Replace('
', '
') | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 -Append - working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit if: ${{ always() }} - name: Generated Test Coverage Report run: | reportgenerator -reports:./TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" Get-Content -Path ./TestResults-8_0-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY - working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0 + working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit if: ${{ always() }} # - name: Upload dotnet test Artifacts # uses: actions/upload-artifact@master # with: # name: dotnet-results-${{ runner.os }}-${{ env.DOTNET_VERSION }} - # path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/bin/Debug/net8.0/TestResults-8_0-${{ runner.os }} + # path: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit/TestResults-8_0-${{ runner.os }} # # Use always() to always run this step to publish test results when there are test failures # if: ${{ always() }} diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/Certify.Core.Tests.Unit.csproj b/src/Certify.Tests/Certify.Core.Tests.Unit/Certify.Core.Tests.Unit.csproj index 1273b3f7d..e9fed835a 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Unit/Certify.Core.Tests.Unit.csproj +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/Certify.Core.Tests.Unit.csproj @@ -101,6 +101,15 @@ 1701;1702;NU1701 + + .\unit-test-462.runsettings + + + .\unit-test-8-0.runsettings + + + .\unit-test-8-0-linux.runsettings + diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-462.runsettings b/src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-462.runsettings new file mode 100644 index 000000000..205d54dbc --- /dev/null +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-462.runsettings @@ -0,0 +1,48 @@ + + + + + + %SystemDrive%\%HOMEPATH%\.nuget\packages\microsoft.codecoverage\17.8.0\build\netstandard2.0 + net462 + .\TestResults-4_6_2-windows + true + + + + + + + Cobertura + + + + + .*Certify.*$ + .*Plugin.*$ + + + .*Certify.Core.Tests.Unit.dll$ + .*Moq.dll$ + + + + True + + + + + + + + + + + normal + + + + + + diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-8-0-linux.runsettings b/src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-8-0-linux.runsettings new file mode 100644 index 000000000..f7d77f74c --- /dev/null +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-8-0-linux.runsettings @@ -0,0 +1,36 @@ + + + + + + $HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0;$HOME/.nuget/packages/coverlet.msbuild/6.0.0/build + net8.0 + .\TestResults-8_0-linux + true + + + + + + + cobertura + + [Certify.*]*,[Plugin.*]* + + false + + + + + + + + + + normal + + + + + + diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-8-0.runsettings b/src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-8-0.runsettings new file mode 100644 index 000000000..bf6bb4f4e --- /dev/null +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-8-0.runsettings @@ -0,0 +1,36 @@ + + + + + + %SystemDrive%\%HOMEPATH%\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0;%SystemDrive%\%HOMEPATH%\.nuget\packages\coverlet.msbuild\6.0.0\build + net8.0 + .\TestResults-8_0-windows + true + + + + + + + cobertura + + [Certify.*]*,[Plugin.*]* + + false + + + + + + + + + + normal + + + + + + From bfe773960363ea046f8aeb2a20217aa4f8ad330c Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Fri, 8 Dec 2023 22:59:51 -0800 Subject: [PATCH 113/118] Further fixes to GitHub Actions report generation --- .github/workflows/4_6_2_Core_Unit_Tests_Win.yaml | 2 +- .github/workflows/8_0_Core_Unit_Tests_Linux.yaml | 2 +- .github/workflows/8_0_Core_Unit_Tests_Win.yaml | 2 +- .../Certify.Core.Tests.Unit/unit-test-8-0-linux.runsettings | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml index 38ad0561c..56e5e6aed 100644 --- a/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/4_6_2_Core_Unit_Tests_Win.yaml @@ -100,7 +100,7 @@ jobs: - name: Generated Test Coverage Report run: | - reportgenerator -reports:./TestResults-4_6_2-${{ runner.os }}/**/*.cobertura.xml -targetdir:./TestResults-4_6_2-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" + reportgenerator -reports:./TestResults-4_6_2-${{ runner.os }}/*/*.cobertura.xml -targetdir:./TestResults-4_6_2-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" Get-Content -Path ./TestResults-4_6_2-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit if: ${{ always() }} diff --git a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml index 9688cc5d9..6475b8460 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Linux.yaml @@ -100,7 +100,7 @@ jobs: - name: Generated Test Coverage Report run: | - reportgenerator -reports:./TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" + reportgenerator -reports:./TestResults-8_0-${{ runner.os }}/*/coverage.cobertura.xml -targetdir:./TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" cat ./TestResults-8_0-${{ runner.os }}/SummaryGithub.md > $GITHUB_STEP_SUMMARY working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit if: ${{ always() }} diff --git a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml index b82f95695..233d3f5e2 100644 --- a/.github/workflows/8_0_Core_Unit_Tests_Win.yaml +++ b/.github/workflows/8_0_Core_Unit_Tests_Win.yaml @@ -100,7 +100,7 @@ jobs: - name: Generated Test Coverage Report run: | - reportgenerator -reports:./TestResults-8_0-${{ runner.os }}/**/coverage.cobertura.xml -targetdir:./TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" + reportgenerator -reports:./TestResults-8_0-${{ runner.os }}/*/coverage.cobertura.xml -targetdir:./TestResults-8_0-${{ runner.os }} -reporttypes:MarkdownSummaryGithub "-title:Test Coverage" Get-Content -Path ./TestResults-8_0-${{ runner.os }}/SummaryGithub.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit if: ${{ always() }} diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-8-0-linux.runsettings b/src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-8-0-linux.runsettings index f7d77f74c..d62c53ee0 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-8-0-linux.runsettings +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-8-0-linux.runsettings @@ -5,7 +5,7 @@ $HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0;$HOME/.nuget/packages/coverlet.msbuild/6.0.0/build net8.0 - .\TestResults-8_0-linux + ./TestResults-8_0-linux true From aa4cb0202075f7de1348ad898477822bbf93a3c2 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Fri, 8 Dec 2023 23:06:13 -0800 Subject: [PATCH 114/118] Fix Linux Test Results Directory to match value from ${{ runner.os }} --- .../Certify.Core.Tests.Unit/unit-test-8-0-linux.runsettings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-8-0-linux.runsettings b/src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-8-0-linux.runsettings index d62c53ee0..cc5b793c7 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-8-0-linux.runsettings +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-8-0-linux.runsettings @@ -5,7 +5,7 @@ $HOME/.nuget/packages/coverlet.collector/6.0.0/build/netstandard1.0;$HOME/.nuget/packages/coverlet.msbuild/6.0.0/build net8.0 - ./TestResults-8_0-linux + ./TestResults-8_0-Linux true From a5d39abf063ace955f8e63eee13021b56b4f2112 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Fri, 8 Dec 2023 23:50:09 -0800 Subject: [PATCH 115/118] Filter unused DataStore Plugins from Unit Test Reports with Coverlet --- .../Certify.Core.Tests.Unit/unit-test-8-0-linux.runsettings | 2 +- .../Certify.Core.Tests.Unit/unit-test-8-0.runsettings | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-8-0-linux.runsettings b/src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-8-0-linux.runsettings index cc5b793c7..1ffd818a7 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-8-0-linux.runsettings +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-8-0-linux.runsettings @@ -15,7 +15,7 @@ cobertura - [Certify.*]*,[Plugin.*]* + [Certify.*]*,[Plugin.Datastore.SQLite]* false diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-8-0.runsettings b/src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-8-0.runsettings index bf6bb4f4e..1f1211437 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-8-0.runsettings +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-8-0.runsettings @@ -15,7 +15,7 @@ cobertura - [Certify.*]*,[Plugin.*]* + [Certify.*]*,[Plugin.Datastore.SQLite]* false From fc1efb60ac77d6e9d336a21848d90c2be0ee15dc Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Sat, 9 Dec 2023 01:06:09 -0800 Subject: [PATCH 116/118] Add basic Unit Test for Certify.Service so it shows on 4.6.2 coverage --- .../CertifyServiceTests.cs | 19 +++++++++++++++++++ .../unit-test-462.runsettings | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 src/Certify.Tests/Certify.Core.Tests.Unit/CertifyServiceTests.cs diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyServiceTests.cs b/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyServiceTests.cs new file mode 100644 index 000000000..040ace3d4 --- /dev/null +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyServiceTests.cs @@ -0,0 +1,19 @@ +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Certify.Core.Tests.Unit +{ + [TestClass] + public class CertifyServiceTests + { + [TestMethod, Description("Validate that Service Program Main() does not start with bad args")] + public async Task TestProgramMainFails() + { + var exitCode = Certify.Service.Program.Main(null); + + await Task.Delay(5000); + + Assert.AreEqual(exitCode, 1067, "Unexpected exit code"); + } + } +} diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-462.runsettings b/src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-462.runsettings index 205d54dbc..9e1f06a10 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-462.runsettings +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/unit-test-462.runsettings @@ -19,7 +19,7 @@ .*Certify.*$ - .*Plugin.*$ + .*Plugin.Datastore.SQLite.dll$ .*Certify.Core.Tests.Unit.dll$ From 0ba73cd1d8a814fae409f3a34783d5f96f89a2f6 Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Wed, 13 Dec 2023 15:28:14 -0800 Subject: [PATCH 117/118] Expand tests for Certify.Service --- .../Certify.Core.Tests.Unit.csproj | 1 + .../CertifyServiceTests.cs | 204 +++++++++++++++++- 2 files changed, 199 insertions(+), 6 deletions(-) diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/Certify.Core.Tests.Unit.csproj b/src/Certify.Tests/Certify.Core.Tests.Unit/Certify.Core.Tests.Unit.csproj index e9fed835a..be055e774 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Unit/Certify.Core.Tests.Unit.csproj +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/Certify.Core.Tests.Unit.csproj @@ -141,6 +141,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyServiceTests.cs b/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyServiceTests.cs index 040ace3d4..87045f488 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyServiceTests.cs +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyServiceTests.cs @@ -1,19 +1,211 @@ -using System.Threading.Tasks; +using Certify.Models; +using Certify.Models.Config; +using Certify.Shared; +using Medallion.Shell; using Microsoft.VisualStudio.TestTools.UnitTesting; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Http; +using System.Text.RegularExpressions; +using System.Threading.Tasks; namespace Certify.Core.Tests.Unit { +#if NET462 [TestClass] public class CertifyServiceTests { - [TestMethod, Description("Validate that Service Program Main() does not start with bad args")] - public async Task TestProgramMainFails() + private HttpClient _httpClient; + private string serviceUri; + + public CertifyServiceTests() { + var serviceConfig = SharedUtils.ServiceConfigManager.GetAppServiceConfig(); + serviceUri = $"{(serviceConfig.UseHTTPS ? "https" : "http")}://{serviceConfig.Host}:{serviceConfig.Port}"; + var httpHandler = new HttpClientHandler { UseDefaultCredentials = true }; + _httpClient = new HttpClient(httpHandler); + _httpClient.DefaultRequestHeaders.Add("User-Agent", "Certify/App"); + _httpClient.BaseAddress = new Uri(serviceUri+"/api/"); + } + + private async Task StartCertifyService(string args = "") + { + Command certifyService; + if (args == "") + { + certifyService = Command.Run(".\\Certify.Service.exe"); + await Task.Delay(2000); + } + else + { + certifyService = Command.Run(".\\Certify.Service.exe", args); + } + + return certifyService; + } + + private async Task StopCertifyService(Command certifyService) + { + await certifyService.TrySignalAsync(CommandSignal.ControlC); + + var cmdResult = await certifyService.Task; + + Assert.AreEqual(cmdResult.ExitCode, 0, "Unexpected exit code"); + + return cmdResult; + } + + [TestMethod, Description("Validate that Certify.Service.exe does not start with args from CLI")] + public async Task TestProgramMainFailsWithArgsCli() + { + var certifyService = await StartCertifyService("args"); + + var cmdResult = await certifyService.Task; + + Assert.IsTrue(cmdResult.StandardOutput.Contains("Topshelf.HostFactory Error: 0 : An exception occurred creating the host, Topshelf.HostConfigurationException: The service was not properly configured:")); + Assert.IsTrue(cmdResult.StandardOutput.Contains("Topshelf.HostFactory Error: 0 : The service terminated abnormally, Topshelf.HostConfigurationException: The service was not properly configured:")); + + Assert.AreEqual(cmdResult.ExitCode, 1067, "Unexpected exit code"); + } + + [TestMethod, Description("Validate that Certify.Service.exe starts from CLI with no args")] + public async Task TestProgramMainStartsCli() + { + var certifyService = await StartCertifyService(); + + var cmdResult = await StopCertifyService(certifyService); + + Assert.IsTrue(cmdResult.StandardOutput.Contains("[Success] Name Certify.Service")); + Assert.IsTrue(cmdResult.StandardOutput.Contains("[Success] DisplayName Certify Certificate Manager Service (Instance: Debug)")); + Assert.IsTrue(cmdResult.StandardOutput.Contains("[Success] Description Certify Certificate Manager Service")); + Assert.IsTrue(cmdResult.StandardOutput.Contains("[Success] InstanceName Debug")); + Assert.IsTrue(cmdResult.StandardOutput.Contains("[Success] ServiceName Certify.Service$Debug")); + Assert.IsTrue(cmdResult.StandardOutput.Contains("The Certify.Service$Debug service is now running, press Control+C to exit.")); + Assert.IsTrue(cmdResult.StandardOutput.Contains("Control+C detected, attempting to stop service.")); + Assert.IsTrue(cmdResult.StandardOutput.Contains("The Certify.Service$Debug service has stopped.")); + } + + [TestMethod, Description("Validate that Certify.Service.exe returns a valid response on route /api/system/appversion")] + public async Task TestCertifyServiceAppVersionRoute() + { + var certifyService = await StartCertifyService(); + + try + { + var versionRes = await _httpClient.GetAsync("system/appversion"); + var versionResStr = await versionRes.Content.ReadAsStringAsync(); + + Assert.AreEqual(HttpStatusCode.OK, versionRes.StatusCode, $"Unexpected status code from GET {versionRes.RequestMessage.RequestUri.AbsoluteUri}"); + StringAssert.Matches(versionResStr, new Regex(@"^""(\d+\.)?(\d+\.)?(\d+\.)?(\*|\d+)""$"), $"Unexpected response from GET {versionRes.RequestMessage.RequestUri.AbsoluteUri} : {versionResStr}"); + } + finally + { + await StopCertifyService(certifyService); + } + } + + [TestMethod, Description("Validate that Certify.Service.exe returns a valid respose on route /api/system/updatecheck")] + public async Task TestCertifyServiceUpdateCheckRoute() + { + var certifyService = await StartCertifyService(); + + try + { + var updatesRawRes = await _httpClient.GetAsync("system/updatecheck"); + var updateRawResStr = await updatesRawRes.Content.ReadAsStringAsync(); + var updateRes = JsonConvert.DeserializeObject(updateRawResStr); + + Assert.AreEqual(HttpStatusCode.OK, updatesRawRes.StatusCode, $"Unexpected status code from GET {updatesRawRes.RequestMessage.RequestUri.AbsoluteUri}"); + Assert.IsFalse(updateRes.MustUpdate); + Assert.IsFalse(updateRes.IsNewerVersion); + Assert.AreEqual(updateRes.InstalledVersion.ToString(), updateRes.Version.ToString()); + Assert.AreEqual("", updateRes.UpdateFilePath); + } + finally + { + await StopCertifyService(certifyService); + } + } + + [TestMethod, Description("Validate that Certify.Service.exe returns a valid response on route /api/system/diagnostics")] + public async Task TestCertifyServiceDiagnosticsRoute() + { + var certifyService = await StartCertifyService(); + + try + { + var diagnosticsRawRes = await _httpClient.GetAsync("system/diagnostics"); + var diagnosticsRawResStr = await diagnosticsRawRes.Content.ReadAsStringAsync(); + var diagnosticsRes = JsonConvert.DeserializeObject>(diagnosticsRawResStr); + + Assert.AreEqual(HttpStatusCode.OK, diagnosticsRawRes.StatusCode, $"Unexpected status code from GET {diagnosticsRawRes.RequestMessage.RequestUri.AbsoluteUri}"); + Assert.AreEqual(4, diagnosticsRes.Count); + + Assert.AreEqual("Created test temp file OK.", diagnosticsRes[0].Message); + Assert.IsTrue(diagnosticsRes[0].IsSuccess); + Assert.IsFalse(diagnosticsRes[0].IsWarning); + Assert.AreEqual(null, diagnosticsRes[0].Result); + + Assert.AreEqual($"Drive {Environment.GetEnvironmentVariable("SystemDrive")} has more than 512MB of disk space free.", diagnosticsRes[1].Message); + Assert.IsTrue(diagnosticsRes[1].IsSuccess); + Assert.IsFalse(diagnosticsRes[1].IsWarning); + Assert.AreEqual(null, diagnosticsRes[1].Result); + + Assert.AreEqual("System time is correct.", diagnosticsRes[2].Message); + Assert.IsTrue(diagnosticsRes[2].IsSuccess); + Assert.IsFalse(diagnosticsRes[2].IsWarning); + Assert.AreEqual(null, diagnosticsRes[2].Result); + + Assert.AreEqual("PowerShell 5.0 or higher is available.", diagnosticsRes[3].Message); + Assert.IsTrue(diagnosticsRes[3].IsSuccess); + Assert.IsFalse(diagnosticsRes[3].IsWarning); + Assert.AreEqual(null, diagnosticsRes[3].Result); + } + finally + { + await StopCertifyService(certifyService); + } + } + + [TestMethod, Description("Validate that Certify.Service.exe returns a valid response on route /api/system/datastores/providers")] + public async Task TestCertifyServiceDatastoreProvidersRoute() + { + var certifyService = await StartCertifyService(); + + try + { + var datastoreProvidersRawRes = await _httpClient.GetAsync("system/datastores/providers"); + var datastoreProvidersRawResStr = await datastoreProvidersRawRes.Content.ReadAsStringAsync(); + var datastoreProvidersRes = JsonConvert.DeserializeObject>(datastoreProvidersRawResStr); + + Assert.AreEqual(HttpStatusCode.OK, datastoreProvidersRawRes.StatusCode, $"Unexpected status code from GET {datastoreProvidersRawRes.RequestMessage.RequestUri.AbsoluteUri}"); + } + finally + { + await StopCertifyService(certifyService); + } + } + + [TestMethod, Description("Validate that Certify.Service.exe returns a valid response on route /api/system/datastores/")] + public async Task TestCertifyServiceDatastoresRoute() { - var exitCode = Certify.Service.Program.Main(null); + var certifyService = await StartCertifyService(); - await Task.Delay(5000); + try + { + var datastoreRawRes = await _httpClient.GetAsync("system/datastores/"); + var datastoreRawResStr = await datastoreRawRes.Content.ReadAsStringAsync(); + var datastoreRes = JsonConvert.DeserializeObject>(datastoreRawResStr); - Assert.AreEqual(exitCode, 1067, "Unexpected exit code"); + Assert.AreEqual(HttpStatusCode.OK, datastoreRawRes.StatusCode, $"Unexpected status code from GET {datastoreRawRes.RequestMessage.RequestUri.AbsoluteUri}"); + Assert.IsTrue(datastoreRes.Count >= 1); + } + finally + { + await StopCertifyService(certifyService); + } } } +#endif } From 109f7c84086409b321d286c0fc6d5347a64b33fe Mon Sep 17 00:00:00 2001 From: Justin Nelson Date: Wed, 13 Dec 2023 20:09:16 -0800 Subject: [PATCH 118/118] Additional Certify.Service tests --- .../CertifyServiceTests.cs | 239 +++++++++++++++++- 1 file changed, 229 insertions(+), 10 deletions(-) diff --git a/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyServiceTests.cs b/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyServiceTests.cs index 87045f488..92a342980 100644 --- a/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyServiceTests.cs +++ b/src/Certify.Tests/Certify.Core.Tests.Unit/CertifyServiceTests.cs @@ -86,18 +86,19 @@ public async Task TestProgramMainStartsCli() Assert.IsTrue(cmdResult.StandardOutput.Contains("The Certify.Service$Debug service has stopped.")); } - [TestMethod, Description("Validate that Certify.Service.exe returns a valid response on route /api/system/appversion")] + [TestMethod, Description("Validate that Certify.Service.exe returns a valid response on route GET /api/system/appversion")] public async Task TestCertifyServiceAppVersionRoute() { var certifyService = await StartCertifyService(); try { - var versionRes = await _httpClient.GetAsync("system/appversion"); - var versionResStr = await versionRes.Content.ReadAsStringAsync(); - - Assert.AreEqual(HttpStatusCode.OK, versionRes.StatusCode, $"Unexpected status code from GET {versionRes.RequestMessage.RequestUri.AbsoluteUri}"); - StringAssert.Matches(versionResStr, new Regex(@"^""(\d+\.)?(\d+\.)?(\d+\.)?(\*|\d+)""$"), $"Unexpected response from GET {versionRes.RequestMessage.RequestUri.AbsoluteUri} : {versionResStr}"); + var versionRawRes = await _httpClient.GetAsync("system/appversion"); + var versionResStr = await versionRawRes.Content.ReadAsStringAsync(); + var versionRes = JsonConvert.DeserializeObject(versionResStr); + + Assert.AreEqual(HttpStatusCode.OK, versionRawRes.StatusCode, $"Unexpected status code from GET {versionRawRes.RequestMessage.RequestUri.AbsoluteUri}"); + StringAssert.Matches(versionRes, new Regex(@"^(\d+\.)?(\d+\.)?(\d+\.)?(\*|\d+)$"), $"Unexpected response from GET {versionRawRes.RequestMessage.RequestUri.AbsoluteUri} : {versionResStr}"); } finally { @@ -105,7 +106,7 @@ public async Task TestCertifyServiceAppVersionRoute() } } - [TestMethod, Description("Validate that Certify.Service.exe returns a valid respose on route /api/system/updatecheck")] + [TestMethod, Description("Validate that Certify.Service.exe returns a valid respose on route GET /api/system/updatecheck")] public async Task TestCertifyServiceUpdateCheckRoute() { var certifyService = await StartCertifyService(); @@ -128,7 +129,7 @@ public async Task TestCertifyServiceUpdateCheckRoute() } } - [TestMethod, Description("Validate that Certify.Service.exe returns a valid response on route /api/system/diagnostics")] + [TestMethod, Description("Validate that Certify.Service.exe returns a valid response on route GET /api/system/diagnostics")] public async Task TestCertifyServiceDiagnosticsRoute() { var certifyService = await StartCertifyService(); @@ -168,7 +169,7 @@ public async Task TestCertifyServiceDiagnosticsRoute() } } - [TestMethod, Description("Validate that Certify.Service.exe returns a valid response on route /api/system/datastores/providers")] + [TestMethod, Description("Validate that Certify.Service.exe returns a valid response on route GET /api/system/datastores/providers")] public async Task TestCertifyServiceDatastoreProvidersRoute() { var certifyService = await StartCertifyService(); @@ -187,7 +188,7 @@ public async Task TestCertifyServiceDatastoreProvidersRoute() } } - [TestMethod, Description("Validate that Certify.Service.exe returns a valid response on route /api/system/datastores/")] + [TestMethod, Description("Validate that Certify.Service.exe returns a valid response on route GET /api/system/datastores/")] public async Task TestCertifyServiceDatastoresRoute() { var certifyService = await StartCertifyService(); @@ -206,6 +207,224 @@ public async Task TestCertifyServiceDatastoresRoute() await StopCertifyService(certifyService); } } + + [TestMethod, Description("Validate that Certify.Service.exe returns a valid response on route POST /api/system/datastores/test")] + public async Task TestCertifyServiceDatastoresTestRoute() + { + var certifyService = await StartCertifyService(); + + try + { + var datastoreRawRes = await _httpClient.GetAsync("system/datastores/"); + var datastoreRawResStr = await datastoreRawRes.Content.ReadAsStringAsync(); + var datastoreRes = JsonConvert.DeserializeObject>(datastoreRawResStr); + + Assert.AreEqual(HttpStatusCode.OK, datastoreRawRes.StatusCode, $"Unexpected status code from GET {datastoreRawRes.RequestMessage.RequestUri.AbsoluteUri}"); + Assert.IsTrue(datastoreRes.Count >= 1); + + var datastoreTestRawRes = await _httpClient.PostAsJsonAsync("system/datastores/test", datastoreRes[0]); + var datastoreTestRawResStr = await datastoreTestRawRes.Content.ReadAsStringAsync(); + var datastoreTestRes = JsonConvert.DeserializeObject>(datastoreTestRawResStr); + + Assert.AreEqual(HttpStatusCode.OK, datastoreTestRawRes.StatusCode, $"Unexpected status code from POST {datastoreTestRawRes.RequestMessage.RequestUri.AbsoluteUri}"); + Assert.IsTrue(datastoreTestRes.Count >= 1); + } + finally + { + await StopCertifyService(certifyService); + } + } + + [TestMethod, Description("Validate that Certify.Service.exe returns a valid response on route POST /api/system/datastores/update")] + public async Task TestCertifyServiceDatastoresUpdateRoute() + { + var certifyService = await StartCertifyService(); + + try + { + var datastoreRawRes = await _httpClient.GetAsync("system/datastores/"); + var datastoreRawResStr = await datastoreRawRes.Content.ReadAsStringAsync(); + var datastoreRes = JsonConvert.DeserializeObject>(datastoreRawResStr); + + Assert.AreEqual(HttpStatusCode.OK, datastoreRawRes.StatusCode, $"Unexpected status code from GET {datastoreRawRes.RequestMessage.RequestUri.AbsoluteUri}"); + Assert.IsTrue(datastoreRes.Count >= 1); + + var datastoreUpdateRawRes = await _httpClient.PostAsJsonAsync("system/datastores/update", datastoreRes[0]); + var datastoreUpdateRawResStr = await datastoreUpdateRawRes.Content.ReadAsStringAsync(); + var datastoreUpdateRes = JsonConvert.DeserializeObject>(datastoreUpdateRawResStr); + + Assert.AreEqual(HttpStatusCode.OK, datastoreUpdateRawRes.StatusCode, $"Unexpected status code from POST {datastoreUpdateRawRes.RequestMessage.RequestUri.AbsoluteUri}"); + Assert.IsTrue(datastoreUpdateRes.Count >= 1); + } + finally + { + await StopCertifyService(certifyService); + } + } + + [TestMethod, Description("Validate that Certify.Service.exe returns a valid response on route POST /api/system/datastores/setdefault/{dataStoreId}")] + public async Task TestCertifyServiceDatastoresSetDefaultRoute() + { + var certifyService = await StartCertifyService(); + + try + { + var datastoreRawRes = await _httpClient.GetAsync("system/datastores/"); + var datastoreRawResStr = await datastoreRawRes.Content.ReadAsStringAsync(); + var datastoreRes = JsonConvert.DeserializeObject>(datastoreRawResStr); + + Assert.AreEqual(HttpStatusCode.OK, datastoreRawRes.StatusCode, $"Unexpected status code from GET {datastoreRawRes.RequestMessage.RequestUri.AbsoluteUri}"); + Assert.IsTrue(datastoreRes.Count >= 1); + + var datastoreSetDefaultRawRes = await _httpClient.PostAsync($"system/datastores/setdefault/{datastoreRes[0].Id}", new StringContent("")); + var datastoreSetDefaultRawResStr = await datastoreSetDefaultRawRes.Content.ReadAsStringAsync(); + var datastoreSetDefaultRes = JsonConvert.DeserializeObject>(datastoreSetDefaultRawResStr); + + Assert.AreEqual(HttpStatusCode.OK, datastoreSetDefaultRawRes.StatusCode, $"Unexpected status code from POST {datastoreSetDefaultRawRes.RequestMessage.RequestUri.AbsoluteUri}"); + Assert.IsTrue(datastoreSetDefaultRes.Count >= 1); + } + finally + { + await StopCertifyService(certifyService); + } + } + + [TestMethod, Description("Validate that Certify.Service.exe returns a valid response on route POST /api/system/datastores/delete")] + [Ignore] + public async Task TestCertifyServiceDatastoresDeleteRoute() + { + var certifyService = await StartCertifyService(); + + try + { + var datastoreRawRes = await _httpClient.GetAsync("system/datastores/"); + var datastoreRawResStr = await datastoreRawRes.Content.ReadAsStringAsync(); + var datastoreRes = JsonConvert.DeserializeObject>(datastoreRawResStr); + + Assert.AreEqual(HttpStatusCode.OK, datastoreRawRes.StatusCode, $"Unexpected status code from GET {datastoreRawRes.RequestMessage.RequestUri.AbsoluteUri}"); + Assert.IsTrue(datastoreRes.Count >= 1); + + var datastoreDeleteRawRes = await _httpClient.PostAsync("system/datastores/delete", new StringContent(datastoreRes[0].Id)); + var datastoreDeleteRawResStr = await datastoreDeleteRawRes.Content.ReadAsStringAsync(); + var datastoreDeleteRes = JsonConvert.DeserializeObject>(datastoreDeleteRawResStr); + + Assert.AreEqual(HttpStatusCode.OK, datastoreDeleteRawRes.StatusCode, $"Unexpected status code from POST {datastoreDeleteRawRes.RequestMessage.RequestUri.AbsoluteUri}"); + Assert.IsTrue(datastoreDeleteRes.Count >= 1); + + var datastoreUpdateRawRes = await _httpClient.PostAsJsonAsync("system/datastores/update", datastoreRes[0]); + var datastoreUpdateRawResStr = await datastoreUpdateRawRes.Content.ReadAsStringAsync(); + var datastoreUpdateRes = JsonConvert.DeserializeObject>(datastoreUpdateRawResStr); + + Assert.AreEqual(HttpStatusCode.OK, datastoreUpdateRawRes.StatusCode, $"Unexpected status code from POST {datastoreUpdateRawRes.RequestMessage.RequestUri.AbsoluteUri}"); + Assert.IsTrue(datastoreUpdateRes.Count >= 1); + } + finally + { + await StopCertifyService(certifyService); + } + } + + [TestMethod, Description("Validate that Certify.Service.exe returns a valid response on route POST /api/system/datastores/copy/{sourceId}/{destId}")] + [Ignore] + public async Task TestCertifyServiceDatastoresCopyRoute() + { + var certifyService = await StartCertifyService(); + + try + { + var datastoreRawRes = await _httpClient.GetAsync("system/datastores/"); + var datastoreRawResStr = await datastoreRawRes.Content.ReadAsStringAsync(); + var datastoreRes = JsonConvert.DeserializeObject>(datastoreRawResStr); + + Assert.AreEqual(HttpStatusCode.OK, datastoreRawRes.StatusCode, $"Unexpected status code from GET {datastoreRawRes.RequestMessage.RequestUri.AbsoluteUri}"); + Assert.IsTrue(datastoreRes.Count >= 1); + + var newDataStoreId = "default-copy"; + var datastoreCopyRawRes = await _httpClient.PostAsync($"system/datastores/copy/{datastoreRes[0].Id}/{newDataStoreId}", new StringContent("")); + var datastoreCopyRawResStr = await datastoreCopyRawRes.Content.ReadAsStringAsync(); + var datastoreCopyRes = JsonConvert.DeserializeObject>(datastoreCopyRawResStr); + + Assert.AreEqual(HttpStatusCode.OK, datastoreCopyRawRes.StatusCode, $"Unexpected status code from POST {datastoreCopyRawRes.RequestMessage.RequestUri.AbsoluteUri}"); + Assert.IsTrue(datastoreCopyRes.Count >= 1); + + datastoreRawRes = await _httpClient.GetAsync("system/datastores/"); + datastoreRawResStr = await datastoreRawRes.Content.ReadAsStringAsync(); + datastoreRes = JsonConvert.DeserializeObject>(datastoreRawResStr); + + Assert.AreEqual(HttpStatusCode.OK, datastoreRawRes.StatusCode, $"Unexpected status code from GET {datastoreRawRes.RequestMessage.RequestUri.AbsoluteUri}"); + Assert.IsTrue(datastoreRes.Count >= 2); + + var datastoreDeleteRawRes = await _httpClient.PostAsJsonAsync("system/datastores/delete", newDataStoreId); + var datastoreDeleteRawResStr = await datastoreDeleteRawRes.Content.ReadAsStringAsync(); + var datastoreDeleteRes = JsonConvert.DeserializeObject>(datastoreDeleteRawResStr); + + Assert.AreEqual(HttpStatusCode.OK, datastoreDeleteRawRes.StatusCode, $"Unexpected status code from POST {datastoreDeleteRawRes.RequestMessage.RequestUri.AbsoluteUri}"); + Assert.IsTrue(datastoreDeleteRes.Count >= 1); + } + finally + { + await StopCertifyService(certifyService); + } + } + + [TestMethod, Description("Validate that Certify.Service.exe returns a valid response on route GET /api/server/isavailable/{serverType}")] + public async Task TestCertifyServiceServerIsavailableRoute() + { + var certifyService = await StartCertifyService(); + + try + { + var isAvailableRawRes = await _httpClient.GetAsync($"server/isavailable/{StandardServerTypes.IIS}"); + var isAvailableRawResStr = await isAvailableRawRes.Content.ReadAsStringAsync(); + var isAvailableRes = JsonConvert.DeserializeObject(isAvailableRawResStr); + + Assert.AreEqual(HttpStatusCode.OK, isAvailableRawRes.StatusCode, $"Unexpected status code from GET {isAvailableRawRes.RequestMessage.RequestUri.AbsoluteUri}"); + Assert.IsTrue(isAvailableRes); + } + finally + { + await StopCertifyService(certifyService); + } + } + + [TestMethod, Description("Validate that Certify.Service.exe returns a valid response on route GET /api/server/sitelist/{serverType}")] + public async Task TestCertifyServiceServerSitelistRoute() + { + var certifyService = await StartCertifyService(); + + try + { + var sitelistRawRes = await _httpClient.GetAsync($"server/sitelist/{StandardServerTypes.IIS}"); + var sitelistRawResStr = await sitelistRawRes.Content.ReadAsStringAsync(); + var sitelistRes = JsonConvert.DeserializeObject>(sitelistRawResStr); + + Assert.AreEqual(HttpStatusCode.OK, sitelistRawRes.StatusCode, $"Unexpected status code from GET {sitelistRawRes.RequestMessage.RequestUri.AbsoluteUri}"); + } + finally + { + await StopCertifyService(certifyService); + } + } + + [TestMethod, Description("Validate that Certify.Service.exe returns a valid response on route GET /api/server/version/{serverType}")] + public async Task TestCertifyServiceServerVersionRoute() + { + var certifyService = await StartCertifyService(); + + try + { + var versionRawRes = await _httpClient.GetAsync($"server/version/{StandardServerTypes.IIS}"); + var versionRawResStr = await versionRawRes.Content.ReadAsStringAsync(); + var versionRes = JsonConvert.DeserializeObject(versionRawResStr); + + Assert.AreEqual(HttpStatusCode.OK, versionRawRes.StatusCode, $"Unexpected status code from GET {versionRawRes.RequestMessage.RequestUri.AbsoluteUri}"); + StringAssert.Matches(versionRes, new Regex(@"^(\d+\.)?(\*|\d+)$"), $"Unexpected response from GET {versionRawRes.RequestMessage.RequestUri.AbsoluteUri} : {versionRawResStr}"); + } + finally + { + await StopCertifyService(certifyService); + } + } } #endif }