Commit df35e221 authored by liguangyu06's avatar liguangyu06
Browse files

Keep SPD report email default and skip Allure/summary when workspace is missing.

parent 91831603
......@@ -66,7 +66,7 @@ pipeline {
booleanParam(name: 'RUN_FULL', defaultValue: false, description: '包含 @full 全列排序(耗时长)')
string(
name: 'REPORT_EMAIL_TO',
defaultValue: '',
defaultValue: 'liguangyu@sinopharm.com',
description: '测试报告收件人(同事邮箱,多个用英文逗号)。留空则读任务环境变量 REPORT_EMAIL_TO;都空则不发信'
)
string(name: 'REPORT_EMAIL_CC', defaultValue: '', description: '抄送,逗号分隔,可选')
......@@ -173,16 +173,16 @@ pipeline {
} catch (err) {
echo "跳过归档:${err}"
}
if (fileExists('reports/latest/summary.json')) {
try {
try {
if (fileExists('reports/latest/summary.json')) {
def descScript = 'node -e "var s=require(\'./reports/latest/summary.json\'); var c=s.counts||{}; console.log(s.suite+\' shards=\'+s.shards+\' workers=\'+s.workers+\' fail=\'+(c.failures||0)+\'/\'+(c.tests||0))"'
def desc = isUnix()
? sh(script: descScript, returnStdout: true).trim()
: bat(script: "@echo off\n${descScript}", returnStdout: true).trim()
currentBuild.description = desc
} catch (err) {
echo "跳过构建描述:${err}"
}
} catch (err) {
echo "跳过构建描述:${err}"
}
try {
publishHTML([
......@@ -196,26 +196,30 @@ pipeline {
} catch (err) {
echo "跳过 HTML 报告:${err}"
}
if (fileExists('reports/latest/allure-results')) {
try {
allure includeProperties: false, jdk: '', results: [[path: 'reports/latest/allure-results']]
} catch (err) {
echo "Allure 插件不可用,已保留 reports/latest/allure-report:${err}"
if (fileExists('reports/latest/allure-report/index.html')) {
try {
publishHTML([
allowMissing: true,
alwaysLinkToLastBuild: true,
keepAll: true,
reportDir: 'reports/latest/allure-report',
reportFiles: 'index.html',
reportName: 'Allure Report'
])
} catch (ignored) {
echo "跳过 Allure HTML:${ignored}"
try {
if (fileExists('reports/latest/allure-results')) {
try {
allure includeProperties: false, jdk: '', results: [[path: 'reports/latest/allure-results']]
} catch (err) {
echo "Allure 插件不可用,已保留 reports/latest/allure-report:${err}"
if (fileExists('reports/latest/allure-report/index.html')) {
try {
publishHTML([
allowMissing: true,
alwaysLinkToLastBuild: true,
keepAll: true,
reportDir: 'reports/latest/allure-report',
reportFiles: 'index.html',
reportName: 'Allure Report'
])
} catch (ignored) {
echo "跳过 Allure HTML:${ignored}"
}
}
}
}
} catch (err) {
echo "跳过 Allure:${err}"
}
try {
withEnv(["BUILD_RESULT=${currentBuild.currentResult}"]) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment