Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions reframe/frontend/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,7 @@ def print_infoline(param, value):
try:
with open(report_file, 'w') as fp:
jsonext.dump(json_report, fp, indent=2)
fp.write('\n')
except OSError as e:
printer.warning(
f'failed to generate report in {report_file!r}: {e}'
Expand Down
11 changes: 11 additions & 0 deletions unittests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,17 @@ def test_report_file_with_sessionid(run_reframe, tmp_path):
assert os.path.exists(tmp_path / 'rfm-report-0.json')


def test_report_ends_with_newline(run_reframe, tmp_path):
returncode, stdout, _ = run_reframe(
more_options=[
f'--report-file={tmp_path / "rfm-report.json"}'
]
)
assert returncode == 0
with open(tmp_path / 'rfm-report.json') as fp:
assert fp.read()[-1] == '\n'


def test_check_submit_success(run_reframe, remote_exec_ctx):
# This test will run on the auto-detected system
partition, environ = remote_exec_ctx
Expand Down