Pester icon indicating copy to clipboard operation
Pester copied to clipboard

TestResult xml file does not contain info about containers failed on discovery

Open shenjashuk opened this issue 2 months ago • 0 comments

Checklist

What is the issue?

If you set TestResult.Enabled = $True Then inside a resulting xml file, you would not find any info on tests that failed during discovery

Expected Behavior

If you set TestResult.Enabled = $True Then inside a resulting xml file, you would find info about failed containters.

Steps To Reproduce

Example of a test, that failes because a developer forgot to put -TestCases:

Describe "Count" {
    It "Returns sum" @(
        @{ Name = 1; Expected = 2}
        @{ Name = 2; Expected = 4}
    ) {
        $name + $name | Should -Be $expected
    }
}

How does xml file look if u run only this test:

<test-results xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="nunit_schema_2.5.xsd" name="Pester" total="0" errors="0" failures="0" not-run="0" inconclusive="0" ignored="0" skipped="0" invalid="0" date="2025-10-14" time="00:36:29">
<environment clr-version="4.0.30319.42000" user-domain="***" cwd="C:\Users\shenjashuk\Desktop" platform="***" machine-name="***" nunit-version="2.5.8.0" os-version="10.0.19045" user="***"/>
<culture-info current-culture="ru-RU" current-uiculture="ru-RU"/>
<test-suite type="TestFixture" name="Pester" executed="True" result="Success" success="True" time="0.0414" asserts="0" description="Pester">
<results/>
</test-suite>
</test-results>

Describe your environment

Pester version : 5.7.1 C:\Program Files\WindowsPowerShell\Modules\Pester\5.7.1\Pester.psm1 PowerShell version : 5.1.19041.6328 OS version : Microsoft Windows NT 10.0.19045.0

Possible Solution?

No response

shenjashuk avatar Oct 13 '25 21:10 shenjashuk