Skip to content

Pester test failure NOT in the Problems View. #1381

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

Closed
successhawk opened this issue Jun 22, 2018 · 3 comments
Closed

Pester test failure NOT in the Problems View. #1381

successhawk opened this issue Jun 22, 2018 · 3 comments

Comments

@successhawk
Copy link

Issue Description

I am experiencing a problem with Pester test failures being captured in the Problems view. I opened the examples project using:
image

I ran the Test task and all unit tests were successful. I modified a single test so that it would fail, because I wanted to see the failure in the Problems view. the test fails in the terminal view, but it does not display in the Problems view. I made more fail and they showed in the Problems view, but the original did not.

Here is the 1 failing test.
image
It is not in the Problems tab.
image

Code snippet that I modified to make failure (removed 'A' from expected READMENew.md).

    It 'Processes non-wildcard absolute path to non-existing file via -Path param' {
        New-File -Path $WorkspaceRoot\ReadmeNew.md | Should Be "$WorkspaceRoot\REDMENew.md"
    }

I also tried modifying the Test task as reported in another issue as a workaround.

            "label": "Test",
            "type": "shell",
            "command": "Write-Host 'Invoking Pester...'; $ProgressPreference = 'SilentlyContinue'; Invoke-Pester -PesterOption @{IncludeVSCodeMarker=$true};",
            "group": {
                "kind": "test",
                "isDefault": true
            },
            "problemMatcher": [
                "$pester"
            ]

Attached Logs

Follow the instructions in the README about
capturing and sending logs.

Environment Information

Visual Studio Code

Name Version
Operating System Windows_NT x64 10.0.15063
VSCode 1.24.1
PowerShell Extension Version 1.7.0

PowerShell Information

Name Value
PSVersion 5.1.15063.1088
PSEdition Desktop
PSCompatibleVersions 1.0 2.0 3.0 4.0 5.0 5.1.15063.1088
BuildVersion 10.0.15063.1088
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Visual Studio Code Extensions

Visual Studio Code Extensions(Click to Expand)
Extension Author Version
azurecli ms-vscode 0.4.2
bracket-pair-colorizer CoenraadS 1.0.58
gitlens eamodio 8.4.1
markdown-all-in-one yzhang 1.4.0
PowerShell ms-vscode 1.7.0
team ms-vsts 1.136.0
vscode-eclipse-keybindings alphabotsec 0.9.7
vscode-markdownlint DavidAnson 0.18.0
vscode-terminals fabiospampinato 1.11.7
@rkeithhill
Copy link
Contributor

I think we already have a fix for this in #1362. The regex was looking for time in ms and not s (seconds). If you want, you can apply this fix locally until we ship the next update. Just open your ~\.vscode\extensions\ms-vscode.powershell-1.7.0\package.json file and edit line 179 to this:

"regexp": "^\\s*(?:\\[-\\]\\s+)(.*?)(?:\\s+\\d+\\.?\\d*\\s*m?s)\\s*$",

Save and restart VSCode and try again. That should fix it.

@successhawk
Copy link
Author

Yes. That fixes the issue. thanks

@TylerLeonhardt
Copy link
Member

TylerLeonhardt commented Jun 25, 2018

We'll be getting a new release out soon so you can get this fix.. there's just some (hopefully) one time processes that need to be dealt with this time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants