Skip to content

Move misplaced test file to tests directory - #14908

Merged
Ilya (iSazonov) merged 2 commits into
PowerShell:masterfrom
MarianoAlipi:master
Mar 8, 2021
Merged

Move misplaced test file to tests directory#14908
Ilya (iSazonov) merged 2 commits into
PowerShell:masterfrom
MarianoAlipi:master

Conversation

@MarianoAlipi

Copy link
Copy Markdown
Contributor

PR Summary

Fix #14832
Move file src/System.Management.Automation/engine/Modules/ImportProvider.Tests.ps1 to test/powershell/Modules/Microsoft.PowerShell.Core/ImportProvider.Tests.ps1

PR Context

This pull request is a simple fix to issue #14832

PR Checklist

@TravisEz13

Copy link
Copy Markdown
Member

Importprovider is now failing...

Describing Import PowerShell provider
    [-] Import a PowerShell provider with correct name
      Expected exactly 'ReproModule\SamplePrv::test.txt', but got $null.
      66:         $result.PSPath | Should -BeExactly "ReproModule\SamplePrv::test.txt"
      at <ScriptBlock>, D:\a\1\s\test\powershell\Modules\Microsoft.PowerShell.Core\ImportProvider.Tests.ps1: line 66

@MarianoAlipi

Copy link
Copy Markdown
Contributor Author

I suppose that test wasn't being run so it didn't show any errors before. The ReproModule directory it tries to import doesn't exist anywhere in the repository. So I'm thinking there are missing files or the test was only temporary and slipped into the repository. What should we do?

@rjmholt

Copy link
Copy Markdown
Collaborator

Looks like the file was added by Ilya (@iSazonov) in #11813. Ilya (@iSazonov) what's the right way to make these tests work?

@iSazonov

Copy link
Copy Markdown
Collaborator

Looks like the file was added by Ilya (@iSazonov) in #11813. Ilya (@iSazonov) what's the right way to make these tests work?

It's mystic how it happened :-(

We should replace:

    It "Import a PowerShell provider with correct name" {
        $result = & $pwsh -NoProfile -Command "Import-Module -Name $testModulePath; Get-Item ReproModule\SamplePrv::test.txt"
        $result.PSPath | Should -BeExactly "ReproModule\SamplePrv::test.txt"
    }

with

    It "Import a PowerShell provider with correct name" {
        $result = & $pwsh -NoProfile -Command "Import-Module -Name $testModulePath; (Get-Item ReproModule\SamplePrv::test.txt).PSPath"
        $result | Should -BeExactly "ReproModule\SamplePrv::test.txt"
    }

@iSazonov

Copy link
Copy Markdown
Collaborator

/azp run PowerShell-CI-static-analysis

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@iSazonov Ilya (iSazonov) added the CL-Test Indicates that a PR should be marked as a test change in the Change Log label Mar 8, 2021
@iSazonov
Ilya (iSazonov) merged commit ae5a84e into PowerShell:master Mar 8, 2021
@iSazonov

Copy link
Copy Markdown
Collaborator

Mariano Alipi (@MarianoAlipi) Thanks for your contribution!

@MarianoAlipi

Copy link
Copy Markdown
Contributor Author

Thank you everyone for your help during the whole process! :)

@ghost

Copy link
Copy Markdown

🎉v7.2.0-preview.4 has been released which incorporates this pull request.:tada:

Handy links:

@ghost ghost mentioned this pull request Mar 16, 2021
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/PowerShell that referenced this pull request Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-Test Indicates that a PR should be marked as a test change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test file in the wrong place

4 participants