New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Failing Tests due to changes in DSCResource.Tests #118

PlagueHO opened this Issue Sep 1, 2017 · 0 comments


None yet
1 participant

PlagueHO commented Sep 1, 2017

A recent change in DSCResource.Tests (PowerShell/DscResource.Tests#186) caused the unit tests for the DSCResource.Tests module itself to be executed during the test run in this module.

For non-harness type modules this is being fixed in DSCResource.Tests itself, but for harness type, this must be fixed using this suggested change:
PowerShell/NetworkingDsc#263 (comment)

If you replace these rows

With these rows, it will not run the test that is failing

    if ($PSBoundParameters.ContainsKey('DscTestsPath') -eq $true)
        $getChildItemParameters = @{
            Path = $DscTestsPath
            Recurse = $true
            Filter = '*.Tests.ps1'

        # Get all tests '*.Tests.ps1'.
        $commonTestFiles = Get-ChildItem @getChildItemParameters

        # Remove DscResource.Tests unit and integration tests.
        $commonTestFiles = $commonTestFiles | Where-Object -FilterScript {
            $_.FullName -notmatch 'DSCResource.Tests\\Tests'

        $testsToRun += @( $commonTestFiles.FullName )

@PlagueHO PlagueHO self-assigned this Sep 1, 2017

@PlagueHO PlagueHO closed this in #119 Sep 2, 2017

PlagueHO added a commit that referenced this issue Sep 2, 2017

Merge pull request #119 from PlagueHO/Issue-118
Prevent unit tests in DSCResource.Tests from running - Fixes #118
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment