Skip to content
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 #264

Closed
PlagueHO opened this issue Sep 1, 2017 · 0 comments · Fixed by #265
Closed

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

PlagueHO opened this issue Sep 1, 2017 · 0 comments · Fixed by #265
Assignees
Labels
bug The issue is a bug. in progress The issue is being actively worked on by someone.

Comments

@PlagueHO
Copy link
Member

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

If you replace these rows

https://github.com/PowerShell/xNetworking/blob/0a99574386a0f1d9596ea587d2a6131b55727c8f/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 )
    }
@PlagueHO PlagueHO added bug The issue is a bug. in progress The issue is being actively worked on by someone. labels Sep 1, 2017
@PlagueHO PlagueHO self-assigned this Sep 1, 2017
PlagueHO added a commit that referenced this issue Sep 2, 2017
Prevent unit tests in DSCResource.Tests from running - Fixes #264
@SteveL-MSFT SteveL-MSFT added this to In progress in powershell/dscresources May 14, 2019
@SteveL-MSFT SteveL-MSFT removed this from In progress in powershell/dscresources Nov 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug. in progress The issue is being actively worked on by someone.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant