-
Notifications
You must be signed in to change notification settings - Fork 499
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
Migrate Pester version detection into an InovkePester stub script #1776
Conversation
Hmm, interesting idea and solves the startup problem and I guess the additional overhead of always running the check is negligible since PowerShell itself does some of the caching. The only thing that I do not like is that I cannot just press the up key in the console any more to see and modify the executed command, which I sometimes like to do. What did you think about my recent idea of changing my PR to query PSES for the Pester version before Invoking the command to separate the construction of the codelens and the determination/decision of the Pester version? |
The thing that occurred to me is that the Integrated Console can override any cached value at any time. It's unlikely, but a user might unload the higher version of Pester and load in the older version, and now the CodeLens doesn't work. Imagine removing all modules in the Integrated Console and then calling a command that loads a module that pulls in a lower Pester version. It's a pain because it means we're forced to check every time we execute. |
Ok, let's go for Keith's approach then |
@bergmeister Just to be clear, you can press the up key and get the script invocation command if you want to re-execute it. But yeah, the parameters to Invoke-Pester are hidden. If you think that is important we can Write-Host the Invoke-Pester command that is executed? If we go with this approach, can you revert your PSES PR back to just adding the lineNumber to the info returned by the code lens request? Then we can call this enhancement done. Yay! :-) |
@TylerLeonhardt or @rjmholt Can one of you double check that the stub script runs on Linux and macOS? |
@rkeithhill Hmm, looking at your script again, a user would still see and be able to modify the parameters, so although one cannot see the actual command, this would make me most people like me happy enough :-) |
I like this approach! So, if we have the PowerShell script handling the check, the PSES change is simply returning p.s. works on macOS |
…werShell#1776) * Migrate Pester version detection into an InovkePester stub script * Move TestName warning into script * Improve stub script, move module loaded check to beginning * Address Codacy issue * Address PR feedback * Move TestName check before LineNumber in case of multiple blocks/line
PR Summary
Alternate implementation of invoking pester tests by line number. See PR #1713
This PR requires the changes that @bergmeister is working on in the PSES PR 856 That PR can now be simplified since it does not need to determine the Pester version number. It just always returns the line number.
PR Checklist
Note: Tick the boxes below that apply to this pull request by putting an
x
between the square brackets.Please mark anything not applicable to this PR
NA
.WIP:
to the beginning of the title and remove the prefix when the PR is ready