build file
Some checks failed
test/timeline-server/pipeline/head There was a failure building this commit
Some checks failed
test/timeline-server/pipeline/head There was a failure building this commit
This commit is contained in:
21
Jenkinsfile
vendored
21
Jenkinsfile
vendored
@@ -55,12 +55,23 @@ pipeline {
|
||||
always {
|
||||
script {
|
||||
// 检查测试报告文件是否存在
|
||||
def reportFiles = findFiles(glob: 'target/surefire-reports/TEST-*.xml')
|
||||
if (reportFiles.length > 0) {
|
||||
echo "找到 ${reportFiles.length} 个测试报告文件"
|
||||
junit testResults: 'target/surefire-reports/TEST-*.xml'
|
||||
def testReportDir = 'target/surefire-reports'
|
||||
def hasReportDir = fileExists testReportDir
|
||||
|
||||
if (hasReportDir) {
|
||||
def reportCount = sh(
|
||||
script: "find ${testReportDir} -name 'TEST-*.xml' | wc -l",
|
||||
returnStdout: true
|
||||
).trim() as int
|
||||
|
||||
if (reportCount > 0) {
|
||||
echo "找到 ${reportCount} 个测试报告文件"
|
||||
junit testResults: 'target/surefire-reports/TEST-*.xml'
|
||||
} else {
|
||||
echo "未找到测试报告文件,跳过JUnit发布"
|
||||
}
|
||||
} else {
|
||||
echo "未找到测试报告文件,跳过JUnit发布"
|
||||
echo "未找到测试报告目录,跳过JUnit发布"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user