Restore our ability to submit build/test results to CDash from GitLab CI (#35328)
* Restore our ability to submit build/test results to CDash from GitLab CI * Don't use CDash upload URL as report filename
This commit is contained in:
parent
ecf93c77ae
commit
82041ac5a3
@ -530,10 +530,9 @@ def ci_rebuild(args):
|
||||
if not verify_binaries:
|
||||
install_args.append("--no-check-signature")
|
||||
|
||||
cdash_args = []
|
||||
if cdash_handler:
|
||||
# Add additional arguments to `spack install` for CDash reporting.
|
||||
cdash_args.extend(cdash_handler.args())
|
||||
install_args.extend(cdash_handler.args())
|
||||
|
||||
slash_hash = "/{}".format(job_spec.dag_hash())
|
||||
deps_install_args = install_args
|
||||
|
@ -227,22 +227,22 @@ def test_run(args):
|
||||
)
|
||||
|
||||
|
||||
def report_filename(args, test_suite):
|
||||
if args.log_file:
|
||||
if os.path.isabs(args.log_file):
|
||||
return args.log_file
|
||||
else:
|
||||
log_dir = os.getcwd()
|
||||
return os.path.join(log_dir, args.log_file)
|
||||
else:
|
||||
return os.path.join(os.getcwd(), "test-%s" % test_suite.name)
|
||||
|
||||
|
||||
def create_reporter(args, specs_to_test, test_suite):
|
||||
if args.log_format is None:
|
||||
return None
|
||||
|
||||
filename = args.cdash_upload_url
|
||||
if not filename:
|
||||
if args.log_file:
|
||||
if os.path.isabs(args.log_file):
|
||||
log_file = args.log_file
|
||||
else:
|
||||
log_dir = os.getcwd()
|
||||
log_file = os.path.join(log_dir, args.log_file)
|
||||
else:
|
||||
log_file = os.path.join(os.getcwd(), "test-%s" % test_suite.name)
|
||||
filename = log_file
|
||||
|
||||
filename = report_filename(args, test_suite)
|
||||
context_manager = spack.report.test_context_manager(
|
||||
reporter=args.reporter(),
|
||||
filename=filename,
|
||||
|
@ -319,3 +319,26 @@ def test_test_results_status(mock_packages, mock_test_stage, status, expected):
|
||||
else:
|
||||
assert status in results
|
||||
assert expected in results
|
||||
|
||||
|
||||
@pytest.mark.regression("35337")
|
||||
def test_report_filename_for_cdash(install_mockery_mutable_config, mock_fetch):
|
||||
"""Test that the temporary file used to write Testing.xml for CDash is not the upload URL"""
|
||||
name = "trivial"
|
||||
spec = spack.spec.Spec("trivial-smoke-test").concretized()
|
||||
suite = spack.install_test.TestSuite([spec], name)
|
||||
suite.ensure_stage()
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
spack.cmd.test.setup_parser(parser)
|
||||
args = parser.parse_args(
|
||||
[
|
||||
"run",
|
||||
"--cdash-upload-url=https://blahblah/submit.php?project=debugging",
|
||||
"trivial-smoke-test",
|
||||
]
|
||||
)
|
||||
|
||||
spack.cmd.common.arguments.sanitize_reporter_options(args)
|
||||
filename = spack.cmd.test.report_filename(args, suite)
|
||||
assert filename != "https://blahblah/submit.php?project=debugging"
|
||||
|
Loading…
Reference in New Issue
Block a user