Skip to content

Commit 5a907bb

Browse files
dsmileyclaude
andauthored
Rolling upgrade test: upgrade from latest previous major to this build (#5228)
smoke tester builds the RC image now too Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent c8abb33 commit 5a907bb

3 files changed

Lines changed: 39 additions & 17 deletions

File tree

‎dev-tools/scripts/releaseWizard.yaml‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,9 @@ groups:
915915
local_keys: '{% if keys_downloaded %} --local-keys "{{ [config_path, ''KEYS''] | path_join }}"{% endif %}'
916916
commands: !Commands
917917
root_folder: '{{ git_checkout_folder }}'
918-
commands_text: Here we'll smoke test the release by 'downloading' the artifacts, running the tests, validating GPG signatures etc.
918+
commands_text: |-
919+
Here we'll smoke test the release by 'downloading' the artifacts, running the tests, validating GPG signatures etc.
920+
Optionally, have a Docker daemon running first; some integration tests use Docker and are skipped without it.
919921
remove_files:
920922
- '{{ tmp_dir }}'
921923
commands:
@@ -989,6 +991,9 @@ groups:
989991
python3 -u dev-tools/scripts/smokeTestRelease.py \
990992
{{ release_candidate_location }}
991993
994+
Optionally, have a Docker daemon running before starting the smoke tester;
995+
some integration tests use Docker and are skipped without it.
996+
992997
You can build a release-candidate of the official docker images (full & slim) using the following command:
993998
994999
SOLR_DOWNLOAD_SERVER={{ release_candidate_location }}/solr && \

‎dev-tools/scripts/smokeTestRelease.py‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ def is_in_list(in_folder, files, indent=4):
618618
raise RuntimeError('file "%s" is missing' % file_name)
619619

620620

621-
def verifySrcUnpacked(java, artifact, unpackPath, version, testArgs):
621+
def verifySrcUnpacked(java, artifact, unpackPath, version, testArgs, tmpDir):
622622
# The source release is everything in source control minus excluded paths, so we don't
623623
# check that it has specific things — the build will fail if something critical is missing.
624624
# Also the binary release checks for presence of things that come from source control, so we're
@@ -653,6 +653,13 @@ def verifySrcUnpacked(java, artifact, unpackPath, version, testArgs):
653653

654654
print(" run tests w/ Java %s and testArgs='%s'..." % (java.version, testArgs))
655655
java.run_java('./gradlew test %s' % testArgs, '%s/test.log' % logDir)
656+
# Some integration tests need the Docker image of the binary release, and skip without it
657+
if subprocess.call('docker info', shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) == 0:
658+
print(" build docker image from solr-%s.tgz" % version)
659+
run('docker build -f solr-%s/docker/Dockerfile -t apache/solr:%s - < %s/solr-%s.tgz' % (version, version, tmpDir, version),
660+
'%s/docker.log' % logDir)
661+
else:
662+
print(" WARNING: Docker is not available; Docker-based integration tests will be skipped")
656663
print(" run integration tests w/ Java %s" % java.version)
657664
java.run_java('./gradlew integrationTest -Dversion.release=%s' % version, '%s/itest.log' % logDir)
658665
print(" build binary release w/ Java %s" % java.version)
@@ -1168,7 +1175,7 @@ def smokeTest(java, baseURL, gitRevision, version, tmpDir, isSigned, local_keys,
11681175
artifact = 'solr-%s-slim.tgz' % version
11691176
verifyBinaryUnpacked(java, artifact, unpack(tmpDir, artifact), version, gitRevision)
11701177
artifact = 'solr-%s-src.tgz' % version
1171-
verifySrcUnpacked(java, artifact, unpack(tmpDir, artifact), version, testArgs)
1178+
verifySrcUnpacked(java, artifact, unpack(tmpDir, artifact), version, testArgs, tmpDir)
11721179
print()
11731180
print('Test Maven artifacts...')
11741181
checkMaven(solrPath, tmpDir, gitRevision, version, isSigned, keysFile)

‎solr/packaging/test/test_rolling_upgrade.bats‎

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717

1818
load bats_helper
1919

20-
# You can test alternative images via
21-
# export SOLR_BEGIN_IMAGE="apache/solr-nightly:9.9.0-slim" and then running
20+
# Upgrades from the latest release of the previous major version to the image of the Solr version
21+
# under test, which must already exist locally (./gradlew dockerTag); the test is skipped otherwise.
22+
# Either image can be overridden, e.g.
23+
# export SOLR_BEGIN_IMAGE="solr:9.11-slim" and then running
2224
# ./gradlew iTest --tests test_rolling_upgrade.bats
23-
SOLR_BEGIN_IMAGE="${SOLR_BEGIN_IMAGE:-apache/solr-nightly:9.10.0-SNAPSHOT-slim}"
24-
SOLR_END_IMAGE="${SOLR_END_IMAGE:-apache/solr-nightly:10.0.0-SNAPSHOT-slim}"
2525

2626
setup() {
2727
common_clean_setup
@@ -30,8 +30,18 @@ setup() {
3030
if ! command -v docker >/dev/null 2>&1 || ! docker info >/dev/null 2>&1; then
3131
skip "Docker is not available"
3232
fi
33+
local solr_version major
34+
solr_version="$(basename "$SOLR_TIP")"
35+
solr_version="${solr_version#solr-}"
36+
major="${solr_version%%.*}"
37+
SOLR_BEGIN_IMAGE="${SOLR_BEGIN_IMAGE:-solr:$((major - 1))-slim}"
3338
docker pull "$SOLR_BEGIN_IMAGE" || skip "Docker image $SOLR_BEGIN_IMAGE is not available"
34-
docker pull "$SOLR_END_IMAGE" || skip "Docker image $SOLR_END_IMAGE is not available"
39+
40+
# Default matches the tag applied by the Gradle dockerTag task
41+
SOLR_END_IMAGE="${SOLR_END_IMAGE:-apache/solr:${solr_version}}"
42+
docker image inspect "$SOLR_END_IMAGE" >/dev/null 2>&1 || docker pull "$SOLR_END_IMAGE" ||
43+
skip "Docker image $SOLR_END_IMAGE is not available; build it with: ./gradlew dockerTag"
44+
export SOLR_BEGIN_IMAGE SOLR_END_IMAGE
3545

3646
# Record test start time for scoping logs on failure
3747
TEST_STARTED_AT_ISO=$(date -Iseconds)
@@ -85,9 +95,9 @@ teardown() {
8595
docker run --name solr-node1 -d \
8696
--network solrcloud-test \
8797
--memory=400m \
88-
--platform linux/amd64 \
98+
-e SOLR_MODE=solrcloud \
8999
-v solr-data1:/var/solr \
90-
"$SOLR_BEGIN_IMAGE" solr start -f -c -m 200m --host solr-node1 -p 8983
100+
"$SOLR_BEGIN_IMAGE" solr start -f -m 200m --host solr-node1 -p 8983
91101
docker exec solr-node1 solr assert --started http://solr-node1:8983 --timeout 10000
92102

93103
# start next 2 in parallel
@@ -96,17 +106,17 @@ teardown() {
96106
docker run --name solr-node2 -d \
97107
--network solrcloud-test \
98108
--memory=400m \
99-
--platform linux/amd64 \
109+
-e SOLR_MODE=solrcloud \
100110
-v solr-data2:/var/solr \
101-
"$SOLR_BEGIN_IMAGE" solr start -f -c -m 200m --host solr-node2 -p 8984 -z solr-node1:9983
111+
"$SOLR_BEGIN_IMAGE" solr start -f -m 200m --host solr-node2 -p 8984 -z solr-node1:9983
102112

103113
echo "Started solr-node3 connected to first node's ZooKeeper"
104114
docker run --name solr-node3 -d \
105115
--network solrcloud-test \
106116
--memory=400m \
107-
--platform linux/amd64 \
117+
-e SOLR_MODE=solrcloud \
108118
-v solr-data3:/var/solr \
109-
"$SOLR_BEGIN_IMAGE" solr start -f -c -m 200m --host solr-node3 -p 8985 -z solr-node1:9983
119+
"$SOLR_BEGIN_IMAGE" solr start -f -m 200m --host solr-node3 -p 8985 -z solr-node1:9983
110120

111121
docker exec solr-node2 solr assert --started http://solr-node2:8984 --timeout 30000
112122
docker exec solr-node3 solr assert --started http://solr-node3:8985 --timeout 30000
@@ -128,7 +138,7 @@ teardown() {
128138
docker run --name solr-node3 -d \
129139
--network solrcloud-test \
130140
--memory=400m \
131-
--platform linux/amd64 \
141+
-e SOLR_MODE=solrcloud \
132142
-v solr-data3:/var/solr \
133143
"$SOLR_END_IMAGE" solr start -f -m 200m --host solr-node3 -p 8985 -z solr-node1:9983
134144
docker exec solr-node3 solr assert --started http://solr-node3:8985 --timeout 30000
@@ -141,7 +151,7 @@ teardown() {
141151
docker run --name solr-node2 -d \
142152
--network solrcloud-test \
143153
--memory=400m \
144-
--platform linux/amd64 \
154+
-e SOLR_MODE=solrcloud \
145155
-v solr-data2:/var/solr \
146156
"$SOLR_END_IMAGE" solr start -f -m 200m --host solr-node2 -p 8984 -z solr-node1:9983
147157
docker exec solr-node2 solr assert --started http://solr-node2:8984 --timeout 30000
@@ -153,7 +163,7 @@ teardown() {
153163
docker run --name solr-node1 -d \
154164
--network solrcloud-test \
155165
--memory=400m \
156-
--platform linux/amd64 \
166+
-e SOLR_MODE=solrcloud \
157167
-v solr-data1:/var/solr \
158168
"$SOLR_END_IMAGE" solr start -f -m 200m --host solr-node1 -p 8983
159169
docker exec solr-node1 solr assert --started http://solr-node1:8983 --timeout 30000

0 commit comments

Comments
 (0)