ComposeCompletedJobTrigger: convert to pungi4
AbandonedPublic

Authored by adamwill on Feb 16 2016, 10:11 PM.

Details

Reviewers
tflink
jdulaney
Summary

We're not actually using this trigger yet, but we will want to
use it to run openQA (and possibly other things...) on Pungi 4
compose completion. Currently this trigger is set up to fire on
the old-style nightly composes, but those will go away soon.
This should make it fire on Pungi 4 composes instead.

Test Plan

I guess run a test Taskotron instance and see if
this trigger fires when a Pungi 4 compose completes.

Diff Detail

Repository
rTRGR taskotron-trigger
Branch
arcpatch-D748
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 456
Build 456: arc lint + arc unit
adamwill retitled this revision from to ComposeCompletedJobTrigger: convert to pungi4.Feb 16 2016, 10:11 PM
adamwill updated this object.
adamwill edited the test plan for this revision. (Show Details)
adamwill added reviewers: tflink, kparal, jskladan.
adamwill added a subscriber: garretraziel.

I wasn't sure how to test this, so I thought I'd submit a diff and ask for help with that. You can see an example message here:

https://apps.fedoraproject.org/datagrepper/id?id=2016-85af2c7b-be8d-4225-a238-3ca3bd2e2d5c&is_raw=true&size=extra-large

mkrizek added a subscriber: mkrizek.

Regarding the testing: so setting up a dev environment and running the trigger is described in readme.rst. There are currently two modes of triggering jobs. The one is BuildbotTrigger which is for production. The other one is not exactly trigger, StreamTrigger which just prints info about the job that would have been triggered and is the one used for development.

mkrizek requested changes to this revision.Feb 17 2016, 7:53 AM

The current patch breaks unittests. testing/test_compose_trigger.py needs to be changed.

This revision now requires changes to proceed.Feb 17 2016, 7:53 AM
adamwill updated this revision to Diff 1922.Feb 17 2016, 7:07 PM

Update the tests for the changes (not tested yet)

tflink requested changes to this revision.Feb 22 2016, 11:15 PM

The new tests don't pass and I'd rather not use dingus for new tests anyways

Which reminds me that we should require tests and lint for taskotron-trigger

This revision now requires changes to proceed.Feb 22 2016, 11:15 PM
test session starts

platform linux2 -- Python 2.7.11, pytest-2.8.3, py-1.4.31, pluggy-0.3.1
rootdir: /home/mock/taskotron/taskotron-trigger, inifile:
plugins: cov-2.2.0
collected 16 items

testing/test_compose_trigger.py FF.
testing/test_koji_build_trigger.py ....
testing/test_koji_tag_trigger.py .......
testing/test_triggers.py ..Coverage.py warning: Module libtaskotron was never imported.
Coverage.py warning: No data was collected.

FAILURES

_____________________________________________ TestComposeCompletedJobTrigger.test_consume ______________________________________________

self = <testing.test_compose_trigger.TestComposeCompletedJobTrigger instance at 0x7f75d5f3b3b0>

def test_consume(self):
    self.helper.consume(self.ref_message)

    trigger_calls = self.helper.trigger.trigger_job.calls()

    assert len(trigger_calls) == 2
assert trigger_calls[0][1] == (self.ref_location, compose_complete_msg.ITEM_TYPE, self.ref_tasks[0], self.ref_arches)

E AttributeError: TestComposeCompletedJobTrigger instance has no attribute 'ref_location'

testing/test_compose_trigger.py:44: AttributeError
_____________________________________ TestComposeCompletedJobTrigger.test_consume_incorrect_topic ______________________________________

self = <testing.test_compose_trigger.TestComposeCompletedJobTrigger instance at 0x7f75d9ced050>

def test_consume_incorrect_topic(self):
    ref_topic = 'fake_topic'
    self._create_msg(self.ref_status, ref_topic)

    self.helper.consume(self.ref_message)

    trigger_calls = self.helper.trigger.trigger_job.calls()
assert len(trigger_calls) == 0

E assert 2 == 0
E + where 2 = len([('()', (u'http://kojipkgs.fedoraproject.org/compose//rawhide/Fedora-24-201602...'compose_task2', 'noarch'), {}, <Dingus dingus_140144077371984.trigger_job()>)])

testing/test_compose_trigger.py:66: AssertionError

  • coverage: platform linux2, python 2.7.11-final-0 -------------------------------------------

Name Stmts Miss Cover Missing

2 failed, 14 passed in 0.91 seconds
adamwill updated this revision to Diff 1931.Feb 23 2016, 7:18 AM

drop the incorrect topic test (irrelevant), fix ref_location

incorrect topic test was because there were previously topics
that matched the template but we didn't want to trigger on,
this is no longer the case, so this test is incorrect and not
needed. I forgot to specify ref_location.

well, this isn't a *new* test, it's a modification of an existing one. I don't know how to write a taskotron test from scratch or using some other system.

kparal resigned from this revision.Feb 25 2016, 2:40 PM
kparal removed a reviewer: kparal.
mkrizek resigned from this revision.Apr 6 2016, 1:07 PM
mkrizek removed a reviewer: mkrizek.

@adamwill I guess this can be abandoned with D1157.

adamwill abandoned this revision.Mar 14 2017, 5:43 PM

sounds plausible.