In AppVeyor.psm1 there should be an option to change how we detect the files that need code coverage #114
Comments
This does not affect resource modules, like SharePointDsc, that uses the Harness-model. Those resource modules control the code coverage them self by having all testing logic in the harness function in the individual repo. Below is improving functionality for the default shared model. Currently it catches all module files (*.psm1) recursively in the folders added here. DscResource.Tests/AppVeyor.psm1 Lines 279 to 282 in 7fcd524
And as a workaround for resource modules that (wrongly) has helper modules in the root folder this is added as well DscResource.Tests/AppVeyor.psm1 Lines 260 to 262 in 7fcd524
We should instead add a Modules folder to the list above, should be located in the root as well. In the Modules folder a resource module helper modules can be located (as .psm1). This should be updated in the DscResource.Template as well. We could add the $possibleModulePaths = @(
'DSCResources',
'DSCClassResources',
'Modules'
) |
@PlagueHO This would help with the code coverage in for example CertificateDsc? To find if there are parts of the modules that are not covered by tests? |
- Add a new parameter `-CoverageModulePath` in the function `Invoke-AppveyorTestScriptTask` to be able to add one or more relative paths for which will be evaluated for PowerShell modules files (.psm1) (issue PowerShell#114).
Did a test of this with CertificateDsc, and it seems it the helper function are covered. The code coverage percentage dropped, which is positive. |
- Add a new parameter `-CoverageModulePath` in the function `Invoke-AppveyorTestScriptTask` to be able to add one or more relative paths for which will be evaluated for PowerShell modules files (.psm1) (issue PowerShell#114).
- Add a new parameter `-CoverageModulePath` in the function `Invoke-AppveyorTestScriptTask` to be able to add one or more relative paths for which will be evaluated for PowerShell modules files (.psm1) (issue PowerShell#114).
- Add a new parameter `-CoverageModulePath` in the function `Invoke-AppveyorTestScriptTask` to be able to add one or more relative paths for which will be evaluated for PowerShell modules files (.psm1) (issue PowerShell#114).
- Add a new parameter `-CoverageModulePath` in the function `Invoke-AppveyorTestScriptTask` to be able to add one or more relative paths for which will be evaluated for PowerShell modules files (.psm1) (issue PowerShell#114).
- Add a new parameter `-CodeCoveragePath` in the function `Invoke-AppveyorTestScriptTask` to be able to add one or more relative paths which will be searched for PowerShell modules files (.psm1) to be used for evaluating code coverage (issue #114). - The Modules folder, in the resource module root path, was added as a default path to be searched for PowerShell modules files (.psm1) to be used for evaluating code coverage.
The task to do this in #88 was added because I was going to write the code to do the detection of the files that needed code coverage. Since this was community provided. Let's assume it's sufficient. I'm filing thing just to keep the idea in mind and open it to a discussion.
The text was updated successfully, but these errors were encountered: