我正在尝试在
当我启用系统诊断运行管道时,可以在日志中看到以下内容:
第三行显示将
我错了什么?
azure-pipelines.yml
文件中为 PublishTestResults@2 任务分配 failTaskOnFailedTests
参数,使其成为表达式的结果。第一次运行测试时,如果有任何失败的测试,我希望失败该作业。在 重试失败的作业 时,我不想失败该作业。我已经按以下方式设置了该任务(倒数第二行是我设置 failTaskOnFailedTests
参数的地方): - task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '*.xml'
searchFolder: '$(testsOutputPath)'
mergeTestResults: true
failTaskOnFailedTests: eq($(System.JobAttempt), 1)
testRunTitle: 'Test Results $(System.JobAttempt)'
当我启用系统诊断运行管道时,可以在日志中看到以下内容:
##[debug]testRunTitle=Test Results 1
##[debug]publishRunAttachments=true
##[debug]failTaskOnFailedTests=eq(1, 1)
##[debug]searchFolder=/home/vsts/work/1/s/TestProject/cypress/reports/junit
##[debug]testRunner: JUnit
##[debug]testResultsFiles: *.xml
##[debug]mergeResults: true
第三行显示将
failTaskOnFailedTests
设置为表达式语句,而不是表达式的评估值。我不知道哪里出了问题。这个表达式似乎符合表达式文档中的其他表达式。我错了什么?