Merge "Fix the setup_workspace to handle missing ZUUL_BRANCH"
This commit is contained in:
@@ -345,7 +345,12 @@ function setup_project {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Try the specified branch before the ZUUL_BRANCH.
|
# Try the specified branch before the ZUUL_BRANCH.
|
||||||
|
if [[ ! -z $ZUUL_BRANCH ]]; then
|
||||||
OVERRIDE_ZUUL_REF=$(echo $ZUUL_REF | sed -e "s,$ZUUL_BRANCH,$branch,")
|
OVERRIDE_ZUUL_REF=$(echo $ZUUL_REF | sed -e "s,$ZUUL_BRANCH,$branch,")
|
||||||
|
else
|
||||||
|
OVERRIDE_ZUUL_REF=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Update git remotes
|
# Update git remotes
|
||||||
git_remote_update
|
git_remote_update
|
||||||
|
|||||||
@@ -398,6 +398,19 @@ function test_periodic {
|
|||||||
assert_equal "${TEST_GIT_CHECKOUTS[glance]}" 'stable/havana'
|
assert_equal "${TEST_GIT_CHECKOUTS[glance]}" 'stable/havana'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Run setup_project without setting a ZUUL_BRANCH which is how a subset of
|
||||||
|
# periodic jobs operate
|
||||||
|
function test_periodic_no_branch {
|
||||||
|
|
||||||
|
declare -A TEST_GIT_CHECKOUTS
|
||||||
|
declare -A TEST_ZUUL_REF
|
||||||
|
local ZUUL_PROJECT='openstack/glance'
|
||||||
|
|
||||||
|
setup_project openstack/glance 'master'
|
||||||
|
|
||||||
|
assert_equal "${TEST_GIT_CHECKOUTS[glance]}" 'master'
|
||||||
|
}
|
||||||
|
|
||||||
# setup_workspace fails without argument
|
# setup_workspace fails without argument
|
||||||
function test_workspace_branch_arg {
|
function test_workspace_branch_arg {
|
||||||
assert_raises setup_workspace
|
assert_raises setup_workspace
|
||||||
@@ -466,6 +479,7 @@ test_multi_branch_on_stable
|
|||||||
test_multi_branch_project_override
|
test_multi_branch_project_override
|
||||||
test_one_on_master
|
test_one_on_master
|
||||||
test_periodic
|
test_periodic
|
||||||
|
test_periodic_no_branch
|
||||||
test_two_on_master
|
test_two_on_master
|
||||||
test_workspace_branch_arg
|
test_workspace_branch_arg
|
||||||
test_call_hook_if_defined
|
test_call_hook_if_defined
|
||||||
|
|||||||
Reference in New Issue
Block a user