Clean up bad layout files in zuul tests
Clean up the bad layout files in the zuul tests by removing a redundant
file (bad_pipeline and bad_pipeline1.yaml were identical). Annotate the
reason the layout is bad in each file. Finally remove a redundant swift
section. Both bad switf sections were failing for the same reason, a
missing name entry.
Change-Id: I0fd09da1fb0ec7443fa7d12a3b31809546a01afd
diff --git a/tests/fixtures/layouts/bad_merge_failure.yaml b/tests/fixtures/layouts/bad_merge_failure.yaml
index 313d23b..fc6854e 100644
--- a/tests/fixtures/layouts/bad_merge_failure.yaml
+++ b/tests/fixtures/layouts/bad_merge_failure.yaml
@@ -10,6 +10,7 @@
failure:
gerrit:
verified: -1
+ # merge-failure-message needs a string.
merge-failure-message:
- name: gate
diff --git a/tests/fixtures/layouts/bad_pipelines b/tests/fixtures/layouts/bad_pipelines
deleted file mode 100644
index f627208..0000000
--- a/tests/fixtures/layouts/bad_pipelines
+++ /dev/null
@@ -1 +0,0 @@
-pipelines:
diff --git a/tests/fixtures/layouts/bad_pipelines1.yaml b/tests/fixtures/layouts/bad_pipelines1.yaml
index da90933..09638bc 100644
--- a/tests/fixtures/layouts/bad_pipelines1.yaml
+++ b/tests/fixtures/layouts/bad_pipelines1.yaml
@@ -1,2 +1,2 @@
+# Pipelines completely missing. At least one is required.
pipelines:
-
diff --git a/tests/fixtures/layouts/bad_pipelines10.yaml b/tests/fixtures/layouts/bad_pipelines10.yaml
index 5248c17..ddde946 100644
--- a/tests/fixtures/layouts/bad_pipelines10.yaml
+++ b/tests/fixtures/layouts/bad_pipelines10.yaml
@@ -4,4 +4,5 @@
projects:
- name: foo
- merge-mode: foo
\ No newline at end of file
+ # merge-mode must be one of merge, merge-resolve, cherry-pick.
+ merge-mode: foo
diff --git a/tests/fixtures/layouts/bad_pipelines2.yaml b/tests/fixtures/layouts/bad_pipelines2.yaml
index e75a561..fc1e154 100644
--- a/tests/fixtures/layouts/bad_pipelines2.yaml
+++ b/tests/fixtures/layouts/bad_pipelines2.yaml
@@ -1,4 +1,5 @@
pipelines:
+ # name is required for pipelines
- noname: check
manager: IndependentPipelineManager
diff --git a/tests/fixtures/layouts/bad_pipelines3.yaml b/tests/fixtures/layouts/bad_pipelines3.yaml
index 0c11a85..93ac266 100644
--- a/tests/fixtures/layouts/bad_pipelines3.yaml
+++ b/tests/fixtures/layouts/bad_pipelines3.yaml
@@ -1,5 +1,7 @@
pipelines:
- name: check
+ # The manager must be one of IndependentPipelineManager
+ # or DependentPipelineManager
manager: NonexistentPipelineManager
projects:
diff --git a/tests/fixtures/layouts/bad_pipelines4.yaml b/tests/fixtures/layouts/bad_pipelines4.yaml
index 7f58024..3a91604 100644
--- a/tests/fixtures/layouts/bad_pipelines4.yaml
+++ b/tests/fixtures/layouts/bad_pipelines4.yaml
@@ -3,6 +3,7 @@
manager: IndependentPipelineManager
trigger:
gerrit:
+ # non-event is not a valid gerrit event
- event: non-event
projects:
diff --git a/tests/fixtures/layouts/bad_pipelines5.yaml b/tests/fixtures/layouts/bad_pipelines5.yaml
index 929c1a9..f95a78e 100644
--- a/tests/fixtures/layouts/bad_pipelines5.yaml
+++ b/tests/fixtures/layouts/bad_pipelines5.yaml
@@ -3,6 +3,7 @@
manager: IndependentPipelineManager
trigger:
gerrit:
+ # event is a required item but it is missing.
- approval:
- approved: 1
diff --git a/tests/fixtures/layouts/bad_pipelines6.yaml b/tests/fixtures/layouts/bad_pipelines6.yaml
index 6dcdaf3..aa91c77 100644
--- a/tests/fixtures/layouts/bad_pipelines6.yaml
+++ b/tests/fixtures/layouts/bad_pipelines6.yaml
@@ -4,6 +4,7 @@
trigger:
gerrit:
- event: comment-added
+ # approved is not a valid entry. Should be approval.
approved: 1
projects:
diff --git a/tests/fixtures/layouts/bad_pipelines7.yaml b/tests/fixtures/layouts/bad_pipelines7.yaml
index 7517b9a..e2db495 100644
--- a/tests/fixtures/layouts/bad_pipelines7.yaml
+++ b/tests/fixtures/layouts/bad_pipelines7.yaml
@@ -1,4 +1,5 @@
pipelines:
+ # The pipeline must have a name.
- manager: IndependentPipelineManager
projects:
diff --git a/tests/fixtures/layouts/bad_pipelines8.yaml b/tests/fixtures/layouts/bad_pipelines8.yaml
index eeab038..9c5918e 100644
--- a/tests/fixtures/layouts/bad_pipelines8.yaml
+++ b/tests/fixtures/layouts/bad_pipelines8.yaml
@@ -1,4 +1,5 @@
pipelines:
+ # The pipeline must have a manager
- name: check
projects:
diff --git a/tests/fixtures/layouts/bad_pipelines9.yaml b/tests/fixtures/layouts/bad_pipelines9.yaml
index ebb2e1f..89307d5 100644
--- a/tests/fixtures/layouts/bad_pipelines9.yaml
+++ b/tests/fixtures/layouts/bad_pipelines9.yaml
@@ -1,4 +1,5 @@
pipelines:
+ # Names must be unique.
- name: check
manager: IndependentPipelineManager
- name: check
diff --git a/tests/fixtures/layouts/bad_projects1.yaml b/tests/fixtures/layouts/bad_projects1.yaml
index c210c43..e3d381f 100644
--- a/tests/fixtures/layouts/bad_projects1.yaml
+++ b/tests/fixtures/layouts/bad_projects1.yaml
@@ -4,6 +4,7 @@
projects:
- name: foo
+ # gate pipeline is not defined.
gate:
- test
diff --git a/tests/fixtures/layouts/bad_projects2.yaml b/tests/fixtures/layouts/bad_projects2.yaml
index b91ed9d..9291cc9 100644
--- a/tests/fixtures/layouts/bad_projects2.yaml
+++ b/tests/fixtures/layouts/bad_projects2.yaml
@@ -5,5 +5,6 @@
projects:
- name: foo
check:
+ # Indentation is one level too deep on the last line.
- test
- foo
diff --git a/tests/fixtures/layouts/bad_swift.yaml b/tests/fixtures/layouts/bad_swift.yaml
index d8a8c3f..e79dca6 100644
--- a/tests/fixtures/layouts/bad_swift.yaml
+++ b/tests/fixtures/layouts/bad_swift.yaml
@@ -16,11 +16,10 @@
swift:
- name: logs
- name: ^.*-merge$
+ # swift requires a name
swift:
container: merge_assets
failure-message: Unable to merge change
- - name: test-test
- swift:
projects:
- name: test-org/test
diff --git a/tests/fixtures/layouts/bad_template1.yaml b/tests/fixtures/layouts/bad_template1.yaml
index 15822d1..cab17a1 100644
--- a/tests/fixtures/layouts/bad_template1.yaml
+++ b/tests/fixtures/layouts/bad_template1.yaml
@@ -10,7 +10,7 @@
project-templates:
- name: template-generic
check:
- # Template uses the 'project' parameter' which must
+ # Template uses the 'project' parameter' which must be provided
- '{project}-merge'
projects: