0
votes

I am running my build and release pipeline in TFS/AZureDevopsServer-2019, below is the YAML used in azure-pipeline.yml

When the pipeline runs it does not generate Analytics

Build Pipeline enter image description here

How ever as per " https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/test/publish-test-results?view=azure-devops&tabs=trx%2Cyaml " i have added below task in my pipeline

- task: Maven@3
  inputs:
    mavenPomFile: '$(System.DefaultWorkingDirectory)/maven/pom.xml'
    goals: package
    mavenAuthenticateFeed: true
    sonarQubeRunAnalysis: true
    publishJUnitResults: true    
    sqMavenPluginVersionChoice: 'latest'

- task: PublishTestResults@2
  inputs:
    testResultsFormat: 'JUnit' 
    searchFolder: '$(System.DefaultWorkingDirectory)'
    publishJUnitResults: true
    testResultsFiles: '**/surefire-reports/TEST-*.xml'
    codeCoverageToolOption: JaCoCo

Pipeline result

2021-03-30T17:11:52.9179560Z ##[warning]No test result files matching **/TEST-*.xml were found.

enter image description here

1

1 Answers

0
votes

The error message has indicated there is no test result files matching **/TEST-*.xml. You need to check whether you have a test task in your pipeline, and check the log after running the test task, to check whether the test file has been generated.

In addition, the default option uses JUnit format to publish test results. **/TEST-*.xml searches for all the XML files whose names start with TEST- in all subdirectories. If using VSTest as the testRunner, the testResultsFiles option should be changed to **/TEST-*.trx.