Browse Source

Add a note on testing trusted roles

Add a general note on testing, and specifically on how to use test
roles for testing trusted roles in the gate.

Change-Id: Idf84bc56effbb21f7b7a82703f398fb203c3694b
changes/78/624578/3
Ian Wienand 6 months ago
parent
commit
990fe95337
1 changed files with 36 additions and 0 deletions
  1. 36
    0
      doc/source/policy.rst

+ 36
- 0
doc/source/policy.rst View File

@@ -70,6 +70,42 @@ as ``example_role_variable``; e.g.
70 70
       vars:
71 71
         example_role_variable: 'something'
72 72
 
73
+Testing
74
+-------
75
+
76
+`zuul-jobs` is often consumed from the master branch and many parts of
77
+`zuul-jobs` are involved in base setup.  Thus bad changes have a
78
+larger than usual potential to quickly produce global problems.
79
+Demonstrated testing of changes is very important and is requested of
80
+all proposed changes.
81
+
82
+Since many roles in `zuul-jobs` are run from trusted jobs that run
83
+directly on the executor, often changes are not self-testing.  In such
84
+cases, it may be possible to demonstrate sufficient testing via
85
+external methods.  This should be noted carefully in the review.
86
+
87
+To use the OpenStack gate, you should develop your change as usual
88
+with as much testing as possible.  Once you have pushed the main
89
+review, you should clone the changes to the role being tested to a
90
+``test-<rolename>`` role in a new change (there may already be a
91
+``test-<rolename>`` if someone has done this before you; in this case,
92
+update it with your change).  Then rebase this testing change *before*
93
+your main change (the commit message should say something along the
94
+lines of "This change is for pre-testing of change I...").
95
+
96
+Reviewers can commit this change without affecting production jobs.
97
+You then need to look at the ``playbooks/base-test/`` files in
98
+``project-config`` and make sure they are using the
99
+``test-<rolename>`` role, which should now be committed (in some
100
+cases, if it has been done before, it may already be; otherwise
101
+propose a change to swap the role in ``base-test`` that Depends-On
102
+your ``test-<rolename>`` addition).  You can then reparent a
103
+do-not-merge job to ``base-test`` and your changes will be executed.
104
+
105
+After this, the actual change can be merged.  Note that after this,
106
+the ``test-<rolename>`` and ``<rolename>`` roles will be identical,
107
+which is how it should remain until the next proposed change.
108
+
73 109
 .. _zuul-announce: http://lists.zuul-ci.org/cgi-bin/mailman/listinfo/zuul-announce
74 110
 .. _zuul-discuss: http://lists.zuul-ci.org/cgi-bin/mailman/listinfo/zuul-discuss
75 111
 

Loading…
Cancel
Save