Merge lp://staging/~brendan-donegan/checkbox/verification_interaction_jobs into lp://staging/checkbox

Proposed by Brendan Donegan
Status: Merged
Approved by: Daniel Manrique
Approved revision: no longer in the source branch.
Merged at revision: 1784
Proposed branch: lp://staging/~brendan-donegan/checkbox/verification_interaction_jobs
Merge into: lp://staging/checkbox
Diff against target: 167 lines (+38/-24)
5 files modified
debian/changelog (+3/-0)
jobs/graphics.txt.in (+1/-1)
jobs/usb.txt.in (+1/-1)
plugins/jobs_prompt.py (+28/-21)
plugins/manual_test.py (+5/-1)
To merge this branch: bzr merge lp://staging/~brendan-donegan/checkbox/verification_interaction_jobs
Reviewer Review Type Date Requested Status
Daniel Manrique (community) Approve
Brendan Donegan (community) Needs Resubmitting
Review via email: mp+130388@code.staging.launchpad.net

Commit message

Allow verification and interaction to be used as aliases for 'manual' in job plugin fields

Description of the change

At the moment there are two different types of test job types - shell and manual. The problem with this is that manual tests may actually be partly automated by having only the verification of the correct result being performed by the tester, or alternatively by having the tester perform some action and the verification be done automatically. These should be distinguished from pure manual jobs and in the long run, actually be handled in a different way.

This merge merely creates the aliases 'verification' and 'interaction' for manual tests, and Checkbox will otherwise treat jobs with this 'plugin' exactly the same. In future it will be possible to implement functionality that actually causes jobs with these types to behave differently. Also for example purposes, two jobs have been converted to this type, both for testing and to kick off the process of converting jobs to use the appropriate type.

Oh, and to avoid confusion, I also pep8 cleaned the code

To post a comment you must log in.
Revision history for this message
Daniel Manrique (roadmr) wrote :

Awesome!

I can suggest a simplification (actually Marc did a few months ago):

you just have to register handlers with the appropriate regex. in the manual_test plugin: ("prompt-(manual|interactive|verification|monkey)", self.prompt_manual),

This should remove the need for the plugin_alias method and simplify a few other lines of the code, as well as keeping the definitions of the types of jobs each plugin can handle in the plugin itself, which I think is slightly cleaner.

I'll set this as Needs Fixing but this is certainly not set in stone, if you prefer your approach I'm OK.

review: Needs Fixing
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

Unfortunately it seems Marc was potentially talking about a non-existent 'feature' - Reactor.fire() just does the following to get the handler for the event:

handlers = self._event_handlers.get(event_type, ())

Just a simple dictionary lookup, no regexes involved. We could debate the merits of using pattern matching on signal handlers here (more flexible, put potentially slower), or we could just go with what works now.

review: Needs Resubmitting
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

Oh, and I'm not just speculating - registering the event handler for prompt_manual as you mentioned doesn't work.

Revision history for this message
Daniel Manrique (roadmr) wrote :

Oh OK, I didn't try that, if your solution works and mine doesn't, we go with yours :)

review: Approve
Revision history for this message
Daniel Manrique (roadmr) wrote :

Er, one more thing :( Do you think this will work (in plugins/manual_test.py):

for (rt, rh) in [
             ("prompt-manual", self.prompt_manual),
             ("prompt-verification", self.prompt_manual),
             ("prompt-interaction", self.prompt_manual),
             ("report-manual", self.report_manual),
             ("report-verification", self.report_manual)
             ("report-interaction", self.report_manual)]:
            self._manager.reactor.call_on(rt, rh)

The idea being, as I said before, keeping the knowledge about which kind of events a plugin can handle in the plugin itself.

I did it the verbose way for illustration purposes, I'm sure it can be shortened by clever loop use.

This is my last comment, I promise we'll go with whatever you reply next :)

review: Needs Information
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

This does work - I haven't tried to be fancy with loops or anything. I think it will just complicate the statement and save only a couple of lines at most. Thanks for the suggestion!

review: Needs Resubmitting
Revision history for this message
Daniel Manrique (roadmr) wrote :

OK then, as promised, approving this. Thanks!

review: Approve
1784. By Brendan Donegan

Allow verification and interaction to be used as aliases for 'manual' in job plugin fields

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches