Skip to content

[BUG]: failTaskOnMissingResultsFile does not work #21166

@felixSabatie

Description

@felixSabatie

New issue checklist

Task name

PublishTestResults

Task version

2.254.0

Issue Description

We are using the PublishTestResults@2 task to publish results from an e2e test project that sometimes fails to run because of a package update. When this happens we do not get a result file, and would like our pipeline to fail and not just get a warning. So we activated the failTaskOnFailureToPublishResults expecting it to fail when no file is found, but it doesn't work.
Here is our config :

Image

And here is the result :

Image

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Debian 12

Relevant log output

2025-07-23T09:00:24.5759535Z ##[debug]Total test results: 0.
2025-07-23T09:00:24.5773534Z No Result Found to Publish '/home/[...]/e2e/results/results.xml'.
2025-07-23T09:00:24.5775054Z ##[debug]Leaving ParseTestResultFiles
2025-07-23T09:00:24.5789668Z ##[debug]Processed: ##vso[results.publish type=JUnit;mergeResults=false;publishRunAttachments=true;resultFiles=/home/apollo/agents/odyssey2-agent5/_work/708/s/docker/e2e/results/results.xml;failTaskOnFailedTests=true;failTaskOnFailureToPublishResults=true;testRunSystem=VSTS - PTR;]
2025-07-23T09:00:24.5790392Z ##[debug]task result: Succeeded
2025-07-23T09:00:24.5790975Z ##[debug]Processed: ##vso[task.complete result=Succeeded;]
2025-07-23T09:00:24.5791317Z ##[debug]Release.ReleaseUri=undefined
2025-07-23T09:00:24.5791624Z ##[debug]Release.ReleaseId=undefined
2025-07-23T09:00:24.5791945Z ##[debug]Build.BuildUri=vstfs:///Build/Build/69897
2025-07-23T09:00:24.5792253Z ##[debug]Build.Buildid=69897
2025-07-23T09:00:24.5801637Z ##[debug]runContext.ReleaseURI is null
2025-07-23T09:00:24.5802314Z ##[debug]runContext.ReleaseEnvironmentUri is null
2025-07-23T09:00:24.5866450Z ##[debug]Uploading build level attachements individually
2025-07-23T09:00:24.5884521Z ##[debug]Entering PublishToNewTestRunPerTestResultFileAsync
2025-07-23T09:00:24.5963996Z ##[debug]Leaving PublishToNewTestRunPerTestResultFileAsync
2025-07-23T09:00:24.5999519Z ##[debug]Processed: ##vso[telemetry.publish area=TestExecution;feature=PublishTestResultsTask]{"builduri":"vstfs:///Build/Build/69897","buildid":"69897","osType":"Linux","testRunner":"JUnit","failTaskOnFailedTests":"true","mergeResultsUserPreference":"false","testResultsFilesCount":1,"failTaskOnMissingResultsFile":true,"failTaskOnFailureToPublishResults":"true","dotnetVersion":"8.0.412","subFeature":"publishTestResultsTaskConsolidatedCiEvent"}
2025-07-23T09:00:24.6001445Z ##[section]Async Command Start: Publish test results

Full task logs with system.debug enabled

2025-07-23T09:00:22.9591467Z ##[debug]Evaluating condition for step: 'Publish Test Results results.xml'
2025-07-23T09:00:22.9593306Z ##[debug]Evaluating: SucceededNode()
2025-07-23T09:00:22.9593939Z ##[debug]Evaluating SucceededNode:
2025-07-23T09:00:22.9594952Z ##[debug]=> True
2025-07-23T09:00:22.9595692Z ##[debug]Result: True
2025-07-23T09:00:22.9596421Z ##[section]Starting: Publish Test Results results.xml
2025-07-23T09:00:22.9607039Z ==============================================================================
2025-07-23T09:00:22.9607369Z Task         : Publish Test Results
2025-07-23T09:00:22.9607881Z Description  : Publish test results to Azure Pipelines
2025-07-23T09:00:22.9608136Z Version      : 2.254.0
2025-07-23T09:00:22.9608307Z Author       : Microsoft Corporation
2025-07-23T09:00:22.9608512Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/test/publish-test-results
2025-07-23T09:00:22.9608858Z ==============================================================================
2025-07-23T09:00:23.0947186Z ##[debug]Using node path: /home/[...]/externals/node20_1/bin/node
2025-07-23T09:00:23.1743578Z ##[debug]agent.TempDirectory=/home/[...]/_work/_temp
2025-07-23T09:00:23.1749827Z ##[debug]loading inputs and endpoints
2025-07-23T09:00:23.1753206Z ##[debug]loading INPUT_TESTRUNNER
2025-07-23T09:00:23.1767448Z ##[debug]loading INPUT_TESTRESULTSFILES
2025-07-23T09:00:23.1768474Z ##[debug]loading INPUT_SEARCHFOLDER
2025-07-23T09:00:23.1769652Z ##[debug]loading INPUT_MERGETESTRESULTS
2025-07-23T09:00:23.1770677Z ##[debug]loading INPUT_FAILTASKONFAILEDTESTS
2025-07-23T09:00:23.1772804Z ##[debug]loading INPUT_FAILTASKONFAILURETOPUBLISHRESULTS
2025-07-23T09:00:23.1773312Z ##[debug]loading INPUT_FAILTASKONMISSINGRESULTSFILE
2025-07-23T09:00:23.1775424Z ##[debug]loading INPUT_PUBLISHRUNATTACHMENTS
2025-07-23T09:00:23.1776648Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2025-07-23T09:00:23.1778620Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2025-07-23T09:00:23.1780743Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2025-07-23T09:00:23.1790190Z ##[debug]loading SECRET_SYSTEM_ACCESSTOKEN
2025-07-23T09:00:23.1791639Z ##[debug]loaded 12
2025-07-23T09:00:23.1797457Z ##[debug]Agent.ProxyUrl=undefined
2025-07-23T09:00:23.1798033Z ##[debug]Agent.CAInfo=undefined
2025-07-23T09:00:23.1799041Z ##[debug]Agent.ClientCert=undefined
2025-07-23T09:00:23.1799420Z ##[debug]Agent.SkipCertValidation=undefined
2025-07-23T09:00:23.1875083Z ##[debug]check path : /home/[...]/_work/_tasks/PublishTestResults_0b0f01ed-7dde-43ff-9cbb-e48954daf9b1/2.254.0/task.json
2025-07-23T09:00:23.1877372Z ##[debug]adding resource file: /home/[...]/_work/_tasks/PublishTestResults_0b0f01ed-7dde-43ff-9cbb-e48954daf9b1/2.254.0/task.json
2025-07-23T09:00:23.1877825Z ##[debug]system.culture=en-US
2025-07-23T09:00:23.1891750Z ##[debug]testRunner=JUnit
2025-07-23T09:00:23.1893109Z ##[debug]testResultsFiles=results.xml
2025-07-23T09:00:23.1894261Z ##[debug]mergeTestResults=false
2025-07-23T09:00:23.1894711Z ##[debug]platform=undefined
2025-07-23T09:00:23.1895142Z ##[debug]configuration=undefined
2025-07-23T09:00:23.1895583Z ##[debug]testRunTitle=undefined
2025-07-23T09:00:23.1896192Z ##[debug]publishRunAttachments=true
2025-07-23T09:00:23.1897191Z ##[debug]failTaskOnFailedTests=true
2025-07-23T09:00:23.1898456Z ##[debug]failTaskOnMissingResultsFile=true
2025-07-23T09:00:23.1900010Z ##[debug]failTaskOnFailureToPublishResults=true
2025-07-23T09:00:23.1900783Z ##[debug]searchFolder=docker/e2e/results
2025-07-23T09:00:23.1901218Z ##[debug]testRunner: JUnit
2025-07-23T09:00:23.1901622Z ##[debug]testResultsFiles: results.xml
2025-07-23T09:00:23.1902031Z ##[debug]mergeResults: false
2025-07-23T09:00:23.1902423Z ##[debug]platform: undefined
2025-07-23T09:00:23.1902822Z ##[debug]config: undefined
2025-07-23T09:00:23.1903223Z ##[debug]testRunTitle: undefined
2025-07-23T09:00:23.1903619Z ##[debug]publishRunAttachments: true
2025-07-23T09:00:23.1904415Z ##[debug]failTaskOnFailedTests: true
2025-07-23T09:00:23.1904825Z ##[debug]failTaskOnMissingResultsFile: true
2025-07-23T09:00:23.1905251Z ##[debug]failTaskOnFailureToPublishResults: true
2025-07-23T09:00:23.1905710Z ##[debug]System.DefaultWorkingDirectory=/home/[...]
2025-07-23T09:00:23.1906192Z ##[debug]System.DefaultWorkingDirectory=/home/[...]
2025-07-23T09:00:23.1906695Z ##[debug]defaultRoot: '/home/[...]/docker/e2e/results'
2025-07-23T09:00:23.1907308Z ##[debug]findOptions.allowBrokenSymbolicLinks: 'true'
2025-07-23T09:00:23.1907745Z ##[debug]findOptions.followSpecifiedSymbolicLink: 'true'
2025-07-23T09:00:23.1908182Z ##[debug]findOptions.followSymbolicLinks: 'true'
2025-07-23T09:00:23.1908608Z ##[debug]findOptions.skipMissingFiles: 'undefined'
2025-07-23T09:00:23.1909098Z ##[debug]matchOptions.debug: 'false'
2025-07-23T09:00:23.1909533Z ##[debug]matchOptions.nobrace: 'true'
2025-07-23T09:00:23.1909946Z ##[debug]matchOptions.noglobstar: 'false'
2025-07-23T09:00:23.1910354Z ##[debug]matchOptions.dot: 'true'
2025-07-23T09:00:23.1910749Z ##[debug]matchOptions.noext: 'false'
2025-07-23T09:00:23.1911159Z ##[debug]matchOptions.nocase: 'false'
2025-07-23T09:00:23.1911565Z ##[debug]matchOptions.nonull: 'false'
2025-07-23T09:00:23.1911967Z ##[debug]matchOptions.matchBase: 'false'
2025-07-23T09:00:23.1912380Z ##[debug]matchOptions.nocomment: 'false'
2025-07-23T09:00:23.1912784Z ##[debug]matchOptions.nonegate: 'false'
2025-07-23T09:00:23.1913201Z ##[debug]matchOptions.flipNegate: 'false'
2025-07-23T09:00:23.1913607Z ##[debug]pattern: 'results.xml'
2025-07-23T09:00:23.1918056Z ##[debug]findPath: '/home/[...]/docker/e2e/results/results.xml'
2025-07-23T09:00:23.1918523Z ##[debug]statOnly: 'true'
2025-07-23T09:00:23.1918909Z ##[debug]found 1 paths
2025-07-23T09:00:23.1919346Z ##[debug]applying include pattern
2025-07-23T09:00:23.1919828Z ##[debug]adjustedPattern: '/home/[...]/docker/e2e/results/results.xml'
2025-07-23T09:00:23.1923417Z ##[debug]1 matches
2025-07-23T09:00:23.1923822Z ##[debug]1 final results
2025-07-23T09:00:23.1924224Z ##[debug]Detected 1 test result files
2025-07-23T09:00:23.1925521Z ##[debug]which 'dotnet'
2025-07-23T09:00:23.1928136Z ##[debug]found: '/home/[...]/_work/_tool/dotnet/dotnet'
2025-07-23T09:00:23.1929603Z ##[debug]which '/home/[...]/_work/_tool/dotnet/dotnet'
2025-07-23T09:00:23.1930468Z ##[debug]found: '/home/[...]/_work/_tool/dotnet/dotnet'
2025-07-23T09:00:23.1931213Z ##[debug]/home/[...]/_work/_tool/dotnet/dotnet arg: --version
2025-07-23T09:00:23.1931975Z ##[debug]exec tool: /home/[...]/_work/_tool/dotnet/dotnet
2025-07-23T09:00:23.1932618Z ##[debug]arguments:
2025-07-23T09:00:23.1933198Z ##[debug]   --version
2025-07-23T09:00:23.1933967Z [command]/home/[...]/_work/_tool/dotnet/dotnet --version
2025-07-23T09:00:23.3700329Z 8.0.412
2025-07-23T09:00:23.3702993Z ##[debug]PublishTestResults.OverrideExeFlow=undefined
2025-07-23T09:00:23.3703741Z ##[debug]OS type: Linux
2025-07-23T09:00:23.4910680Z ##[debug]TestManagement.Server.UsePublishTestResultsLibInAgent is on
2025-07-23T09:00:23.6032939Z ##[debug]TestManagement.Server.EnableAzureTestPlanTaskFlow is off
2025-07-23T09:00:23.6294241Z ##[debug]TestManagement.Server.TriggerCoverageMergeJob is on
2025-07-23T09:00:24.1708853Z ##[debug]Agent environment resources - Disk: / Available 1289571.26 MB out of 1875232.20 MB, Memory: Used 14040.00 MB out of 32025.00 MB, CPU: Usage NaN%
2025-07-23T09:00:24.4690914Z ##[debug]Object of TestLogStore created.
2025-07-23T09:00:24.4691888Z Result Attachments will be stored in LogStore
2025-07-23T09:00:24.4692216Z ##[debug]Object of TestResultsPublisher created.
2025-07-23T09:00:24.4941973Z ##[debug]Object of TestLogStore created.
2025-07-23T09:00:24.4942307Z Run Attachments will be stored in LogStore
2025-07-23T09:00:24.4942986Z ##[debug]Object of TestRunPublisher created.
2025-07-23T09:00:24.4943959Z ##[debug]Object of TestLogStore created.
2025-07-23T09:00:24.5453562Z ##[debug]TestManagement.Server.JUnitTestCaseAttachmentsEnabled is on
2025-07-23T09:00:24.5710901Z ##[debug]TestManagement.Server.CustomTestFieldsInPTRInputFilesEnabled is off
2025-07-23T09:00:24.5713001Z ##[debug]Object of JUnitResultParser created.
2025-07-23T09:00:24.5717840Z ##[debug]Entering ParseTestResultFiles
2025-07-23T09:00:24.5719832Z ##[debug]runContext.ReleaseURI is null
2025-07-23T09:00:24.5720246Z ##[debug]runContext.ReleaseEnvironmentUri is null
2025-07-23T09:00:24.5733706Z ##[debug]Reading test results from file '/home/[...]/docker/e2e/results/results.xml'.
2025-07-23T09:00:24.5759535Z ##[debug]Total test results: 0.
2025-07-23T09:00:24.5773534Z No Result Found to Publish '/home/[...]/docker/e2e/results/results.xml'.
2025-07-23T09:00:24.5775054Z ##[debug]Leaving ParseTestResultFiles
2025-07-23T09:00:24.5789668Z ##[debug]Processed: ##vso[results.publish type=JUnit;mergeResults=false;publishRunAttachments=true;resultFiles=/home/[...]/docker/e2e/results/results.xml;failTaskOnFailedTests=true;failTaskOnFailureToPublishResults=true;testRunSystem=VSTS - PTR;]
2025-07-23T09:00:24.5790392Z ##[debug]task result: Succeeded
2025-07-23T09:00:24.5790975Z ##[debug]Processed: ##vso[task.complete result=Succeeded;]
2025-07-23T09:00:24.5791317Z ##[debug]Release.ReleaseUri=undefined
2025-07-23T09:00:24.5791624Z ##[debug]Release.ReleaseId=undefined
2025-07-23T09:00:24.5791945Z ##[debug]Build.BuildUri=vstfs:///Build/Build/69897
2025-07-23T09:00:24.5792253Z ##[debug]Build.Buildid=69897
2025-07-23T09:00:24.5801637Z ##[debug]runContext.ReleaseURI is null
2025-07-23T09:00:24.5802314Z ##[debug]runContext.ReleaseEnvironmentUri is null
2025-07-23T09:00:24.5866450Z ##[debug]Uploading build level attachements individually
2025-07-23T09:00:24.5884521Z ##[debug]Entering PublishToNewTestRunPerTestResultFileAsync
2025-07-23T09:00:24.5963996Z ##[debug]Leaving PublishToNewTestRunPerTestResultFileAsync
2025-07-23T09:00:24.5999519Z ##[debug]Processed: ##vso[telemetry.publish area=TestExecution;feature=PublishTestResultsTask]{"builduri":"vstfs:///Build/Build/69897","buildid":"69897","osType":"Linux","testRunner":"JUnit","failTaskOnFailedTests":"true","mergeResultsUserPreference":"false","testResultsFilesCount":1,"failTaskOnMissingResultsFile":true,"failTaskOnFailureToPublishResults":"true","dotnetVersion":"8.0.412","subFeature":"publishTestResultsTaskConsolidatedCiEvent"}
2025-07-23T09:00:24.6001445Z ##[section]Async Command Start: Publish test results
2025-07-23T09:00:24.6975403Z ##[debug]Total build level attachments: 0.
2025-07-23T09:00:24.7249132Z ##[debug]TestManagement.PTR.CalculateTestRunSummary is on
2025-07-23T09:00:24.7351983Z ##[debug]RESOURCE_URIS:
2025-07-23T09:00:24.7629564Z ##[debug]TestManagement.Agent.PTR.EnableFlakyCheck is on
2025-07-23T09:00:24.7962126Z ##[section]Async Command End: Publish test results
2025-07-23T09:00:24.7963125Z ##[section]Finishing: Publish Test Results results.xml

Repro steps

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions