Skip to content

Commit a4b483b

Browse files
authored
Infra: Remove empty junit xml (NVIDIA#3794)
* Remote results.xml when no cases ran Signed-off-by: qqiao <qqiao@nvidia.com> * Change some test config to verify Signed-off-by: qqiao <qqiao@nvidia.com> * Update for quotes Signed-off-by: qqiao <qqiao@nvidia.com> * Move the remove results.xml in catch section Signed-off-by: qqiao <qqiao@nvidia.com> * Add missed path Signed-off-by: qqiao <qqiao@nvidia.com> * Change back the test stage setting Signed-off-by: qqiao <qqiao@nvidia.com> --------- Signed-off-by: qqiao <qqiao@nvidia.com>
1 parent e9fab4f commit a4b483b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

jenkins/L0_Test.groovy

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,13 @@ def runLLMTestlistOnPlatform(pipeline, platform, testList, config=VANILLA_CONFIG
966966
error("Error in post-debug session: ${e.message}")
967967
}
968968
}
969+
// If the execution test list is null, remove the test result xml
970+
sh """
971+
ls -all ${stageName}/
972+
if ! grep -q '<testcase' ${stageName}/results.xml; then
973+
rm ${stageName}/results.xml
974+
fi
975+
"""
969976
def llmPath = sh (script: "realpath .", returnStdout: true).trim()
970977
def llmSrc = "${llmPath}/${LLM_ROOT}${config}/TensorRT-LLM/src"
971978
// CPP tests will generate test result in ${llmSrc}/cpp/build_backup/, move these files to job result folder
@@ -975,7 +982,6 @@ def runLLMTestlistOnPlatform(pipeline, platform, testList, config=VANILLA_CONFIG
975982
sh "cd ${llmSrc}/cpp/build_backup/ && sed -i 's/\" classname=\"/\" classname=\"${stageName}./g' *.xml || true"
976983
sh "cd ${llmSrc}/cpp/build_backup/ && sed -i 's/testsuite name=\"[^\"]*\"/testsuite name=\"${stageName}\"/g' *.xml || true"
977984
// Sed for Pytest result
978-
sh "ls ${stageName}/ -all"
979985
sh "cd ${stageName} && sed -i 's/testsuite name=\"pytest\"/testsuite name=\"${stageName}\"/g' *.xml || true"
980986
// Copy CPP test result
981987
sh "cp ${llmSrc}/cpp/build_backup/*.xml ${stageName} || true"

0 commit comments

Comments
 (0)