0

I am migrating one of my project from git- bitbucket to azure devops. While migrating, I am running my tests builds( Running test cases) even though the build is success but some test orders are not triggering and i am getting the message saying: "No tests result files matching D:\build\V1_w\1\s\tests\target\surefire-reports*.xml" were found. So, publishing JUnit tests results is being skipped"

After this step "Create zip with failed tests info" step is running for creating zip file for failed tests info. and build is getting failed with error message saying "##[error]Error: ENOENT: No such file or directory, stat D:\build\V1_w\1\s\tests\target\surefire-reports*.xml"

Actually there is some different folder / file structure Azure have where it stores the test result. I have already tried the below variables in order to get the tests result

  1. $(Build.ArtifactStagingDirectory)
  2. $(System.DefaultWorkingDirectory)
  3. $(Build.BinariesDirectory)

Please let me help to resolve the issue. Since I don't have much reputation point! I cannot post the screenshot / full logs.

Yaml Script:

trigger:

  • master

pool: vmImage: ubuntu-latest

steps:

  • checkout: self
  • checkout: project-test-tool
  • task: Maven@3

inputs: mavenPomFile: 'pom.xml' mavenOptions: '-Xmx3072m' javaHomeOption: 'JDKVersion' jdkVersionOption: '1.8' jdkArchitectureOption: 'x64' searchFolder: '$(System.DefaultWorkingDirectory)' testResultsFormat: 'JUnit' publishJUnitResults: 'true' testResultsFiles: '**/surefire-reports/TEST-*.xml' goals: 'package'

TIA...

1 Answers1

0

If you are using Microsoft-hosted agents check what is inside your build/source folders and then share, below you have tutorial(tree command).

Azure Pipelines - Is there a way to view the folder structure?

You do not need to add screenshots if your reputation is low, you should just edit your question adding copy-pasted Yaml file(without sensitive data)

Kontekst
  • 946
  • 8
  • 17
  • Thank you for your response. I have understood all the azure internal folder structure and i tried with different variable in order to get the test results but no luck as of now. – PRADEEP TIWARI Aug 04 '21 at 12:29
  • But did you displayed the folders which are on your agent? If you do not check if these folders indeed exist there you will not be sure, use "tree" comand to display build agent structure and then probably I think you will notice some folders missing. – Kontekst Aug 04 '21 at 12:43
  • Just now i added command Line task to pipeline and seen "D:\Build\v\_w\1" is my working agent path and udner this i have 's' which means Build.SourcesDirectory. when i apply tree command no where i was able to see the genrated test result file. – PRADEEP TIWARI Aug 05 '21 at 11:34