From 96568676a3d5359b37894c7047713e5d4163e0a7 Mon Sep 17 00:00:00 2001 From: Michael LoPresti Date: Sat, 14 Oct 2023 22:18:14 -0700 Subject: [PATCH] better actions output --- .gitignore | 5 ++++- ValidateJson.build.ps1 | 10 ++++++++-- tools/dev-init.ps1 | 7 +++++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 56e2d15..59d9897 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,7 @@ src/ValidateJson.nuspec src/ValidateJson.psd1 dist -coverage.xml \ No newline at end of file +coverage.xml +test\**\** +test\result\Pester-Test-Result.XML +testResults.xml diff --git a/ValidateJson.build.ps1 b/ValidateJson.build.ps1 index b2807b5..889a828 100644 --- a/ValidateJson.build.ps1 +++ b/ValidateJson.build.ps1 @@ -116,8 +116,14 @@ task analyze { task test { if($ci){ New-Item -Path "$BuildRoot\test\" -Name "result" -ItemType "directory" -Force | out-null - Invoke-Pester -OutputFile "$BuildRoot\test\result\Pester-Test-Result.XML" ` - -OutputFormat "JUnitXML" + $pesterConfig = New-PesterConfiguration -Hashtable @{ + TestResult=@{ + Enabled=$true + OutputPath="\test\result\Pester-Test-Result.XML" + OutputFormat="JUnitXml" + } + } + Invoke-Pester -Configuration $pesterConfig # Invoke-Pester -CodeCoverage "$BuildRoot\src\$module_name.psm1" ` # -CodeCoverageOutputFile "$BuildRoot\test\result\Pester-Coverage.xml" ` # -CodeCoverageOutputFileFormat JaCoCo diff --git a/tools/dev-init.ps1 b/tools/dev-init.ps1 index 145fd8c..6634a0b 100644 --- a/tools/dev-init.ps1 +++ b/tools/dev-init.ps1 @@ -1,5 +1,8 @@ -Install-Module InvokeBuild,PSScriptAnalyzer,platyPS -Scope CurrentUser -Force -Install-Module Pester -Scope CurrentUser -MinimumVersion "5.0.0" +Install-Module "InvokeBuild","PSScriptAnalyzer","platyPS" -Scope CurrentUser -Force +Install-Module "Pester" -Scope CurrentUser -MinimumVersion "5.0.0" -Force + +Write-host "Module Versions are" +Get-Module -ListAvailable "InvokeBuild","PSScriptAnalyzer","platyPS","Pester" | Select-Object Name,Version if($(winget list --id Microsoft.NuGet --disable-interactivity --accept-source-agreements|out-string) -like '*No installed package found*') { winget install -e --id Microsoft.NuGet --disable-interactivity --accept-source-agreements