question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add option to fail Publish Test Results task when test result file is not found

See original GitHub issue

Question, Bug, or Feature?
Type: Feature

Enter Task Name: PublishTestResults@2

Environment

  • Server - Azure Pipelines

Issue Description

I imagine it is a common pattern to have a test task (with continueOnError: true) followed by a publish task. I’ve run into the issue a couple times where we will have our test task fail due to setup issues (e.g. not test failures), but the junit output file will not be published. The PublishTestResults task will warn it cannot find the file, but it will not fail the task. I find myself relying heavily on failTaskOnFailedTests: true, and wish that I could make this task fail if no output files are found.

Task logs

For our build setup see here. This particular log actually brings up another issue, where failing when the output cannot be parsed would also be nice. I don’t think we have a log with the issue I described at the moment, but both things have occurred.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:6

github_iconTop GitHub Comments

2reactions
jrsearlescommented, Apr 15, 2020

Hi - is this something you would accept a contribution on? This would be incredibly useful for me and looking at the code it seems like it would be fairly straightforward to implement.

0reactions
github-actions[bot]commented, May 28, 2021

This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days

Read more comments on GitHub >

github_iconTop Results From Across the Web

PublishTestResults@2 - Publish Test Results v2 task
Specifies the format of the results files you want to publish. The following formats are supported: CTest, JUnit, NUnit 2, NUnit 3, Visual ......
Read more >
Failed to publish test results: Not Found
Using Pester to unit test my PowerShell module, the build fails to publish the test results. Yaml: # Starter pipeline # Start with...
Read more >
Publish Test Results task in Azure Devops - Stack Overflow
The error message has indicated there is no test result files ... In addition, the default option uses JUnit format to publish test...
Read more >
How to use SpecSync from build or release pipeline
Step 2: Configure SpecSync task to publish test result file ; --testResultFile. The test results file produced by the test execution step can...
Read more >
Chapter 5 - Publishing Results in Pipeline
Publishing test results is quite straightforward in Azure DevOps because of course, we have a task available for it. We can add the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found