-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fail on no test file for PublishTestResults@2 #13275
Comments
This would be incredibly useful, we're using bash scripts between each test task at the moment |
My team and I would appreciate this feature very much, too!
Would you mind sharing your script? |
Yeah if I need to script my way around problems like that I really don't need these tasks at all. I prefer a fix for this :) |
Adding @shailesh-sk |
Anybody working on this issue? This option is essential |
Coming in yet half year later. This would be really essential for the pipelines I am working on. In the current setup I want to do, I would not want to fail the build based on the exit status of the tests step, but continue and later use the published test results further down in the pipeline. This means that both this task, and the Powershell task that runs the tests is set to not fail the build on failure. To safeguard from the testrunner failing completely and not running any tests at all, I would need this task to fail in case it cannot find any test result files! |
Adds an option that lets the user configure the task to fail in case no test result files have been found. This serves as a safeguard to make sure that the test-run task and this task has been configured properly to find the test result files. Solves microsoft#13275
Adds an option that lets the user configure the task to fail in case no test result files have been found. This serves as a safeguard to make sure that the test-run task and this task has been configured properly to find the test result files. Solves microsoft#13275
Adds an option that lets the user configure the task to fail in case no test result files have been found. This serves as a safeguard to make sure that the test-run task and this task has been configured properly to find the test result files. Solves microsoft#13275
I would like to see this as well. @shailesh-sk the PR is waiting your review |
@jmhon08 PR looks good to me, added upadhyayap@github.com to cherry pick this change. |
A bit late to the party, but I'm looking forward to seeing this added as well. |
@upadhyayap any idea when this will be merged? |
Did we get anywhere with #14868 ? |
This is an essential feature... It should at least make a warning if not fail completely at the "Publish Test Results task" |
Would really like to see this feature implemented |
Also looking for this, seems fundamental |
We ended up using follow bash script tasks which first check if test result file exists, then check if number of results are more than 0: We rely on running tests inside a docker compose as we also test with database. But if you purely rely on the VSTest task you can use the argument - bash: |
if [ $(test_results_host_folder)**/*.trx ] && [ $(grep -E "<UnitTestResult" $(test_results_host_folder)**/*.trx -c) -gt 0 ]; then
echo "##vso[task.setVariable variable=TESTRESULTFOUND]true"
fi
displayName: Check if test results file & results >= 1
- script: |
echo No test result found
exit 1
displayName: No test result found
condition: ne(variables.TESTRESULTFOUND, 'true') |
been another 4 months any plans to fix this? |
I think it would make more sense if the job would fail by default, and maybe add an option to explicitly silence it. |
Somewhat different, but we just had a live site because although many of our tests failed, this task had some internal error reporting/fetching the test results. Not good... We need to correct the error handling in this task. |
Adds an option that lets the user configure the task to fail in case no test result files have been found. This serves as a safeguard to make sure that the test-run task and this task has been configured properly to find the test result files. Solves microsoft#13275
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 |
|
I'd love to see this fail by default if no test files are found. |
This would be really helpful. The default assumption when publishing non existent files should be to error out. |
nearly 3 years this has been opened? Everyone going to be here for its 3rd birthday in July? |
I contacted Microsoft support through my work and was suggested to simply use the bash workaround.....I also share this frustration. So it does not seem like there are any plans to fix this bug. It's astonishing Microsoft is willingly letting this bug persist and relying on workarounds suggested by other users. Then they left me with a survey asking how well they addressed my problem!! Hysterical |
Bump. |
I got tired of waiting and found the solution myself.
|
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 |
This issue is not stale, but I guess the bot is… |
Microsoft folks, if this is something you don't plan to fix, you should close this issue as not planned so we know. Thanks! |
[like] Dustin Sauriol reacted to your message:
…________________________________
From: Kevin Partington ***@***.***>
Sent: Monday, March 18, 2024 7:44:03 PM
To: microsoft/azure-pipelines-tasks ***@***.***>
Cc: Dustin Sauriol ***@***.***>; Comment ***@***.***>
Subject: Re: [microsoft/azure-pipelines-tasks] Fail on no test file for ***@***.*** (#13275)
[External Sender]
Microsoft folks, if this is something you don't plan to fix, you should close this issue as not planned so we know. Thanks!
—
Reply to this email directly, view it on GitHub<#13275 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AU2YHMPMJCOSZW2XHNIVOELYY47YHAVCNFSM4OYRLHC2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBQGQ3TQMBWGIYA>.
You are receiving this because you commented.Message ID: ***@***.***>
|
This is available with version 2.228.0+ via setting the input - task: PublishTestResults@2
inputs:
failTaskOnMissingResultsFile: true # boolean. Fail if no result files are found. Default: false. |
Note
Issues in this repo are for tracking bugs, feature requests and questions for the tasks in this repo
For a list:
https://github.com/Microsoft/azure-pipelines-tasks/tree/master/Tasks
If you have an issue or request for the Azure Pipelines service, use developer community instead:
https://developercommunity.visualstudio.com/spaces/21/index.html )
Required Information
Entering this information will route you directly to the right team and expedite traction.
Question, Bug, or Feature?
Type: Feature
Enter Task Name: PublishTestResults@2
list here (V# not needed):
https://github.com/Microsoft/azure-pipelines-tasks/tree/master/Tasks
Environment
Server - Azure Pipelines or TFS on-premises?
https://dev.azure.com/osieng/engineering/_build/results?buildId=103053&view=logs&j=846ec57a-2bea-5833-7752-007160b95b9a&t=d1056ef1-5a88-52db-be24-b861f9682b72
Agent - Hosted or Private:
If using Hosted agent, provide agent queue name:
linux:
imageName: ubuntu-latest
windows:
imageName: windows-latest
Issue Description
When publishing a test result, if there is no test result file, this task gives a warning that is eaten by a success indication. It should flag as a warning that it didn't actually publish the result and ideally there should be an option to fail if the test file doesn't exist.
Task logs
Starting: Publish test results
Task : Publish Test Results
Description : Publish test results to Azure Pipelines
Version : 2.171.0
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/test/publish-test-results
/usr/bin/dotnet --version
3.1.301
##[warning]No test result files matching **/test-*.xml were found.
Finishing: Publish test results
Troubleshooting
Checkout how to troubleshoot failures and collect debug logs: https://docs.microsoft.com/en-us/vsts/build-release/actions/troubleshooting
Error logs
[Insert error from the logs here for a quick overview]
The text was updated successfully, but these errors were encountered: