-
Notifications
You must be signed in to change notification settings - Fork 498
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
Changing to tasks.json v2.0.0 breaks Pester problem matching #797
Comments
Related to #802 |
Maybe related, but I think this is more of an issue with the new terminal-based task runner not reading the terminal output correctly. In theory it shouldn't require any changes on our side. |
chiming in because my experience is a bit different. Using task version 2.0.0, I'm actually seeing tests invoked multiple times. After that, even with a failing test, there is nothing in the Problems console. Switched to task version 0.1.0 and the tests are executed once and I do see matched problems. |
@mattmcnabb weird, can you show us your tasks.json file? |
The Task{
"version": "2.0.0",
"isShellCommand": true,
"command": "${env.windir}\\system32\\windowspowershell\\v1.0\\PowerShell.exe",
"args": [
"-NoProfile",
"-ExecutionPolicy",
"Bypass"
],
"suppressTaskName": true,
"tasks": [
{
"taskName": "Test",
"args": [
"-Command",
"Invoke-Pester -PesterOption @{IncludeVSCodeMarker=$true}"
],
"isTestCommand": true,
"problemMatcher": "$pester"
}
]
} Task Version 2.0.0Notice that the test loop several times and the end result is 71 passing and 8 failing. This is a template project with only 12 tests. Task Version 0.1.0Here you can see in the output pane that the tests only execute once and the end result is 10 passing and 2 failing as expected, and the failed tests are reflected in the problem pane. Originally I thought my task was just broken, so I trimmed a bunch of it out to get down to this, and it still doesn't work. I also tried flipping from isTestCommand to isBuildCommand but got the same result. NotesPSES Version: 1.2.0.0 |
@mattmcnabb remove the line |
@rkeithhill That seems to have fixed it for the v2.0.0 task. I no longer see the tests looping, and the problems now show up in the problem pane. I do see the duplicate problem entries as described in the issue. Thanks! |
This problem has been fixed with PR #941. You can implement the fix without waiting on a new drop as the fix applies to the tasks.json file. Simply change this line:
to
The bug has to do with the PowerShell progress overlay causing the terminal to see a single failure multiple times. The above "fix" is really more of a "workaround". There is another bug lurking here with the |
Can this be closed? For one thing, I know that Pester has disabled progress reporting during the test run since it broke running tests on Linux/macOS due to PSv6 not supporting it very well. I also know that detecting problems using a problem matcher with Pester does work, as I've been using Pester for some time now with VS Code. I am, however, not using the |
System Details
$PSVersionTable
:Issue Description
When the version of tasks.json is set to
2.0.0
and there is a single Pester error, the error shows up multiple times - on the order of 6 to 12 times for the same error. Switch the version back to0.1.0
and the problem matcher (correctly) finds just one error.The text was updated successfully, but these errors were encountered: