Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Xainey/PSTestReport
Simple Bootstrap PowerShell Test Report
https://github.com/Xainey/PSTestReport
Last synced: about 2 months ago
JSON representation
Simple Bootstrap PowerShell Test Report
- Host: GitHub
- URL: https://github.com/Xainey/PSTestReport
- Owner: Xainey
- License: mit
- Created: 2017-01-27T04:58:03.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-24T16:58:50.000Z (almost 8 years ago)
- Last Synced: 2024-08-02T17:31:54.192Z (5 months ago)
- Language: HTML
- Size: 186 KB
- Stars: 39
- Watchers: 4
- Forks: 10
- Open Issues: 2
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# PSTestReport
Early example to generate a static PowerShell test report.
CDN references are included for most common libraries.
The output could be reduced to a single file or the additional common assets served by a web server.
Must export Pester and PSScript Analyzer results to JSON.
## Step 1: Run/Save tests
```
$testresults = Invoke-Pester -CodeCoverage "*.ps1" -PassThru
$testresults | ConvertTo-Json -Depth 5 | Set-Content ".\artifacts\PesterResults.json"$SAResults = Invoke-ScriptAnalyzer -Path . -Severity @('Error', 'Warning') -Recurse -Verbose:$false
$SAResults | ConvertTo-Json | Set-Content ".\artifacts\ScriptAnalysisResults.json"
```## Step 2: Run Invoke-PSTestReport script
```
# Example:
$options = @{
BuildNumber = 0
GitRepo = "Xainey/PSHitchhiker"
GitRepoURL = "https://github.com/Xainey/PSHitchhiker"
CiURL = "http://jenkins/job/PSHitchhiker/"
ShowHitCommands = $false
Compliance = 0.4
ScriptAnalyzerFile = ".\artifacts\ScriptAnalyzerResults.json"
PesterFile = ".\artifacts\PesterResults.json"
OutputDir = ".\artifacts"
}.\Invoke-PSTestReport.ps1 @options
```## Example
![HitchHikersGuide](powershell-test-report-fail.png)
## Example with sidebar in Jenkins
![HitchHikersGuide](powershell-test-report-pass.png)