Skip to content

Commit 6cc2289

Browse files
Add test-release makefile target
Signed-off-by: Abdur Rehman <razashahid107@gmail.com>
1 parent 7d82f35 commit 6cc2289

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ test-e2e:
179179
test-e2e-release:
180180
PASSES="build release e2e" ./test.sh $(GO_TEST_FLAGS)
181181

182+
.PHONY: test-release
183+
test-release:
184+
PASSES="release_tests" ./test.sh $(GO_TEST_FLAGS)
185+
182186
ensure-docker-test-image-exists:
183187
make pull-docker-test || ( echo "WARNING: Container Image not found in registry, building locally"; make build-docker-test )
184188

test.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,34 @@ function release_pass {
684684
mv /tmp/etcd ./bin/etcd-last-release
685685
}
686686

687+
function release_tests_pass {
688+
if [ -z "${VERSION:-}" ]; then
689+
VERSION=$(go list -m go.etcd.io/etcd/api/v3 2>/dev/null | \
690+
awk '{split(substr($2,2), a, "."); print a[1]"."a[2]".99"}')
691+
fi
692+
693+
if [ -n "${CI:-}" ]; then
694+
git config user.email "prow@etcd.io"
695+
git config user.name "Prow"
696+
697+
gpg --batch --gen-key <<EOF
698+
%no-protection
699+
Key-Type: 1
700+
Key-Length: 2048
701+
Subkey-Type: 1
702+
Subkey-Length: 2048
703+
Name-Real: Prow
704+
Name-Email: prow@etcd.io
705+
Expire-Date: 0
706+
EOF
707+
708+
git remote add origin https://github.com/etcd-io/etcd.git
709+
fi
710+
711+
DRY_RUN=true run "${ETCD_ROOT_DIR}/scripts/release.sh" --no-upload --no-docker-push --no-gh-release --in-place "${VERSION}"
712+
VERSION="${VERSION}" run "${ETCD_ROOT_DIR}/scripts/test_images.sh"
713+
}
714+
687715
function mod_tidy_for_module {
688716
# Watch for upstream solution: https://github.com/golang/go/issues/27005
689717
local tmpModDir

0 commit comments

Comments
 (0)