-
-
Notifications
You must be signed in to change notification settings - Fork 473
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
V5 not honoring WriteVSCodeMarker option #1577
Comments
Thanks for the report, this indeed needs to be addressed, but last time I tried VSCode itself was broken and I never got back to it. Putting this into 5.1, I think detecting VSCode via env variable will be a better option, and will align better with adding automatic colors to AzDO output, or similar. |
I've been playing around with this tonight. The easiest would be to output Pester 3/4 format to keep a single problemMatcher for Pester in vscode-powershell. We'd just need to extend it to support the new UserDuration/FrameworkDuration timings, but that's easy enough. There are some other decisions to discuss also.
If we want to loop through the errors, then we need to choose between two approaches as the problemMatcher is kinda strict - see example options below. Alternative 1 - individual output per assertion.
Alternative 2 - using loop in problemMatcher.
|
|
That's a GO for
There is an alternative to NOT show all errors also. To keep it like it is and just display a single problem per task. Figured it would be nice for users to find all errors in the first run if they choose to enable the option in PesterConfiguration, but it also might get noisy since a failed test could trigger 5+ asserts due to the same root issue. Any experience with how other languages and test frameworks handle this? |
|
Yes. We didn't expect anyone to use it as it was renamed and never implemented in Pester v5, so considered it low-risk. The option and all mentions were removed in #1700 except for once sentence in the "Additional issues to be solved in 5.1" section in README, which I guess should be updated now anyways. |
@asears did you experience the problem? Is that how you noticed? |
After the upgrade one of my scripts setting this option broke. I just turned off all accesses to $configuration.Debug object to address this. |
1. General summary of the issue
I've specified the WriteVSCodeMarker issue to work with the PowerShell extension's Pester problem matcher. That causes Pester failures to show up in the
Problems
window and tests get red squiggles. But this is no longer working with Pester v5.0.0.2. Describe Your Environment
3. Expected Behavior
I expect this one failure to show up in the
Problems
window because the PowerShell extension's problem matcher was able to find the error long with filename and line info.4.Current Behavior
5. Possible Solution
Part of the reason Dave (IIRC) added the VSCode marker was that we wanted a text format that didn't change between different versions of Pester. Also, the VSCode problem matcher is regex driven so it can be a bit of a pain to use. We found it hard to come up with a problem matcher spec when the error filename/line number occurred on varying lines below the initial error line. Here is the current pester problem matcher:
6. Context
I configure tasks.json in VSCode to run all my tests and I bind that to a keyboard shortcut (typically
ctrl+shift+t
.My Pester test runner task in my various VSCode projects no longer works like it used to.
The text was updated successfully, but these errors were encountered: