From 9b5a7a8d845951af0f8975534273f286c2d502f4 Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Fri, 9 Aug 2019 14:00:35 -0500 Subject: [PATCH] Add test results to AppVeyor --- .gitignore | 3 ++- FunctionalCuid.Tests/Program.fs | 4 +++- FunctionalCuid.Tests/paket.references | 1 + appveyor.yml | 9 ++++++--- paket.dependencies | 1 + paket.lock | 3 +++ 6 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index f9cb0ce..d425513 100644 --- a/.gitignore +++ b/.gitignore @@ -30,7 +30,8 @@ bld/ #wwwroot/ # MSTest test Results -[Tt]est[Rr]esult*/ +**/[Tt]est[Rr]esult* +**/[Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* # NUNIT diff --git a/FunctionalCuid.Tests/Program.fs b/FunctionalCuid.Tests/Program.fs index be67f5e..d8ae517 100644 --- a/FunctionalCuid.Tests/Program.fs +++ b/FunctionalCuid.Tests/Program.fs @@ -186,4 +186,6 @@ module SlugTests = [] let main argv = - runTestsInAssembly defaultConfig argv + let writeResults = TestResults.writeNUnitSummary ("TestResults.xml", "Expecto.Tests") + let config = defaultConfig.appendSummaryHandler writeResults + runTestsInAssembly config argv diff --git a/FunctionalCuid.Tests/paket.references b/FunctionalCuid.Tests/paket.references index 1df5f87..0abdf54 100644 --- a/FunctionalCuid.Tests/paket.references +++ b/FunctionalCuid.Tests/paket.references @@ -1 +1,2 @@ Expecto +Expecto.TestResults diff --git a/appveyor.yml b/appveyor.yml index ebb6bbb..cb8cf7d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,12 +3,15 @@ os: Visual Studio 2019 build_script: - cmd: dotnet tool install --global paket - cmd: dotnet restore FunctionalCuid.sln - - cmd: dotnet build -v n FunctionalCuid.sln + - cmd: dotnet build -v n --configuration Release FunctionalCuid\FunctionalCuid.fsproj + - cmd: dotnet build -v n FunctionalCuid\FunctionalCuid.Tests.fsproj - cmd: dotnet pack FunctionalCuid\FunctionalCuid.fsproj -o %CD%\artifacts\nupkg artifacts: - path: artifacts\nupkg\*.nupkg test_script: - - cmd: cd FunctionalCuid.Tests - - cmd: dotnet run + - ps: cd FunctionalCuid.Tests + - ps: dotnet run + - ps: $wc = New-Object 'System.Net.WebClient' + - ps: $wc.UploadFile("https://ci.appveyor.com/api/testresults/xunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\TestResults.xml)) diff --git a/paket.dependencies b/paket.dependencies index e7b76a4..ed1f2c3 100644 --- a/paket.dependencies +++ b/paket.dependencies @@ -2,3 +2,4 @@ source https://www.nuget.org/api/v2 nuget FSharp.Core nuget Expecto +nuget Expecto.TestResults diff --git a/paket.lock b/paket.lock index ae24c2d..0d33608 100644 --- a/paket.lock +++ b/paket.lock @@ -3,6 +3,9 @@ NUGET Expecto (8.11) FSharp.Core (>= 4.3.4) - restriction: || (>= net461) (>= netstandard2.0) Mono.Cecil (>= 0.10.3) - restriction: || (>= net461) (>= netstandard2.0) + Expecto.TestResults (8.11) + Expecto (>= 8.11) - restriction: || (>= net461) (>= netstandard2.0) + FSharp.Core (>= 4.3.4) - restriction: || (>= net461) (>= netstandard2.0) FSharp.Core (4.7) Microsoft.NETCore.Platforms (2.2.2) - restriction: || (&& (< monoandroid) (< net35) (< netstandard1.3) (>= netstandard2.0) (< win8) (< wpa81)) (&& (< monoandroid) (< net35) (< netstandard1.5) (>= netstandard2.0) (< win8) (< wpa81)) (&& (< monoandroid) (< net35) (>= netstandard2.0) (< xamarinios) (< xamarinmac)) (&& (< net35) (>= net461)) Microsoft.NETCore.Targets (2.1) - restriction: || (&& (< monoandroid) (< net35) (< netstandard1.3) (>= netstandard2.0) (< win8) (< wpa81)) (&& (< monoandroid) (< net35) (< netstandard1.5) (>= netstandard2.0) (< win8) (< wpa81)) (&& (< monoandroid) (< net35) (>= netstandard2.0) (< xamarinios) (< xamarinmac)) (&& (< net35) (>= net461))