Cloner: default to ZUUL_BRANCH
The cloner takes an argument for the "indicated branch", however,
that argument has a default value of None, rendering it optional.
In the original setup method from devstack gate, that argument
was not optional, instead, it was typically set to ZUUL_BRANCH
unless it needed to be specified otherwise, for example for grenade.
Effectively, if omitted the (optional) branch argument to the cloner
it would use the 'master' branch in preference to the ZUUL_BRANCH
for projects that do not have a zuul ref. This is not the desired
behavior in the simple case (or quite likely any case), and therefore
should not be the default behavior for the cloner.
Resolve this by having the cloner treat the indicated branch as
ZUUL_BRANCH unless it is specified in the branch argument. In doing
this, the logic in the cloner is slightly simplified and now more
closely matches that in the setup_project function in devstack-gate.
Rename the cloner test to 'test_one_branch' to match the pattern from
devstack-gate tests. This test encompases the 'test_one_on_master'
and 'test_two_on_master' tests from d-g. They are combined because
in these tests we are able to iterate over the Zuul builds and check
the state for each build in turn, which is a more complete form of
testing than what was employed in d-g.
Add the 'test_multi_branch' test to the cloner. This encompases
'test_multi_branch_on_master' (with an additional fourth project
with no changes), as well as 'test_multi_branch_on_stable'.
Change-Id: Ib26bced46073bd61298c52c836a20085511201f3
4 files changed