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

Change build script to install into a versioned directory #1247

Merged
merged 7 commits into from
Jun 3, 2019

Conversation

JamesWTruher
Copy link
Member

instead of installing into out/PSScriptAnalyzer it will be out/PSScriptAnalyzer/
I also added some -force to a number of the New-item -type directory tests because they cause misleading screen output because the directory already existed.
I fixed one of the tests which was not setting �$env:PSModulePath back correctly to its original state.

PR Summary

A number of infrastructure and test fixes

PR Checklist

instead of installing into out/PSScriptAnalyzer it will be out/PSScriptAnalyzer/<version>
Also add some -force to a number of the
ew-item -type directory tests because they cause misleading screen output
tracked down one of the tests which was not setting �nv:PSModulePath back correctly
Versioned module directories are not supported, so we need to change the name of the directory from <version> to PSScriptAnalyzer so it can be added to env:PSModulePath and work as expected
$oldPSModulePath = $env:PSModulePath
$savedPSModulePath = $env:PSModulePath
}
AfterAll {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just a note, there is a Pester issue here whereby using BeforeAll or AfterAll inside a Context block results in unpredictable behaviour. Technically they should be only under a Describe block. We should address this in another PR as refactoring this test suite is hard.

Copy link
Member Author

@JamesWTruher JamesWTruher Jun 3, 2019

Choose a reason for hiding this comment

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

yah - I agree - the missing AfterAll was the reason that the analyzer needed to be installed into a specific location. with this change, that is no longer needed! The test altered $env:PSModulePath permanently!

Copy link
Collaborator

@bergmeister bergmeister left a comment

Choose a reason for hiding this comment

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

Looks good to me, I ran the build and tests locally (Windows) on PS 6.2 and 5.1 and it worked fine.

@JamesWTruher JamesWTruher merged commit 6c946c0 into PowerShell:development Jun 3, 2019
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.

None yet

2 participants