Repository navigation
Setting to Disable Pester Code Lens - #1585
Rob Holt (rjmholt) merged 5 commits into
Conversation
|
Andy Jordan (@andschwa) not sure why this is failing the test, something in the way you mock the settings maybe? |
Andy Jordan (andyleejordan)
left a comment
There was a problem hiding this comment.
Is there a way to add a test checking that the provider is (and isn't) enabled via the flag? We might not actually have tests around settings yet, but I'm trying to be intentional about covering all new changes in tests.
It looks like the actual test itself wasn't fixed. At a quick glance, there's an assertion failing. The input was changed, but not the tests on the output. |
|
Andy Jordan (@andschwa) That's the thing though, by default it shouldn't be changing the behavior, I didn't write a new test yet, so I'm not sure why it thinks it's not registering the codelens. |
|
Oh I see, we do have an existing test that asserts the code lens is there (yay!): And it looks like the way its written is making for a really bad failure message, but in short from here: I think the collection is empty, which means that this failed: |
|
Thanks for eyeballing it, I'll investigate but again it shouldn't have changed the default behavior so either I goofed or something wrong in the test. |
|
Looking at the rest of the settings file, the Pester class is weird: This should be: internal class PesterSettings
{That is, none of the others are public just internal, and this empty constructor is useless. Probably not breaking anything but want to change it while we're in this code? |
|
Two other things to note is that in the tests, the test you're having to touch is unnecessarily (I think?) parsing JSON in a string into a The other thing in here is that the test I just linked is explicitly sending a |
I agree I thought this was super bizarre but with lack of comments as to why it was this way I assumed there was a good reason. |
I checked the Git blame and saw no good reason. Looked like the code was added in a community PR and so was probably just checked as thoroughly as we're doing now. |
Andy Jordan (andyleejordan)
left a comment
There was a problem hiding this comment.
Looks like it's working now. Can we add a simple test that asserts thing work as expected with Pester.CodeLens = false? Also would be happy to have included the change to the Pester settings class that has a dummy constructor and is for some reason public.
|
Andy Jordan (@andschwa) I'll try to work on this tonight or tomorrow, no guarantees though :) |
|
Andy Jordan (@andschwa) banged on this for a while, everything looks fine after making some additional adjustments, but the Pester Code lens test fails for me even on master with the same error, can you confirm it fails on master for you too? |
It certainly shouldn't be! Here's the most recent master CI run and it's passing: https://dev.azure.com/powershell/PowerShellEditorServices/_build/results?buildId=87315&view=ms.vss-test-web.build-test-results-tab&runId=1676954&resultId=100001&paneView=debug Sounds like an environment issue? |
|
Andy Jordan (@andschwa) OK now that I've got both-sides debugging working, it looks like the config change via DidChangeConfiguration is not taking effect and that's why the legacyCodeLens test is failing |
|
Andy Jordan (@andschwa) should pass but it's in "awaiting approval" status for the MacOS build. |
Andy Jordan (andyleejordan)
left a comment
There was a problem hiding this comment.
Hey, this looks fantastic, I'm excited to get this into a preview. Rob Holt (@rjmholt) Do you have a moment to review?
|
Rob Holt (@rjmholt) Andy Jordan (@andschwa) thank you! And thanks for putting up with my low level of C# experience. |
| _psesProcess = new PsesStdioProcess(factory, IsDebugAdapterTests); | ||
| await _psesProcess.Start().ConfigureAwait(false); | ||
|
|
||
| Console.WriteLine("PowerShell Editor Services Server started with PID {0}", ProcessId); |
There was a problem hiding this comment.
So I'm late back to this, but I thought it looked fishy when I reviewed it...
I think we want to use ITestOutputHelper for this
There was a problem hiding this comment.
The intent is to have a indicator for when I breakpoint right past this which process to attach to for dual-debugging, would the ITestOutputHelper still output that to the vscode debug console at that point?


Allows the Pester Codelens to be disabled so as not to confuse users who want to use an alternate Pester Test Runner
Correlated vscode-powershell PR: PowerShell/vscode-powershell#3613