Use Redis 7.2 for build.
Update jenkinsfile to test against redis 7.2 Replace usage of DEBUG command. Provide Redis server version and client lib version to maven build system / gradle cache. Original Pull Request: #2802
This commit is contained in:
38
Jenkinsfile
vendored
38
Jenkinsfile
vendored
@@ -40,6 +40,26 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Publish JDK 17 + Redis 7.2 Docker Image') {
|
||||
when {
|
||||
anyOf {
|
||||
changeset "ci/openjdk17-redis-7.2/Dockerfile"
|
||||
changeset "Makefile"
|
||||
changeset "ci/pipeline.properties"
|
||||
}
|
||||
}
|
||||
agent { label 'data' }
|
||||
options { timeout(time: 20, unit: 'MINUTES') }
|
||||
|
||||
steps {
|
||||
script {
|
||||
def image = docker.build("springci/spring-data-with-redis-7.2:${p['java.main.tag']}", "--build-arg BASE=${p['docker.java.main.image']} --build-arg REDIS=${p['docker.redis.7.version']} -f ci/openjdk17-redis-7.2/Dockerfile .")
|
||||
docker.withRegistry(p['docker.registry'], p['docker.credentials']) {
|
||||
image.push()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Publish JDK 21 + Redis 6.2 Docker Image') {
|
||||
when {
|
||||
anyOf {
|
||||
@@ -134,6 +154,24 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("test: Redis 7") {
|
||||
agent {
|
||||
label 'data'
|
||||
}
|
||||
options { timeout(time: 30, unit: 'MINUTES') }
|
||||
environment {
|
||||
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
|
||||
DEVELOCITY_CACHE = credentials("${p['develocity.cache.credentials']}")
|
||||
DEVELOCITY_ACCESS_KEY = credentials("${p['develocity.access-key']}")
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
docker.image("harbor-repo.vmware.com/dockerhub-proxy-cache/springci/spring-data-with-redis-7.2:${p['java.main.tag']}").inside('-v $HOME:/tmp/jenkins-home') {
|
||||
sh "PROFILE=none LONG_TESTS=true JENKINS_USER_NAME=${p['jenkins.user.name']} ci/test.sh"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
8
Makefile
8
Makefile
@@ -12,7 +12,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
REDIS_VERSION:=6.2.6
|
||||
REDIS_VERSION:=7.2.4
|
||||
SPRING_PROFILE?=ci
|
||||
SHELL=/bin/bash -euo pipefail
|
||||
|
||||
@@ -175,7 +175,7 @@ clobber:
|
||||
work/redis/bin/redis-cli work/redis/bin/redis-server:
|
||||
@mkdir -p work/redis
|
||||
|
||||
curl -sSL https://github.com/antirez/redis/archive/$(REDIS_VERSION).tar.gz | tar xzf - -C work
|
||||
curl -sSL https://github.com/redis/redis/archive/$(REDIS_VERSION).tar.gz | tar xzf - -C work
|
||||
$(MAKE) -C work/redis-$(REDIS_VERSION) -j
|
||||
$(MAKE) -C work/redis-$(REDIS_VERSION) PREFIX=$(shell pwd)/work/redis install
|
||||
rm -rf work/redis-$(REDIS_VERSION)
|
||||
@@ -196,14 +196,14 @@ stop: redis-stop sentinel-stop cluster-stop
|
||||
test:
|
||||
$(MAKE) start
|
||||
sleep 1
|
||||
./mvnw clean test -U -P$(SPRING_PROFILE) || (echo "maven failed $$?"; exit 1)
|
||||
./mvnw clean test -U -P$(SPRING_PROFILE) -Dredis.server.version=$(REDIS_VERSION) || (echo "maven failed $$?"; exit 1)
|
||||
$(MAKE) stop
|
||||
$(MAKE) clean
|
||||
|
||||
all-tests:
|
||||
$(MAKE) start
|
||||
sleep 1
|
||||
./mvnw clean test -U -DrunLongTests=true -P$(SPRING_PROFILE) || (echo "maven failed $$?"; exit 1)
|
||||
./mvnw clean test -U -DrunLongTests=true -P$(SPRING_PROFILE) -Dredis.server.version=$(REDIS_VERSION) || (echo "maven failed $$?"; exit 1)
|
||||
$(MAKE) stop
|
||||
$(MAKE) clean
|
||||
|
||||
|
||||
17
ci/openjdk17-redis-7.2/Dockerfile
Normal file
17
ci/openjdk17-redis-7.2/Dockerfile
Normal file
@@ -0,0 +1,17 @@
|
||||
ARG BASE
|
||||
FROM ${BASE}
|
||||
# Any ARG statements before FROM are cleared.
|
||||
ARG REDIS
|
||||
ENV REDIS_VERSION=${REDIS}
|
||||
|
||||
# Copy Spring Data Redis's Makefile into the container
|
||||
COPY ./Makefile /
|
||||
|
||||
RUN set -eux; \
|
||||
# sed -i -e 's/http/https/g' /etc/apt/sources.list ; \
|
||||
apt-get update ; \
|
||||
apt-get install -y build-essential ; \
|
||||
make work/redis/bin/redis-cli work/redis/bin/redis-server REDIS_VERSION=${REDIS}; \
|
||||
chmod -R o+rw work; \
|
||||
apt-get clean; \
|
||||
rm -rf /var/lib/apt/lists/*;
|
||||
@@ -14,6 +14,7 @@ docker.mongodb.7.0.version=7.0.2
|
||||
|
||||
# Supported versions of Redis
|
||||
docker.redis.6.version=6.2.13
|
||||
docker.redis.7.version=7.2.4
|
||||
|
||||
# Supported versions of Cassandra
|
||||
docker.cassandra.3.version=3.11.16
|
||||
|
||||
@@ -18,7 +18,7 @@ export JENKINS_USER=${JENKINS_USER_NAME}
|
||||
export GRADLE_ENTERPRISE_ACCESS_KEY=${DEVELOCITY_ACCESS_KEY}
|
||||
|
||||
# Execute maven test
|
||||
MAVEN_OPTS="-Duser.name=${JENKINS_USER} -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml clean test -P${PROFILE} -DrunLongTests=${LONG_TESTS:-false} -U -B
|
||||
MAVEN_OPTS="-Duser.name=${JENKINS_USER} -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml clean test -P${PROFILE} -DrunLongTests=${LONG_TESTS:-false} -Dredis.server.version=${REDIS_VERSION:-unknown} -U -B
|
||||
|
||||
# Capture resulting exit code from maven (pass/fail)
|
||||
RESULT=$?
|
||||
|
||||
5
pom.xml
5
pom.xml
@@ -297,6 +297,11 @@
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<systemPropertyVariables>
|
||||
<redis.server.version>${redis.server.version}</redis.server.version>
|
||||
<lettuce>${lettuce}</lettuce>
|
||||
<jedis>${jedis}</jedis>
|
||||
</systemPropertyVariables>
|
||||
<!-- Retain stack traces -->
|
||||
<argLine>-XX:-OmitStackTraceInFastThrow</argLine>
|
||||
<useSystemClassLoader>false</useSystemClassLoader>
|
||||
|
||||
@@ -28,6 +28,7 @@ import static org.springframework.data.redis.connection.RedisGeoCommands.GeoRadi
|
||||
import static org.springframework.data.redis.connection.RedisGeoCommands.GeoSearchStoreCommandArgs.*;
|
||||
import static org.springframework.data.redis.core.ScanOptions.*;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
@@ -35,6 +36,7 @@ import java.util.*;
|
||||
import java.util.concurrent.BlockingDeque;
|
||||
import java.util.concurrent.LinkedBlockingDeque;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import org.assertj.core.data.Offset;
|
||||
import org.junit.AssumptionViolatedException;
|
||||
@@ -2661,10 +2663,11 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-417
|
||||
@DisabledOnOs(value = MAC, architectures = "aarch64")
|
||||
public void scanShouldReadEntireValueRangeWhenIdividualScanIterationsReturnEmptyCollection() {
|
||||
public void scanShouldReadEntireValueRangeWhenIndividualScanIterationsReturnEmptyCollection() {
|
||||
|
||||
connection.execute("DEBUG", "POPULATE".getBytes(), "100".getBytes());
|
||||
byteConnection.openPipeline();
|
||||
IntStream.range(0, 100).forEach(it -> byteConnection.stringCommands().set("key:%s".formatted(it).getBytes(StandardCharsets.UTF_8), "data".getBytes(StandardCharsets.UTF_8)));
|
||||
byteConnection.closePipeline();
|
||||
|
||||
Cursor<byte[]> cursor = connection.scan(ScanOptions.scanOptions().match("key*9").count(10).build());
|
||||
|
||||
|
||||
@@ -149,8 +149,8 @@ abstract public class AbstractConnectionPipelineIntegrationTests extends Abstrac
|
||||
@Test // DATAREDIS-417
|
||||
@Disabled
|
||||
@Override
|
||||
public void scanShouldReadEntireValueRangeWhenIdividualScanIterationsReturnEmptyCollection() {
|
||||
super.scanShouldReadEntireValueRangeWhenIdividualScanIterationsReturnEmptyCollection();
|
||||
public void scanShouldReadEntireValueRangeWhenIndividualScanIterationsReturnEmptyCollection() {
|
||||
super.scanShouldReadEntireValueRangeWhenIndividualScanIterationsReturnEmptyCollection();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -144,8 +144,8 @@ abstract public class AbstractConnectionTransactionIntegrationTests extends Abst
|
||||
@Test // DATAREDIS-417
|
||||
@Disabled
|
||||
@Override
|
||||
public void scanShouldReadEntireValueRangeWhenIdividualScanIterationsReturnEmptyCollection() {
|
||||
super.scanShouldReadEntireValueRangeWhenIdividualScanIterationsReturnEmptyCollection();
|
||||
public void scanShouldReadEntireValueRangeWhenIndividualScanIterationsReturnEmptyCollection() {
|
||||
super.scanShouldReadEntireValueRangeWhenIndividualScanIterationsReturnEmptyCollection();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -195,7 +195,7 @@ class LettuceReactiveClusterServerCommandsIntegrationTests extends LettuceReacti
|
||||
|
||||
connection.serverCommands().getConfig(NODE1, "*").as(StepVerifier::create) //
|
||||
.consumeNextWith(properties -> {
|
||||
assertThat(properties).containsEntry("databases", "16");
|
||||
assertThat(properties).containsEntry("port", NODE1.getPort().toString());
|
||||
}) //
|
||||
.verifyComplete();
|
||||
}
|
||||
|
||||
@@ -201,8 +201,7 @@ public class LettuceReactiveServerCommandsIntegrationTests extends LettuceReacti
|
||||
|
||||
connection.serverCommands().getConfig("*").as(StepVerifier::create) //
|
||||
.consumeNextWith(properties -> {
|
||||
assertThat(properties).containsEntry("127.0.0.1:7379.databases", "16");
|
||||
|
||||
assertThat(properties).containsEntry("127.0.0.1:7379.port", "7379");
|
||||
}) //
|
||||
.verifyComplete();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user