Closed JohnLudlow closed 4 years ago
Wow, that's surprising. This happens every time you try and run that test using "Run tests"? What happens when you use "Invoke-Pester
Grrr... It seemed like I could reproduce it reliably at first, but after trying it a few times it seems intermittent.
Initially, running the tests from Run tests
showed the error, but I can't get that to fail anymore.
Invoke-Pester from the integrated terminal did fail once, but I can't get that to fail anymore either.
Running the test task (see configuration below) from the panel did work, but is now showing the error.
Test task config:
{
"taskName": "build",
"isTestCommand": true,
"command": "powershell",
"options": {
"cwd": "${workspaceRoot}"
},
"args": [
"Invoke-Pester"
]
}
I also tried from just a plain old powershell.exe and that seems to work.
Does the extension do anything interesting for the test task? If not, then this may not be an issue with the extension.
Thanks
Nah, the tasks.json tasks are invoked purely in PowerShell, the extension isn't involved there.
Oh, you know what? I have seen this type of error before coming from the Integrated Terminal UI. There's a native library used called winpty which scrapes Windows console apps to surface them up to VS Code's HTML-based UI, I'll bet it's throwing an error. I've seen this before when running my own tasks in VS Code.
But then again, this error says specifically that powershell.exe has an issue, so once again I'm not so sure :/
At the moment that's how it happens, so the Run tests
thing was probably a red herring, and this might not be related to the PowerShell VSCode extension. I think I assumed it was the Run Tests codelens integration because that was the new thing in that last update.
@JohnLudlow this is a very old issue - have you still been experiencing this issue?
@TylerLeonhardt I agree it's old. In the meantime, I've moved companies and changed focus quite a bit so I no longer do the things I was trying to do originally, but a lot of the things above (like the version of PowerShell I use) aren't true anymore.
I can try to repro it though if you like.
If you don't mind, a repro attempt would be great. Otherwise, this issue will be automatically closed eventually.
@TylerLeonhardt Creating a new project with a plaster template, I can no longer reproduce this issue. My guess is that it was fixed as a side effect of other changes. I'd suggest you could close this issue, and if someone notices it again, it could be reopened.
System Details
$PSVersionTable
:Output of
code -v
from a normal terminal:Output of
code --list-extensions --show-versions
from a normal terminal:Issue Description
I have a pester test:
When I click the
Run tests
codelens link I get this error message box:Attached Logs
PowerShellVsCodeLogs.zip