Add basic Github Zuul Reporter.
Change-Id: I3c34bb1354adb7c360e173c227f00bf987b7d30e
Co-Authored-By: Jan Hruban <jan.hruban@gooddata.com>
diff --git a/tests/base.py b/tests/base.py
index e33b510..d6304d7 100755
--- a/tests/base.py
+++ b/tests/base.py
@@ -693,6 +693,10 @@
# just returns master for now
return ['master']
+ def report(self, project, pr_number, message, params=None):
+ pull_request = self.pull_requests[pr_number - 1]
+ pull_request.addComment(message)
+
class BuildHistory(object):
def __init__(self, **kw):
diff --git a/tests/fixtures/layouts/basic-github.yaml b/tests/fixtures/layouts/basic-github.yaml
index 79d416a..f10fa6b 100644
--- a/tests/fixtures/layouts/basic-github.yaml
+++ b/tests/fixtures/layouts/basic-github.yaml
@@ -8,6 +8,10 @@
- opened
- changed
- reopened
+ success:
+ github: {}
+ failure:
+ github: {}
- job:
name: project-test1
diff --git a/tests/unit/test_github_driver.py b/tests/unit/test_github_driver.py
index 58f456f..430cab3 100644
--- a/tests/unit/test_github_driver.py
+++ b/tests/unit/test_github_driver.py
@@ -50,3 +50,4 @@
zuulvars = job.parameters['vars']['zuul']
self.assertEqual(pr.number, zuulvars['change'])
self.assertEqual(pr.head_sha, zuulvars['patchset'])
+ self.assertEqual(1, len(pr.comments))