Skip to content

Commit

Permalink
Changes to DscResource.Tests
Browse files Browse the repository at this point in the history
- Added more tests for custom Script Analazyer rules to increased code coverage.
  These new tests call the Measure-functions directly.
- Changed so that DscResource.Tests repository can analyze code coverage for the
  helper modules (issue PowerShell#208).
  • Loading branch information
johlju committed Apr 19, 2018
1 parent 62cca02 commit 188be06
Show file tree
Hide file tree
Showing 3 changed files with 1,420 additions and 225 deletions.
35 changes: 25 additions & 10 deletions AppVeyor.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -277,18 +277,33 @@ function Invoke-AppveyorTestScriptTask
"$env:APPVEYOR_BUILD_FOLDER\*.psm1"
)

# Define the folders to check, if found add the path for codecoverage
$possibleModulePaths = @(
'DSCResources',
'DSCClassResources'
)

foreach ($possibleModulePath in $possibleModulePaths)
if (Test-IsRepositoryDscResourceTests)
{
<#
The repository being tested is DscResource.Tests.
DscResource.Tests need a different set of paths for
code coverage.
#>
$codeCoveragePaths += "$env:APPVEYOR_BUILD_FOLDER\**\*.psm1"
}
else
{
if (Test-Path -Path "$env:APPVEYOR_BUILD_FOLDER\$possibleModulePath")
<#
Define the folders to check, if found add the path for
code coverage.
#>
$possibleModulePaths = @(
'DSCResources',
'DSCClassResources'
)

foreach ($possibleModulePath in $possibleModulePaths)
{
$codeCoveragePaths += "$env:APPVEYOR_BUILD_FOLDER\$possibleModulePath\*.psm1"
$codeCoveragePaths += "$env:APPVEYOR_BUILD_FOLDER\$possibleModulePath\**\*.psm1"
if (Test-Path -Path "$env:APPVEYOR_BUILD_FOLDER\$possibleModulePath")
{
$codeCoveragePaths += "$env:APPVEYOR_BUILD_FOLDER\$possibleModulePath\*.psm1"
$codeCoveragePaths += "$env:APPVEYOR_BUILD_FOLDER\$possibleModulePath\**\*.psm1"
}
}
}

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,10 @@ These are the artifacts that differ when running tests using a container.
* Updated year in DscResources.Tests.psd1 manifest to 2018.
* Fixed bug where common test would throw an error if there were no
.MetaTestOptIn.json file or it was empty (no opt-ins).
* Added more tests for custom Script Analazyer rules to increased code coverage.
These new tests call the Measure-functions directly.
* Changed so that DscResource.Tests repository can analyze code coverage for the
helper modules ([issue #208](https://github.com/PowerShell/DscResource.Tests/issues/208)).

### 0.2.0.0

Expand Down
Loading

0 comments on commit 188be06

Please sign in to comment.