You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a source file suppress the rule PSAvoidUsingWriteHost, for example in the source file in the relative path SharePointDsc/Modules/SharePointDsc.Reverse/SharePointDsc.Reverse.psm1:
$ExcludeSourceFile is not passed down to/available in the filter. I think the logic on the if statement is broken too, but without the exclusions being seen in the filter it never does anything.
Details of the scenario you tried and the problem that is occurring
When running the HQRM test for a repo using Pester 4 it seems it fails to exclude source files that are excluded in the build configuration.
Se more information in PR dsccommunity/SharePointDsc#1440.
Steps to reproduce the problem
In a source file suppress the rule PSAvoidUsingWriteHost, for example in the source file in the relative path
SharePointDsc/Modules/SharePointDsc.Reverse/SharePointDsc.Reverse.psm1
:Then try to exclude the relative path in the build configuration:
Expected behavior
Should exclude the file and the tests should not fail.
Current behavior
Does not exclude the file and the test fails due to suppressing a required rule.
Suggested solution to the issue
It should exclude the source files according to the code but it doesn't happen. Haven't debugged so not sure where the issue is.
It should filter out the excluded files here:
DscResource.Test/source/Tests/QA/PSSAResource.common.v4.Tests.ps1
Line 82 in 14acda0
Using the filter:
DscResource.Test/source/Private/WhereSourceFileNotExcluded.ps1
Line 1 in 14acda0
The operating system the target node is running
Windows and also using Pester 4
Version and build of PowerShell the target node is running
PowerShell 5.1
Version of the module that was used
v0.16.3
The text was updated successfully, but these errors were encountered: