Ole*_*ers 1 azure-devops azure-pipelines
在管道中我有两个不同的步骤。第一个生成一些文件,第二个应该将这些文件作为输入。
该管道的 Yaml 如下:
name: myscript
stages:
- stage: Tes/t
displayName: owasp-test
jobs:
- job: owasp_test
displayName: run beasic checks for site
pool:
name: default
demands: Agent.OS -equals Windows_NT
steps:
- task: DotNetCoreCLI@2
inputs:
command: 'build'
projects: '**/*.sln'
- task: dependency-check-build-task@5
inputs:
projectName: 'DependencyCheck'
scanPath: '**/*.dll'
format: 'JUNIT'
- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/*-junit.xml'
Run Code Online (Sandbox Code Playgroud)
返回dependency-check-build-task一个 XML 文件:
File upload succeed.
Upload 'P:\Azure-Pipelines-Agent\_work\2\TestResults\dependency-check\dependency-check-junit.xml' to file container: '#/11589616/dependency-check'
Associated artifact 53031 with build 21497
Run Code Online (Sandbox Code Playgroud)
以下步骤 ( PublishTestResults) 应获取该文件但返回
##[warning]No test result files matching **/*-junit.xml were found.
Run Code Online (Sandbox Code Playgroud)
反而。管道运行后,我可以在工件中看到该文件。
这是因为您的报告写入其中Common.TestResultsDirectory(对于 Microsoft 托管代理),并在其中c:\agent_work\1\TestResults发布测试任务。System.DefaultWorkingDirectoryc:\agent_work\1\s
请尝试:
- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/*-junit.xml'
searchFolder: '$(Common.TestResultsDirectory)'
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1026 次 |
| 最近记录: |