Re-enable merge-mode config option and add more tests
This re-enables the ability for projects to define their own merging
behavior via the project merge-mode option.
It re-enables and reworks the old v2.5 test_build_configuration test, which
was written against the cherry-pick merge mode. Prior to this patch, all
merges were hard-coded to use the merge-recovery mode, so two new tests are
also added here to test those configurations as well.
Change-Id: Ief9430b3a3c33b0c9d7ebf3fd0361166e2a5a1af
Story: 2000785
Task: 3309
diff --git a/tests/fixtures/config/merge-modes/git/common-config/zuul.yaml b/tests/fixtures/config/merge-modes/git/common-config/zuul.yaml
new file mode 100644
index 0000000..a7a4c78
--- /dev/null
+++ b/tests/fixtures/config/merge-modes/git/common-config/zuul.yaml
@@ -0,0 +1,62 @@
+- pipeline:
+ name: check
+ manager: independent
+ source:
+ gerrit
+ trigger:
+ gerrit:
+ - event: patchset-created
+ success:
+ gerrit:
+ verified: 1
+ failure:
+ gerrit:
+ verified: -1
+
+- pipeline:
+ name: gate
+ manager: dependent
+ success-message: Build succeeded (gate).
+ source:
+ gerrit
+ trigger:
+ gerrit:
+ - event: comment-added
+ approval:
+ - approved: 1
+ success:
+ gerrit:
+ verified: 2
+ submit: true
+ failure:
+ gerrit:
+ verified: -2
+ start:
+ gerrit:
+ verified: 0
+ precedence: high
+
+- job:
+ name:
+ project-test1
+
+- project:
+ name: org/project-merge
+ merge-mode: merge
+ gate:
+ jobs:
+ - project-test1
+
+- project:
+ name: org/project-merge-resolve
+ merge-mode: merge-resolve
+ gate:
+ jobs:
+ - project-test1
+
+- project:
+ name: org/project-cherry-pick
+ merge-mode: cherry-pick
+ gate:
+ jobs:
+ - project-test1
diff --git a/tests/fixtures/config/merge-modes/git/org_project-cherry-pick/README b/tests/fixtures/config/merge-modes/git/org_project-cherry-pick/README
new file mode 100644
index 0000000..9daeafb
--- /dev/null
+++ b/tests/fixtures/config/merge-modes/git/org_project-cherry-pick/README
@@ -0,0 +1 @@
+test
diff --git a/tests/fixtures/config/merge-modes/git/org_project-merge-resolve/README b/tests/fixtures/config/merge-modes/git/org_project-merge-resolve/README
new file mode 100644
index 0000000..9daeafb
--- /dev/null
+++ b/tests/fixtures/config/merge-modes/git/org_project-merge-resolve/README
@@ -0,0 +1 @@
+test
diff --git a/tests/fixtures/config/merge-modes/git/org_project-merge/README b/tests/fixtures/config/merge-modes/git/org_project-merge/README
new file mode 100644
index 0000000..9daeafb
--- /dev/null
+++ b/tests/fixtures/config/merge-modes/git/org_project-merge/README
@@ -0,0 +1 @@
+test
diff --git a/tests/fixtures/config/merge-modes/main.yaml b/tests/fixtures/config/merge-modes/main.yaml
new file mode 100644
index 0000000..a22ed5c
--- /dev/null
+++ b/tests/fixtures/config/merge-modes/main.yaml
@@ -0,0 +1,6 @@
+- tenant:
+ name: tenant-one
+ source:
+ gerrit:
+ config-repos:
+ - common-config