Project

General

Profile

Actions

action #153763

closed

[regression] Fix dry-run of openqa-investigate size:S

Added by okurz 4 months ago. Updated 4 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Regressions/Crashes
Target version:
Start date:
2024-01-17
Due date:
% Done:

0%

Estimated time:

Description

Motivation

From https://suse.slack.com/archives/C02AJ1E568M/p1705482261366879?thread_ts=1705481511.459859&cid=C02AJ1E568M

(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
  • 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

Related issues 1 (0 open1 closed)

Copied to openQA Project - action #153874: [regression] openqa-investigate post investigate feature is brokenRejected2024-01-17

Actions
Actions

Also available in: Atom PDF