Pester, coverage in Appveyor - #2499
Merged
Merged
Conversation
wsmelton
approved these changes
Oct 24, 2017
wsmelton
left a comment
Member
There was a problem hiding this comment.
I actually understood a portion of this ⛅️
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
Purpose 1
Complementing #2411, this brings code coverage to codecov.io for ps1 files.
This will make codecov.io the entry point for tests creators to see what is currently covered (with all intricacies of PS coverage, see this) and what is not, line by line.
Coincidentally, it will also bring closer attention to what is tested and how to "the public".
On top of it, it'll - probably - foster:
Purpose 2
Bringing "autodetection" of the correct build in the appveyor build matrix without further fiddling with pester.groups.ps1.
For "unaware of the details" people, let's go back one step: running two concurrent instances on appveyor has proven to be resource-intensive and prone to random failures.
A build matrix has been prepared to let tests which DO NOT NEED both instances up and running to have more resources at their disposal.
Those builds are "scenarios":
Everyone should try to NOT end up in the
defaultscenario, which should be needed only forCopy-*functions.The autodetection logic follows these rules:
2016_service)2008R2)$script:instance1on 2008R2,$script:instance2on 2016)defaultscenario run everything that is not specifically tied (2016_service), containing BOTH$script:instance1and$script:instance2)Additional care has been taken if for some reason in the future one wants to write a test scenario that needs to go separately on multiple builds (i.e. a test file on
2008R2and a test file on2016, not ending up in thedefaultscenario): it's sufficient to create:$script:instance1)$script:instance2)Approach
Coverage is brought you by inferencing dependencies automatically (no AST here yet, see
Get-CoverageIndicationswithin appveyor.pester.ps1), as sending every function to pester'sCodeCoverageparameter takes up zillions of resources (both CPU and RAM).The report to codecov.io is custom-made following codecov.io documentation, as the default jacoco one in latest pester releases does not bring line-by-line information (we should probably raise a PR to pester's repo, adding a new output format).
Autodetection is brought by scanning the test files for occurrences of
$script:instance1on 2008R2,$script:instance2on 2016, logic is in appveyor.pester.ps1Improvements, in later PRs