8000 Move misplaced test file to tests directory by MarianoAlipi · Pull Request #14908 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@MarianoAlipi
Copy link
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

@ghost ghost assigned TravisEz13 Feb 26, 2021
rjmholt
rjmholt previously approved these changes Feb 26, 2021
@TravisEz13
Copy link
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

@TravisEz13 TravisEz13 dismissed rjmholt’s stale review March 2, 2021 00:35

Approved with failing tests

@MarianoAlipi
Copy link
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
Collaborator
rjmholt commented Mar 2, 2021

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

@iSazonov
Copy link
Collaborator
iSazonov commented Mar 3, 2021

Looks like the file was added by @iSazonov in #11813. @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
Collaborator
iSazonov commented Mar 8, 2021

/azp run PowerShell-CI-static-analysis

@azure-pipelines
Copy link
Azure Pipelines successfully started running 1 pipeline(s).

@iSazonov 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 iSazonov assigned iSazonov and unassigned TravisEz13 Mar 8, 2021
@iSazonov iSazonov merged commit ae5a84e into PowerShell:master Mar 8, 2021
@iSazonov
Copy link
Collaborator
iSazonov commented Mar 8, 2021

@MarianoAlipi Thanks for your contribution!

@MarianoAlipi
Copy link
Contributor Author

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

@ghost
Copy link
ghost commented Mar 16, 2021

🎉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
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

0