Skip to content

PowerShellGet: Change AllUsers scope install location to SHARED_MODULES path - #5633

Merged
Dongbo Wang (daxian-dbw) merged 1 commit into
PowerShell:masterfrom
bmanikm:updatepsgettestscript
Dec 7, 2017
Merged

Dongbo Wang (daxian-dbw) merged 1 commit into
PowerShell:masterfrom
bmanikm:updatepsgettestscript

Conversation

@bmanikm

@bmanikm Manikyam Bavandla (bmanikm) commented Dec 6, 2017 •

Copy link
Copy Markdown
Contributor

PR Checklist

Note: Please mark anything not applicable to this PR NA.

PR Summary

  • Changed the install location of AllUsers scope on PWSH to SHARED_MODULES location. PowerShell/PowerShellGet#175.
  • Refreshing the PowerShellGet.Tests.ps1 file from PowerShell/PowerShellGet repository.
  • Removed $IsCoreCLR variable usage.
  • Updated the logic for retrieving MyDocuments path on Windows.

@daxian-dbw Dongbo Wang (daxian-dbw) added this to the 6.0.0-RC.2 milestone Dec 6, 2017
@bmanikm Manikyam Bavandla (bmanikm) changed the title Refresh PowerShellGet.Tests.ps1 from PowerShell/PowerShellGet repository PowerShellGet: Change AllUsers scope install location to SHARED_MODULES path Dec 6, 2017
@bmanikm
Manikyam Bavandla (bmanikm) force-pushed the updatepsgettestscript branch 2 times, most recently from b8d02ce to a01f5e4 Compare December 6, 2017 19:53

@daxian-dbw Dongbo Wang (daxian-dbw) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Please add [feature] tag to the commit message to trigger a full test run.

@bmanikm
Manikyam Bavandla (bmanikm) force-pushed the updatepsgettestscript branch 3 times, most recently from 21f0dc4 to 4426696 Compare December 6, 2017 21:25

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't really have a way to handle this if you don't have the privilege to write in the directory on non-windows platforms, we can look at extending the test framework for next release.

I recommend a test hook approach, which allows you to provide an alternative location. From a test perspective, the only thing you want to be sure of is when you select a location the files get placed there. It doesn't really matter what that location is, it could be anywhere - A testhook which makes [system.management.automation.platform]::SelectProductNameForDirectory('SHARED_MODULES') point to $TESTDRIVE should be sufficient as long as you have a separate test which returns what the default location of SHARED_MODULES should be.
This provides far more flexibility in the long run
If you can't do that, I would mark this specific test as pending for non-windows

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use -Pending instead of -Skip. We track all pending tests because they are supposed to work but now at the time. -Skip means they are not applicable to the platform.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And also, please add -Pending before the open curly bracket, like

It "Should install a module correctly to the required location with default AllUsers scope" -Pending:$IsLinux {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here.

@daxian-dbw

Copy link
Copy Markdown
Member

In fact, with sudo: required in .travis.yml, you can use sudo without providing a password on Travis CI Linux to get the root privilege. So we should be able to support RequireAdminOnLinux. #5645 is opened to track that.

As for macOS, it turns out the Shared-Module path is not protected, and that's why it passed on macOS.

@daxian-dbw

Dongbo Wang (daxian-dbw) commented Dec 7, 2017 •

Copy link
Copy Markdown
Member

Aditya Patwardhan (@adityapatwardhan) Can you take a look at the failure in AppVeyor to see what might be wrong?

https://ci.appveyor.com/project/PowerShell/powershell/build/v6.1.0-preview.7209

@daxian-dbw

Copy link
Copy Markdown
Member

Manikyam Bavandla (@bmanikm) You didn't address my comment at #5633 (comment)
I have addressed it and also add comments about why we mark them pending on Linux.

…HARED_MODULES location.

Refresh PowerShellGet.Tests.ps1 from PowerShell/PowerShellGet repository.
PowerShell/PowerShellGet#175
@daxian-dbw
Dongbo Wang (daxian-dbw) merged commit 15e609c into PowerShell:master Dec 7, 2017
@bmanikm
Manikyam Bavandla (bmanikm) deleted the updatepsgettestscript branch December 7, 2017 19:27
Travis Plunk (TravisEz13) pushed a commit to TravisEz13/PowerShell that referenced this pull request Dec 8, 2017
…AllUsers scope. (PowerShell#5633)

Changed the install location of AllUsers scope on PWSH to SHARED_MODULES location.
Travis Plunk (TravisEz13) pushed a commit that referenced this pull request Dec 8, 2017
…AllUsers scope. (#5633)

Changed the install location of AllUsers scope on PWSH to SHARED_MODULES location.
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
…AllUsers scope. (PowerShell#5633)

Changed the install location of AllUsers scope on PWSH to SHARED_MODULES location.
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
…AllUsers scope. (PowerShell#5633)

Changed the install location of AllUsers scope on PWSH to SHARED_MODULES location.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants