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.
Details
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
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:
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.
The current patch breaks unittests. testing/test_compose_trigger.py needs to be changed.
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
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
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.