- Fix PSScriptAnalyzer warnings of type PSAvoidUsingCmdletAliases for 'ForEach-Object' (alias is '%' or 'foreach') - Fix PSScriptAnalyzer warnings of type PSAvoidUsingCmdletAliases for 'Where-Object' (alias is '?' or 'where') - Fix PSScriptAnalyzer warnings of type PSAvoidUsingCmdletAliases for 'Select-Object' (alias is 'select') - Fix PSScriptAnalyzer warnings of type PSPossibleIncorrectComparisonWithNull. Essentially, $null has to be on the left-hand side when using it for comparison. - A Test in ParameterBinding.Tests.ps1 needed adapting as this test used to rely on the wrong null comparison - Replace a subset of tests of kind '($object -eq $null) | Should Be $true' with '$object | Should Be $null' |
||
---|---|---|
.. | ||
README.md | ||
Start-CodeCoverageRun.ps1 |
Code Coverage Automation
The script Start-CodeCoverageRun.ps1 automates the execution of tests and uploading the results to Coveralls.io.
The script is self contained and can be executed on any Windows system which supports Powershell v5.0 or above. It has not been tested on Powershell v6.0.
Execution
The virtual machine hosting the script has a scheduled task to start the tests at 5 am PDT.
The script follows the steps below:
- Download the code coverage binaries package from AppVeyor nightly builds artifacts (CodeCoverage.zip).
- Download the OpenCover powershell module from AppVeyor nightly builds artifacts. (OpenCover.zip)
- Download the tests from AppVeyor nightly builds artifacts (tests.zip)
- Download Coveralls.net from 'https://github.com/csMACnz/coveralls.net/releases/download/0.7.0/coveralls.net.0.7.0.nupkg'
- Invoke 'Install-OpenCover' to install OpenCover toolset.
- Invoke 'Invoke-OpenCover' to execute tests.
- Invoke powershell to get the git commit ID of the downloaded daily build package.
- Using the commit ID get committer info like, message, author and email using the github REST API.
- Invoke 'csmacnz.Coveralls.exe' to upload the coverage results to Coveralls.net
The uploaded coverage data can be viewed at: https://coveralls.io/github/PowerShell/PowerShell