This is an automated email from the ASF dual-hosted git repository. dsmiley pushed a commit to branch branch_10x in repository https://gitbox.apache.org/repos/asf/solr.git
commit 4ddf688a106f95df9422cf0c811d486351e07356 Author: David Smiley <[email protected]> AuthorDate: Tue Oct 27 20:25:54 2026 -0400 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 <[email protected]> (cherry picked from commit 5a907bbb0e5cdfeb432e54f89d491af0a0c11d98) --- dev-tools/scripts/releaseWizard.yaml | 7 ++++- dev-tools/scripts/smokeTestRelease.py | 11 ++++++-- solr/packaging/test/test_rolling_upgrade.bats | 38 +++++++++++++++++---------- 3 files changed, 39 insertions(+), 17 deletions(-) diff --git a/dev-tools/scripts/releaseWizard.yaml b/dev-tools/scripts/releaseWizard.yaml index 504f8478eb9..7df8e8f439f 100644 --- a/dev-tools/scripts/releaseWizard.yaml +++ b/dev-tools/scripts/releaseWizard.yaml @@ -916,7 +916,9 @@ groups: local_keys: '{% if keys_downloaded %} --local-keys "{{ [config_path, ''KEYS''] | path_join }}"{% endif %}' commands: !Commands root_folder: '{{ git_checkout_folder }}' - commands_text: Here we'll smoke test the release by 'downloading' the artifacts, running the tests, validating GPG signatures etc. + commands_text: |- + Here we'll smoke test the release by 'downloading' the artifacts, running the tests, validating GPG signatures etc. + Optionally, have a Docker daemon running first; some integration tests use Docker and are skipped without it. remove_files: - '{{ tmp_dir }}' commands: @@ -990,6 +992,9 @@ groups: python3 -u dev-tools/scripts/smokeTestRelease.py \ {{ release_candidate_location }} + Optionally, have a Docker daemon running before starting the smoke tester; + some integration tests use Docker and are skipped without it. + You can build a release-candidate of the official docker images (full & slim) using the following command: SOLR_DOWNLOAD_SERVER={{ release_candidate_location }}/solr && \ diff --git a/dev-tools/scripts/smokeTestRelease.py b/dev-tools/scripts/smokeTestRelease.py index 24a9e395e24..746138fb103 100755 --- a/dev-tools/scripts/smokeTestRelease.py +++ b/dev-tools/scripts/smokeTestRelease.py @@ -618,7 +618,7 @@ def is_in_list(in_folder, files, indent=4): raise RuntimeError('file "%s" is missing' % file_name) -def verifySrcUnpacked(java, artifact, unpackPath, version, testArgs): +def verifySrcUnpacked(java, artifact, unpackPath, version, testArgs, tmpDir): # The source release is everything in source control minus excluded paths, so we don't # check that it has specific things — the build will fail if something critical is missing. # 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): print(" run tests w/ Java %s and testArgs='%s'..." % (java.version, testArgs)) java.run_java('./gradlew test %s' % testArgs, '%s/test.log' % logDir) + # Some integration tests need the Docker image of the binary release, and skip without it + if subprocess.call('docker info', shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) == 0: + print(" build docker image from solr-%s.tgz" % version) + run('docker build -f solr-%s/docker/Dockerfile -t apache/solr:%s - < %s/solr-%s.tgz' % (version, version, tmpDir, version), + '%s/docker.log' % logDir) + else: + print(" WARNING: Docker is not available; Docker-based integration tests will be skipped") print(" run integration tests w/ Java %s" % java.version) java.run_java('./gradlew integrationTest -Dversion.release=%s' % version, '%s/itest.log' % logDir) print(" build binary release w/ Java %s" % java.version) @@ -1168,7 +1175,7 @@ def smokeTest(java, baseURL, gitRevision, version, tmpDir, isSigned, local_keys, artifact = 'solr-%s-slim.tgz' % version verifyBinaryUnpacked(java, artifact, unpack(tmpDir, artifact), version, gitRevision) artifact = 'solr-%s-src.tgz' % version - verifySrcUnpacked(java, artifact, unpack(tmpDir, artifact), version, testArgs) + verifySrcUnpacked(java, artifact, unpack(tmpDir, artifact), version, testArgs, tmpDir) print() print('Test Maven artifacts...') checkMaven(solrPath, tmpDir, gitRevision, version, isSigned, keysFile) diff --git a/solr/packaging/test/test_rolling_upgrade.bats b/solr/packaging/test/test_rolling_upgrade.bats index ae956a868ba..13010eb17e1 100644 --- a/solr/packaging/test/test_rolling_upgrade.bats +++ b/solr/packaging/test/test_rolling_upgrade.bats @@ -17,11 +17,11 @@ load bats_helper -# You can test alternative images via -# export SOLR_BEGIN_IMAGE="apache/solr-nightly:9.9.0-slim" and then running +# Upgrades from the latest release of the previous major version to the image of the Solr version +# under test, which must already exist locally (./gradlew dockerTag); the test is skipped otherwise. +# Either image can be overridden, e.g. +# export SOLR_BEGIN_IMAGE="solr:9.11-slim" and then running # ./gradlew iTest --tests test_rolling_upgrade.bats -SOLR_BEGIN_IMAGE="${SOLR_BEGIN_IMAGE:-apache/solr-nightly:9.10.0-SNAPSHOT-slim}" -SOLR_END_IMAGE="${SOLR_END_IMAGE:-apache/solr-nightly:10.0.0-SNAPSHOT-slim}" setup() { common_clean_setup @@ -30,8 +30,18 @@ setup() { if ! command -v docker >/dev/null 2>&1 || ! docker info >/dev/null 2>&1; then skip "Docker is not available" fi + local solr_version major + solr_version="$(basename "$SOLR_TIP")" + solr_version="${solr_version#solr-}" + major="${solr_version%%.*}" + SOLR_BEGIN_IMAGE="${SOLR_BEGIN_IMAGE:-solr:$((major - 1))-slim}" docker pull "$SOLR_BEGIN_IMAGE" || skip "Docker image $SOLR_BEGIN_IMAGE is not available" - docker pull "$SOLR_END_IMAGE" || skip "Docker image $SOLR_END_IMAGE is not available" + + # Default matches the tag applied by the Gradle dockerTag task + SOLR_END_IMAGE="${SOLR_END_IMAGE:-apache/solr:${solr_version}}" + docker image inspect "$SOLR_END_IMAGE" >/dev/null 2>&1 || docker pull "$SOLR_END_IMAGE" || + skip "Docker image $SOLR_END_IMAGE is not available; build it with: ./gradlew dockerTag" + export SOLR_BEGIN_IMAGE SOLR_END_IMAGE # Record test start time for scoping logs on failure TEST_STARTED_AT_ISO=$(date -Iseconds) @@ -85,9 +95,9 @@ teardown() { docker run --name solr-node1 -d \ --network solrcloud-test \ --memory=400m \ - --platform linux/amd64 \ + -e SOLR_MODE=solrcloud \ -v solr-data1:/var/solr \ - "$SOLR_BEGIN_IMAGE" solr start -f -c -m 200m --host solr-node1 -p 8983 + "$SOLR_BEGIN_IMAGE" solr start -f -m 200m --host solr-node1 -p 8983 docker exec solr-node1 solr assert --started http://solr-node1:8983 --timeout 10000 # start next 2 in parallel @@ -96,17 +106,17 @@ teardown() { docker run --name solr-node2 -d \ --network solrcloud-test \ --memory=400m \ - --platform linux/amd64 \ + -e SOLR_MODE=solrcloud \ -v solr-data2:/var/solr \ - "$SOLR_BEGIN_IMAGE" solr start -f -c -m 200m --host solr-node2 -p 8984 -z solr-node1:9983 + "$SOLR_BEGIN_IMAGE" solr start -f -m 200m --host solr-node2 -p 8984 -z solr-node1:9983 echo "Started solr-node3 connected to first node's ZooKeeper" docker run --name solr-node3 -d \ --network solrcloud-test \ --memory=400m \ - --platform linux/amd64 \ + -e SOLR_MODE=solrcloud \ -v solr-data3:/var/solr \ - "$SOLR_BEGIN_IMAGE" solr start -f -c -m 200m --host solr-node3 -p 8985 -z solr-node1:9983 + "$SOLR_BEGIN_IMAGE" solr start -f -m 200m --host solr-node3 -p 8985 -z solr-node1:9983 docker exec solr-node2 solr assert --started http://solr-node2:8984 --timeout 30000 docker exec solr-node3 solr assert --started http://solr-node3:8985 --timeout 30000 @@ -128,7 +138,7 @@ teardown() { docker run --name solr-node3 -d \ --network solrcloud-test \ --memory=400m \ - --platform linux/amd64 \ + -e SOLR_MODE=solrcloud \ -v solr-data3:/var/solr \ "$SOLR_END_IMAGE" solr start -f -m 200m --host solr-node3 -p 8985 -z solr-node1:9983 docker exec solr-node3 solr assert --started http://solr-node3:8985 --timeout 30000 @@ -141,7 +151,7 @@ teardown() { docker run --name solr-node2 -d \ --network solrcloud-test \ --memory=400m \ - --platform linux/amd64 \ + -e SOLR_MODE=solrcloud \ -v solr-data2:/var/solr \ "$SOLR_END_IMAGE" solr start -f -m 200m --host solr-node2 -p 8984 -z solr-node1:9983 docker exec solr-node2 solr assert --started http://solr-node2:8984 --timeout 30000 @@ -153,7 +163,7 @@ teardown() { docker run --name solr-node1 -d \ --network solrcloud-test \ --memory=400m \ - --platform linux/amd64 \ + -e SOLR_MODE=solrcloud \ -v solr-data1:/var/solr \ "$SOLR_END_IMAGE" solr start -f -m 200m --host solr-node1 -p 8983 docker exec solr-node1 solr assert --started http://solr-node1:8983 --timeout 30000
