aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/release/release_test.sh
diff options
context:
space:
mode:
authorGravatar Damien Martin-Guillerez <dmarting@google.com>2016-11-18 15:50:00 +0000
committerGravatar Dmitry Lomov <dslomov@google.com>2016-11-21 19:35:11 +0000
commitfa1ee08b5e154900341109fd6b0dd6c675987a0f (patch)
tree1cc73b8e19eb8db298570c782841920ee7610f55 /scripts/release/release_test.sh
parent8f45b7c71394f07227e507fddf736bcf6d5b0097 (diff)
Release script: add a --force_rc command to override the candidate number
-- Change-Id: I9eb4897dd65e1f63fb4a1ff59ba901f81cd2e6c0 Reviewed-on: https://cr.bazel.build/7336 MOS_MIGRATED_REVID=139580860
Diffstat (limited to 'scripts/release/release_test.sh')
-rwxr-xr-xscripts/release/release_test.sh18
1 files changed, 13 insertions, 5 deletions
diff --git a/scripts/release/release_test.sh b/scripts/release/release_test.sh
index aa4eb33d48..3b1d87004a 100755
--- a/scripts/release/release_test.sh
+++ b/scripts/release/release_test.sh
@@ -50,13 +50,19 @@ EOF
}
function create() {
+ local name="$1"
+ local commit="$2"
+ if [[ "$1" =~ ^--force_rc=([0-9]*)$ ]]; then
+ name="$2"
+ commit="$3"
+ fi
local old_branch=$(git_get_branch)
${RELEASE_SCRIPT} create $@ &> $TEST_log \
- || fail "Failed to cut release $1 at commit $2"
+ || fail "Failed to cut release $name at commit $commit"
local new_branch=$(git_get_branch)
assert_equals "$old_branch" "$new_branch"
- assert_contains "Created $1.* on branch release-$1." $TEST_log
- git show -s --pretty=format:%B "release-$1" >$TEST_log
+ assert_contains "Created $name.* on branch release-$name." $TEST_log
+ git show -s --pretty=format:%B "release-$name" >$TEST_log
}
function push() {
@@ -206,6 +212,7 @@ Cherry picks:
'
assert_equals "${header}Test replacement" "$(cat ${TEST_log})"
+ assert_equals 1 "$(get_release_candidate release-v1)"
push v1
# Test creating a second candidate
@@ -226,7 +233,7 @@ Cherry picks:
- Attribute error messages related to Android resources are easier
to understand now.'
assert_equals "${header}${RELNOTES}" "$(cat ${TEST_log})"
- assert_equals 2 "$(get_release_candidate)"
+ assert_equals 2 "$(get_release_candidate release-v1)"
# Push the release
push v1
@@ -239,9 +246,10 @@ Cherry picks:
echo 'Dummy release' >\$1
EOF
# Create release
- create v2 2464526
+ create --force_rc=2 v2 2464526
expect_log "Release v2"
expect_log "Baseline: 2464526"
+ assert_equals 2 "$(get_release_candidate release-v2)"
# Abandon it
abandon v2
# Add a commit hook to test if it is ignored