build file
Some checks failed
test/timeline-server/pipeline/head There was a failure building this commit

This commit is contained in:
jiangh277
2025-12-24 16:09:41 +08:00
parent b3f8aa6eb7
commit abdbd88aa6

21
Jenkinsfile vendored
View File

@@ -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发布"
}
}
}