| |
@@ -28,7 +28,7 @@
|
| |
import mock
|
| |
|
| |
# 'internal' imports
|
| |
- from resultsdb_conventions.fedora import FedoraImageResult
|
| |
+ from resultsdb_conventions.fedora import (FedoraImageResult, FedoraBodhiResult)
|
| |
|
| |
# fedfind metadata dict used to avoid a round trip to get the real one.
|
| |
METADATA01 = {
|
| |
@@ -157,4 +157,58 @@
|
| |
}
|
| |
]
|
| |
|
| |
+ def test_fedorabodhi(self):
|
| |
+ """Check the expected properties of a FedoraBodhiResult."""
|
| |
+ res = FedoraBodhiResult(
|
| |
+ update='FEDORA-2017-e6d7184200',
|
| |
+ outcome='PASSED',
|
| |
+ tc_name='update.some.test',
|
| |
+ note='note here',
|
| |
+ ref_url='https://www.job.link/',
|
| |
+ tc_url='https://www.test.case/',
|
| |
+ source='testsource'
|
| |
+ )
|
| |
+ # Report to a MagicMock, so we can check create_result args
|
| |
+ fakeapi = mock.MagicMock()
|
| |
+ res.report(fakeapi)
|
| |
+
|
| |
+ # basic attribute checks
|
| |
+ assert res.outcome == 'PASSED'
|
| |
+ assert res.tc_name == 'update.some.test'
|
| |
+ assert res.note == 'note here'
|
| |
+ assert res.ref_url == 'https://www.job.link/'
|
| |
+ assert res.tc_url == 'https://www.test.case/'
|
| |
+ assert res.source == 'testsource'
|
| |
+
|
| |
+ # check the testcase object
|
| |
+ assert res.testcase_object == {
|
| |
+ 'name': 'update.some.test',
|
| |
+ 'ref_url': 'https://www.test.case/',
|
| |
+ }
|
| |
+
|
| |
+ # check the extradata
|
| |
+ assert res.extradata == {
|
| |
+ 'item': 'FEDORA-2017-e6d7184200',
|
| |
+ 'meta.conventions': 'result fedora.bodhi',
|
| |
+ 'source': 'testsource',
|
| |
+ 'type': 'bodhi_update'
|
| |
+ }
|
| |
+
|
| |
+ # check the groups
|
| |
+ assert res.groups == [
|
| |
+ {
|
| |
+ 'description': 'source.testsource',
|
| |
+ 'uuid': 'ddf8c194-5e34-50ec-b0e8-205c63b0dfc1'
|
| |
+ },
|
| |
+ {
|
| |
+ 'description': 'bodhi.FEDORA-2017-e6d7184200',
|
| |
+ 'ref_url': 'https://bodhi.fedoraproject.org/updates/FEDORA-2017-e6d7184200',
|
| |
+ 'uuid': 'c67605d5-0ff7-5f1e-91df-3d2ad094c902'
|
| |
+ },
|
| |
+ {
|
| |
+ 'description': 'testsource.FEDORA-2017-e6d7184200',
|
| |
+ 'uuid': 'd02731e7-46d3-545b-b355-3ff01ff62de1'
|
| |
+ },
|
| |
+ ]
|
| |
+
|
| |
# vim: set textwidth=120 ts=8 et sw=4:
|
| |
This adds a new convention,
FedoraBodhiResult
, for resultsassociated with Fedora Bodhi updates. It's pretty simple for
now; we could go query a bunch of properties of the update from
Bodhi and include them in the extradata, but not sure we need
to do that yet. I based the values on some results that are
already present in dev resultsdb, like:
http://taskotron-dev.fedoraproject.org/resultsdb/results/10516367