Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CUDA Azure Bugfix: Only convert CTest output to JUnit if testing is enabled #1263

Merged
merged 10 commits into from
Nov 8, 2024
38 changes: 19 additions & 19 deletions scripts/llnl/common_build_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,28 +306,28 @@ def build_and_test_host_config(test_root, host_config, report_to_stdout=False, e
output_file = tst_output_file,
print_output = report_to_stdout,
echo=True)
else:
print("[skipping unit tests]")

# Convert CTest output to JUnit, do not overwrite previous res
print("[Checking to see if xsltproc exists...]")
test_xsltproc_res = shell_exec("xsltproc --version", echo=True)
if test_xsltproc_res != 0:
print("[WARNING: xsltproc does not exist skipping JUnit conversion]")
else:
junit_file = pjoin(build_dir, "junit.xml")
xsl_file = pjoin(get_blt_dir(), "tests/ctest-to-junit.xsl")
ctest_file = pjoin(build_dir, "Testing/*/Test.xml")
# Convert CTest output to JUnit, do not overwrite previous res
print("[Checking to see if xsltproc exists...]")
test_xsltproc_res = shell_exec("xsltproc --version", echo=True)
if test_xsltproc_res != 0:
print("[WARNING: xsltproc does not exist skipping JUnit conversion]")
else:
junit_file = pjoin(build_dir, "junit.xml")
xsl_file = pjoin(get_blt_dir(), "tests/ctest-to-junit.xsl")
ctest_file = pjoin(build_dir, "Testing/*/Test.xml")

print("[Converting CTest XML to JUnit XML]")
convert_cmd = "xsltproc -o {0} {1} {2}".format(junit_file, xsl_file, ctest_file)
convert_res = shell_exec(convert_cmd, echo=True)
if convert_res != 0:
print("[WARNING: Converting to JUnit failed.]")
print("[Converting CTest XML to JUnit XML]")
convert_cmd = "xsltproc -o {0} {1} {2}".format(junit_file, xsl_file, ctest_file)
convert_res = shell_exec(convert_cmd, echo=True)
if convert_res != 0:
print("[WARNING: Converting to JUnit failed.]")

if res != 0:
print("[ERROR: Tests for host-config: %s failed]\n" % host_config)
return res
if res != 0:
print("[ERROR: Tests for host-config: %s failed]\n" % host_config)
return res
else:
print("[skipping unit tests]")

# build the docs
docs_output_file = pjoin(build_dir,"output.log.make.docs.txt")
Expand Down