Skip to content

Misleading error message when device tests fail #4934

@jamescrosswell

Description

@jamescrosswell

Description

When the device tests fail, we always get the error message:

device-test.ps1: The property 'FullName' cannot be found on this object. Verify that the property exists.
Error: Process completed with exit code 1.

This is because we have a finally block in the script that executes (and fails) even when the device tests have not run successfully:

Install-XHarness
Remove-Item -Recurse -Force test_output -ErrorAction SilentlyContinue
try
{
if ($VerbosePreference)
{
$arguments += '-v'
}
xharness $group test $arguments --output-directory=test_output
if ($LASTEXITCODE -ne 0)
{
throw 'xharness run failed with non-zero exit code'
}
}
finally
{
if ($CI)
{
scripts/parse-xunit2-xml.ps1 (Get-Item ./test_output/*.xml).FullName | Out-File $env:GITHUB_STEP_SUMMARY
}
}

The script needs to be refactored to give a more useful error message when the tests fail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETPull requests that update .net codeBugSomething isn't workingRepository Maintenance
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions