我正在尝试发布由我的newman脚本生成的HTML报告,并在Jenkins作业中使用以下设置。
HTML directory to archive : ./newman
Index page[s] : myReport.html
Report title : My Report
我正在工作区的/newman目录中生成newman报告。但是,在项目面板上,我可以看到报告的链接,但当我单击它时,它显示了处理报告时的错误,因为找不到"。为什么要从错误的目录中读取报告?
控制台输出中有一条消息:
Archiving HTML reports...
[htmlpublisher] Archiving at BUILD level
/export/jenkins_slave/workspace/<teamPath>/ProjectName/newman to
/net/<company name>/jenkins_homes/<team path with
/job>/<ProjectName>/builds/2/htmlreports/ReportFolder
记录测试结果
脚本:
always {
sh label: '', script: '''cd /target
tar -czf report.html output'''
emailext attachmentsPattern: '**/target/report.html', body: '''CreateProject_Pipeline - Build # $BUILD_NUMBER - $BUILD_STATUS:
${JELLY_SCRIPT,template="html"}
Check console output at $BUILD_URL to view the results.''',
recipientProviders: [requestor()], subject: 'VDP_CreateProject_Pipeline-API Test Results', to: 'abc@abc.com'
cleanWs()
}
}
我认为您需要更改路径。
要归档的HTML目录:/纽曼
/newman