Actions
action #153763
closed[regression] Fix dry-run of openqa-investigate size:S
Start date:
2024-01-17
Due date:
% Done:
0%
Estimated time:
Tags:
Description
Motivation¶
(Oliver Kurz) maybe changes have broken the dry run
(Tina Müller) yeah, line 161 is doing a openqa-cli POST request and expecting a JSON response. that won't work if it's replaced with an echo
Command-line used:
host=aquarius.suse.cz dry_run=1 exclude_no_group=false ./openqa-investigate 20047
jq (161 ./openqa-investigate): jq: parse error: Invalid numeric literal at line 1, column 11 (rc: 5 Input: >>>openqa-cli api --header User-Agent: openqa-investigate (https://github.com/os-autoinst/scripts) --host https://aquarius.suse.cz --retries=3 -X POST jobs/20047/comments text=Starting investigation for job 20047<<<)
Acceptance Criteria¶
- AC1: Dry run does not fail
Suggestions¶
- The code is POSTing a comment and then GETting it back, so we need to mock the response(s)
- Alternatively to mocking, add some input validation to the code block in question and make it do nothing
- e.g. add an early return in
sync_via_investigation_comment()
echoing a made-up comment id
- e.g. add an early return in
- Add a unit test for it (Test-Driven Development)
- "dry run" should be understood to potentially read data from external services, but never modify anything or write changes back -> Don't leave behind any traces
- Consider documenting this somewhere
Actions