Skip to content

Commit

Permalink
Append URLs of generated artefacts to the submission log (bugfix) (#1567
Browse files Browse the repository at this point in the history
)

* Append to the submission log

Minor: fixes typo, url <-> path swapped in the output
Minor: This bug is actually a feature, this will store all exported
  uris to a file. That will make it easier to do automatic manipulation

* Less verbose message including transport name
  • Loading branch information
Hook25 authored Oct 31, 2024
1 parent 0904b9e commit 7b5dd02
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 7 additions & 5 deletions checkbox-ng/checkbox_ng/launcher/stages.py
Original file line number Diff line number Diff line change
Expand Up @@ -701,14 +701,16 @@ def _export_results(self):
result = result or {}
url = result.get("url") or result.get("status_url")
if url:
path = self._get_submission_file_path(".c3_url.log")
with open(path, "w+") as f:
path = self._get_submission_file_path(
".submission.log"
)
with open(path, "a+") as f:
print(
"Submission url ({}) saved also to: {}".format(
path, url
"[{}]: {} (URL added to: {})".format(
params["transport"], url, path
)
)
f.write(url)
f.write(url + "\n")
except TransportError as exc:
_logger.warning(
_("Problem occured when submitting '%s' report: %s"),
Expand Down
4 changes: 2 additions & 2 deletions checkbox-ng/checkbox_ng/launcher/test_stages.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def get_parametric_sections(section):
self.assertEqual(
file_mock.write.call_args,
mock.call(
"https://certification.canonical.com/submissions/status/EXAMPLE"
"https://certification.canonical.com/submissions/status/EXAMPLE\n"
),
)

Expand Down Expand Up @@ -141,7 +141,7 @@ def get_parametric_sections(section):
self.assertEqual(
file_mock.write.call_args,
mock.call(
"https://certification.canonical.com/submissions/status/EXAMPLE"
"https://certification.canonical.com/submissions/status/EXAMPLE\n"
),
)

Expand Down

0 comments on commit 7b5dd02

Please sign in to comment.