Skip to content

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

Description

@PlagueHO

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:
dsccommunity/NetworkingDsc#263 (comment)

If you replace these rows

https://github.com/PowerShell/xDFS/blob/5593443d031a9179c59880f5cf6629c1c0196ff1/Tests/TestHarness.psm1#L42-L45

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 )
    }

Metadata

Metadata

Assignees

Labels

bugThe issue is a bug.in progressThe issue is being actively worked on by someone.

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions