diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 19d349d5..90c6a0de 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,6 +39,13 @@ jobs: env: CONFIGURATION: ${{ matrix.configuration }} CI: true + - name: Test Report + uses: dorny/test-reporter@v1 + if: always() + with: + name: Test Results (${{ matrix.os }}-${{ matrix.configuration }}) + path: '**/TestResults/testResults*.trx' + reporter: dotnet-trx # Builds the project in a dev container build-devcontainer: diff --git a/Content/Console/.github/workflows/build.yml b/Content/Console/.github/workflows/build.yml index fcc4c213..f029d73f 100644 --- a/Content/Console/.github/workflows/build.yml +++ b/Content/Console/.github/workflows/build.yml @@ -49,6 +49,13 @@ jobs: env: CONFIGURATION: ${{ matrix.configuration }} CI: true + - name: Test Report + uses: dorny/test-reporter@v1 + if: always() + with: + name: Test Results (${{ matrix.os }}-${{ matrix.configuration }}) + path: '**/TestResults/testResults*.trx' + reporter: dotnet-trx # Builds the project in a dev container build-devcontainer: runs-on: ubuntu-latest diff --git a/Content/Console/build/build.fs b/Content/Console/build/build.fs index 222a5ec9..08b7b784 100644 --- a/Content/Console/build/build.fs +++ b/Content/Console/build/build.fs @@ -345,6 +345,7 @@ let dotnetTest ctx = c with MSBuildParams = disableBinLog c.MSBuildParams Configuration = configuration (ctx.Context.AllExecutingTargets) + Logger = Some "trx;LogFilePrefix=testResults" Common = c.Common |> DotNet.Options.withAdditionalArgs args diff --git a/Content/Library/.github/workflows/build.yml b/Content/Library/.github/workflows/build.yml index 3b7b7e52..7806071f 100644 --- a/Content/Library/.github/workflows/build.yml +++ b/Content/Library/.github/workflows/build.yml @@ -39,6 +39,13 @@ jobs: CI: true CONFIGURATION: ${{ matrix.configuration }} ENABLE_COVERAGE: true + - name: Test Report + uses: dorny/test-reporter@v1 + if: always() + with: + name: Test Results (${{ matrix.os }}-${{ matrix.configuration }}) + path: '**/TestResults/testResults*.trx' + reporter: dotnet-trx # Builds the project in a dev container build-devcontainer: runs-on: ubuntu-latest diff --git a/Content/Library/build/build.fs b/Content/Library/build/build.fs index d4ea8943..90672019 100644 --- a/Content/Library/build/build.fs +++ b/Content/Library/build/build.fs @@ -436,6 +436,7 @@ let dotnetTest ctx = c with MSBuildParams = disableBinLog c.MSBuildParams Configuration = configuration (ctx.Context.AllExecutingTargets) + Logger = Some "trx;LogFilePrefix=testResults" Common = c.Common |> DotNet.Options.withAdditionalArgs args diff --git a/build/build.fs b/build/build.fs index 80cd213c..46afb699 100644 --- a/build/build.fs +++ b/build/build.fs @@ -351,35 +351,36 @@ let getPkgPath () = let integrationTests ctx = !!testsGlob |> Seq.iter (fun proj -> + let runSettingsArgs = + if isCI.Value then + [ + "--" + "Expecto.fail-on-focused-tests=true" + ] + else + [] - dotnet.run - (fun c -> - - let args = - [ - // sprintf "-C %A" (configuration (ctx.Context.AllExecutingTargets)) - sprintf "--project %s" proj - "--summary" - if isCI.Value then - "--fail-on-focused-tests" - ] - |> String.concat " " - - { - c with - CustomParams = Some args - Environment = - c.Environment - |> Map.add "MINISCAFFOLD_NUPKG_LOCATION" (getPkgPath ()) - // Configuration = configuration (ctx.Context.AllExecutingTargets) - // Common = - // c.Common - // |> DotNet.Options.withCustomParams - // (Some(args)) - } - ) - "" - |> failOnBadExitAndPrint + DotNet.test + (fun c -> { + c with + Configuration = configuration (ctx.Context.AllExecutingTargets) + Logger = Some "console;verbosity=detailed" + Common = + { + c.Common with + Environment = + c.Common.Environment + |> Map.add "MINISCAFFOLD_NUPKG_LOCATION" (getPkgPath ()) + } + |> DotNet.Options.withAdditionalArgs ( + [ + "--logger" + "trx;LogFilePrefix=testResults" + ] + @ runSettingsArgs + ) + }) + proj ) let dotnetPack ctx =