Enable test_post*
This requires some updating of how merger data construction gets
handled between Refs and Changes.
Change-Id: Icd81a95565ab137b98d6a8ac52e262487d412534
Story: 2000773
Task: 3389
diff --git a/tests/base.py b/tests/base.py
index b343655..af239ad 100755
--- a/tests/base.py
+++ b/tests/base.py
@@ -477,6 +477,9 @@
def getGitUrl(self, project):
return os.path.join(self.upstream_root, project.name)
+ def _getGitwebUrl(self, project, sha=None):
+ return self.getGitwebUrl(project, sha)
+
class BuildHistory(object):
def __init__(self, **kw):
diff --git a/tests/fixtures/config/single-tenant/git/layout-dont-ignore-ref-deletes/zuul.yaml b/tests/fixtures/config/single-tenant/git/layout-dont-ignore-ref-deletes/zuul.yaml
new file mode 100644
index 0000000..30e574a
--- /dev/null
+++ b/tests/fixtures/config/single-tenant/git/layout-dont-ignore-ref-deletes/zuul.yaml
@@ -0,0 +1,23 @@
+- pipeline:
+ name: post
+ manager: independent
+ source:
+ gerrit
+ trigger:
+ gerrit:
+ - event: ref-updated
+ ref: ^(?!refs/).*$
+ ignore-deletes: False
+
+- job:
+ name: project-post
+ nodes:
+ - name: static
+ image: ubuntu-xenial
+
+- project:
+ name: org/project
+ post:
+ jobs:
+ - project-post
+
diff --git a/tests/fixtures/layout-dont-ignore-deletes.yaml b/tests/fixtures/layout-dont-ignore-deletes.yaml
deleted file mode 100644
index 1cf3c71..0000000
--- a/tests/fixtures/layout-dont-ignore-deletes.yaml
+++ /dev/null
@@ -1,16 +0,0 @@
-includes:
- - python-file: custom_functions.py
-
-pipelines:
- - name: post
- manager: IndependentPipelineManager
- trigger:
- gerrit:
- - event: ref-updated
- ref: ^(?!refs/).*$
- ignore-deletes: False
-
-projects:
- - name: org/project
- post:
- - project-post
diff --git a/tests/test_scheduler.py b/tests/test_scheduler.py
index 5092cba..ac701c5 100755
--- a/tests/test_scheduler.py
+++ b/tests/test_scheduler.py
@@ -1004,7 +1004,6 @@
self.assertEqual(C.reported, 2)
self.assertEqual(len(self.history), 6)
- @skip("Disabled for early v3 development")
def test_post(self):
"Test that post jobs run"
@@ -1027,7 +1026,6 @@
self.assertEqual(len(self.history), 1)
self.assertIn('project-post', job_names)
- @skip("Disabled for early v3 development")
def test_post_ignore_deletes(self):
"Test that deleting refs does not trigger post jobs"
@@ -1050,12 +1048,10 @@
self.assertEqual(len(self.history), 0)
self.assertNotIn('project-post', job_names)
- @skip("Disabled for early v3 development")
def test_post_ignore_deletes_negative(self):
"Test that deleting refs does trigger post jobs"
- self.updateConfigLayout(
- 'tests/fixtures/layout-dont-ignore-deletes.yaml')
+ self.updateConfigLayout('layout-dont-ignore-ref-deletes')
self.sched.reconfigure(self.config)
e = {