Check scope of Set-Variable to resolve #1107#1109
Conversation
|
Thanks for the PR, but this is not the solution I described to you on Twitter. You need to add parameter Setting all the mocked variables to Global scope might fix the one symptom, but it does not fix it in a clean way. Also we need some tests for this. The two that are in the original issue should be a good start. (you can simply fixup the solution and push to the same branch, the PR will update) |
|
So, I'm not sure if I am even close with resolving this issue. Your last comment leads me to believe I have missed the boat entirely. Attempting to write some tests for this condition, I am not able to get Assert-MockCalled to return true. What am I looking for is, am I on the right track or should I start over? |
|
@BrandonLundt seems to be quite close. |
|
Looking at the TeamCity build failures I see:
Which I do not believe to be an issue with my pull request but rather with multiple items running in TeamCity at the same time. Any ideas how I rerun these build tasks? |
|
@BrandonLundt yeah, I can re-run it, or you can push some change to the repository. But this already happened with some other build, so it might be a problem connected to migrating the builds to a different infrastructure. @dlwyatt you were doing some kind of upgrade recently, right? Have you observed this problem somewhere else? |
|
Not that I've noticed. The agents are only supposed to be used for a single build and then discarded. Will check. |
1. General summary of the pull request
Very small change to Invoke-Mock. Added a change to Set-Variable mocking to include a scope parameter of Global. This is intended to resolve #1107