-
Notifications
You must be signed in to change notification settings - Fork 8
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
Restore-TestEnvironment
: New parameter KeepNewMachinePSModulePath
#128
Conversation
Codecov Report
@@ Coverage Diff @@
## main #128 +/- ##
===================================
Coverage 80% 80%
===================================
Files 1 1
Lines 539 547 +8
===================================
+ Hits 432 440 +8
Misses 107 107 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 8 of 8 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion
tests/Unit/Public/Initialize-TestEnvironment.Tests.ps1
line 116 at r1 (raw file):
TestType = $TestType ResourceType = $ResourceType ErrorAction = 'SilentlyContinue'
Should be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 7 of 8 files reviewed, all discussions resolved (waiting on @johlju)
tests/Unit/Public/Initialize-TestEnvironment.Tests.ps1
line 116 at r1 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Should be removed.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r2.
Reviewable status: all files reviewed (commit messages unreviewed), all discussions resolved (waiting on @johlju)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @johlju)
Pull Request (PR) description
Restore-TestEnvironment
KeepNewMachinePSModulePath
was added and only worksif the test type is
Integration
orAll
. The new parameter willkeep any new paths that was added to the machine environment variable
PSModulePath
after the commandInitialize-TestEnvironment
was called.This is helpful if a a path is added by an integration test and is needed
by a second integration test and there is a need to run
Restore-TestEnvironment
between tests.
Join-PSModulePath
that will concatenate twostrings with semi-colon separated paths.
Initialize-TestEnvironment
$script:machineOldPSModulePath
is always set when called with thetest type
Integration
orAll
. Before it reverted to the paths on theevent
OnRemove
that were the current paths whenInitialize-TestEnvironment
was first called. On subsequent calls any new paths were ignored.
Initialize-TestEnvironment
without thecommand
Restore-TestEnvironment
was called prior the command will nowfail with a non-terminating exception asking the user to run
Restore-TestEnvironment
to avoid the previously saved paths (
$script:machineOldPSModulePath
)to be overwritten.
This Pull Request (PR) fixes the following issues
Restore-TestEnvironment
: New PSModulePath in target Machine is overwritten #127Task list
Entry should say what was changed and how that affects users (if applicable), and
reference the issue being resolved (if applicable).
This change is