Project

General

Profile

Actions

action #13456

closed

No candidate needles for current step of a running test(?)

Added by AdamWill over 7 years ago. Updated over 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Feature requests
Target version:
-
Start date:
2016-08-23
Due date:
% Done:

0%

Estimated time:

Description

In Fedora we're still using openQA git circa July 8 - I will evaluate the changes since then, make appropriate adjustments to our stuff and bump to a newer git at some point, but now isn't a good time.

With that openQA, I seem to have a rather annoying problem with the needle editor. If I use it from a completed job - say, I go to a completed job, click on a failed needle match, and click 'Create new needle' - the editor, properly, has several candidate needles that appear in the 'Needle based on' and 'Copy areas from' drop-downs, letting me conveniently base the new needle on an old one.

But if I run a job in interactive mode to edit needles as I go along, it doesn't work. Whenever a needle match fails and I click the scissors, the editor loads and it knows what tag it was looking for, but it does not show any candidate needles. Which makes creating the new needle a pain in the ass.

I also note that if I just visit the URL for the current step while the needle editor is loaded and behaving badly, there are no entries in the 'Candidate needle:' dropdown.

I did try to figure this out myself and see if any of the later commits fixes it, but I just couldn't, I couldn't manage to figure out how and when the candidate needles are supposed to be populated. Could someone give me a pointer if this has been fixed with a later commit I can backport for now?


Related issues 1 (0 open1 closed)

Blocked by openQA Project - action #12680: interactive mode: stop_waitforneedle is not writing out detailsResolvedmlin74422016-07-13

Actions
Actions #1

Updated by AdamWill over 7 years ago

well, I might have a bit of an idea why this is, if I'm following things right...

if we look in WebAPI/Controller/Step.pm at edit(), it reads the needles from $self->stash('module_detail'), looking for either needle or needles keys in that hash.

This is populated between check_tabmode() and init(); there's a bit of back-and-forth but basically we're calling the details() method of OpenQA::Schema::Result::JobModules.

That reads a json file from the testresults directory for the job - details-(testname).json.

If I actually go look at this file for a test running in interactive mode where the needle match for the most recent step failed, it looks like this, after re-formatting it to be more readable (it's stored in very compact form on disk):

[
   {
      "needle":"nonlive",
      "json":"/var/lib/openqa/share/tests/fedora/needles/anaconda/main_hub/nonlive.json",
      "result":"ok",
      "screenshot":"install_source_graphical-1.png",
      "area":[
         {
            "y":153,
            "similarity":100,
            "result":"ok",
            "w":74,
            "x":184,
            "h":57
         },
         {
            "result":"ok",
            "similarity":100,
            "w":66,
            "h":66,
            "x":186,
            "y":216
         },
         {
            "y":344,
            "result":"ok",
            "similarity":100,
            "w":60,
            "x":191,
            "h":60
         }
      ],
      "tags":[
         "anaconda_main_hub"
      ],
      "properties":[

      ]
   },
   {
      "properties":[

      ],
      "tags":[
         "anaconda_main_hub_installation_source"
      ],
      "area":[
         {
            "w":72,
            "result":"ok",
            "similarity":100,
            "h":61,
            "x":185,
            "y":342
         }
      ],
      "screenshot":"install_source_graphical-2.png",
      "result":"ok",
      "json":"/var/lib/openqa/share/tests/fedora/needles/anaconda/main_hub/installation_source.json",
      "needle":"installation_source"
   },
   {
      "screenshot":"install_source_graphical-3.png",
      "tags":[
         "anaconda_install_source_on_the_network"
      ],
      "result":"fail"
   }
]

that is, it's a list of dicts (or, fine, an array of hashes...), and the first two dicts in the list - for the two steps where the needle matched successfully - have needle keys where they keep the name of the matched needle.

However, the last dict in the list - which is for the step where the needle match failed - has no needle or needles key. Reading the code, I believe the expectation is that it should have a needles key whose value should be a dict of candidate needle details...but it doesn't.

If I look at the details json file for the failed module of a completed test which failed, I do see the expected needles key and value for the failed step.

I don't know why the required data isn't showing up in the JSON, though, or how to fix it.

Actions #2

Updated by mlin7442 over 7 years ago

basically it's #12680

Actions #3

Updated by okurz over 7 years ago

I can confirm the issue on current git master: d329302

mlin7442 you think you can fix this?

Actions #4

Updated by AdamWill over 7 years ago

mlin: but there are so many more words in mine!

Actions #5

Updated by okurz over 7 years ago

  • Blocked by action #12680: interactive mode: stop_waitforneedle is not writing out details added
Actions #6

Updated by coolo over 7 years ago

  • Status changed from New to Resolved
  • Assignee set to mlin7442

more words don't make it more valid :)

Actions #7

Updated by AdamWill over 7 years ago

but more organs means more human!

Actions

Also available in: Atom PDF