-
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 PSModulePath in target Machine is overwritten
#127
Comments
There is also a bug that is essentially not reverting the correct state. The variable DscResource.Test/source/Public/Initialize-TestEnvironment.ps1 Lines 222 to 226 in 73d6c32
Is not passed here: DscResource.Test/source/Public/Initialize-TestEnvironment.ps1 Lines 296 to 305 in 73d6c32
So it is never used here: DscResource.Test/source/Public/Restore-TestEnvironment.ps1 Lines 42 to 46 in 73d6c32
|
Before reverting the PSModulePath in the machine state it should first look if there have been new paths added to the machine state (other than the built module path) and make sure to keep them after reverting to previous state. |
We could add this functionality behind an optional parameter |
The root cause is that
Initialize-TestEnvironment
saves the current machine environment variablePSModulePath
and then updates it with the path to the built module.DscResource.Test/source/Public/Initialize-TestEnvironment.ps1
Lines 177 to 207 in 73d6c32
PSModulePath
.https://github.com/dsccommunity/SqlServerDsc/blob/f9bde8a61230754c078257d115103726f749570a/tests/Integration/DSC_SqlSetup.Integration.Tests.ps1#L171-L175
DscResource.Test/source/Public/Restore-TestEnvironment.ps1
Lines 38 to 47 in 73d6c32
Restore-TestEnvironment
reverts the machine environment variablePSModulePath
to the one saved in step 1 overwriting the new path that was set in step 2.Originally posted by @johlju in dsccommunity/SqlServerDsc#1932 (comment)
The text was updated successfully, but these errors were encountered: