diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml
index fd651fa6a4..5b78b3124b 100644
--- a/.github/workflows/integration.yml
+++ b/.github/workflows/integration.yml
@@ -51,28 +51,10 @@ jobs:
mvn javadoc:jar
- name: Run tests
run: |
- TEST="" make test
+ make test
env:
JVM_OPTS: -Xmx3200m
TERM: dumb
- - name: sleep 10s
- run: sleep 10s
- - name: Make - start
- run: |
- make start
- sleep 2s
- - name: Docker - mod or stack
- run: docker run -p 52567:6379 -d redis/redis-stack-server:edge
- - name: Test commands - default protocol
- run: mvn -Dtest="redis.clients.jedis.commands.**" test
- - name: Test commands - RESP3 protocol
- run: mvn -DjedisProtocol=3 -Dtest="redis.clients.jedis.commands.**" test
- - name: Test module commands - default protocol
- run: mvn -DmodulesDocker="localhost:52567" -Dtest="redis.clients.jedis.modules.**" test
- - name: Test module commands - RESP3 protocol
- run: mvn -DjedisProtocol=3 -DmodulesDocker="localhost:52567" -Dtest="redis.clients.jedis.modules.**" test
- - name: Make - stop
- run: make stop
- name: Codecov
run: |
bash <(curl -s https://codecov.io/bash)
diff --git a/Makefile b/Makefile
index 96d106b000..1800f00d7e 100644
--- a/Makefile
+++ b/Makefile
@@ -413,7 +413,7 @@ ifndef STUNNEL_BIN
endif
export SKIP_SSL
-start: stunnel cleanup
+start: stunnel cleanup compile-module
echo "$$REDIS1_CONF" | redis-server -
echo "$$REDIS2_CONF" | redis-server -
echo "$$REDIS3_CONF" | redis-server -
@@ -446,6 +446,7 @@ start: stunnel cleanup
echo "$$REDIS_UDS" | redis-server -
echo "$$REDIS_UNAVAILABLE_CONF" | redis-server -
redis-cli -a cluster --cluster create 127.0.0.1:7479 127.0.0.1:7480 127.0.0.1:7481 --cluster-yes
+ docker run -p 6479:6379 --name jedis-stack -d redis/redis-stack-server:edge
cleanup:
- rm -vf /tmp/redis_cluster_node*.conf 2>/dev/null
@@ -455,6 +456,7 @@ stunnel:
@if [ -e "$$STUNNEL_BIN" ]; then\
echo "$$STUNNEL_CONF" | stunnel -fd 0;\
fi
+
stop:
kill `cat /tmp/redis1.pid`
kill `cat /tmp/redis2.pid`
@@ -496,29 +498,32 @@ stop:
rm -f /tmp/redis_stable_cluster_node1.conf
rm -f /tmp/redis_stable_cluster_node2.conf
rm -f /tmp/redis_stable_cluster_node3.conf
+ docker rm -f jedis-stack
+
+test: | start mvn-test stop
-test: compile-module start
- sleep 2
+mvn-test:
mvn -Dtest=${SKIP_SSL}${TEST} clean compile test
- make stop
-package: start
+package: | start mvn-package stop
+
+mvn-package:
mvn clean package
- make stop
-deploy: start
+deploy: | start mvn-deploy stop
+
+mvn-deploy:
mvn clean deploy
- make stop
format:
mvn java-formatter:format
-release:
- make start
+release: | start mvn-release stop
+
+mvn-release:
mvn release:clean
mvn release:prepare
mvn release:perform -DskipTests
- make stop
system-setup:
sudo apt install -y gcc g++
diff --git a/src/test/java/redis/clients/jedis/ACLJedisTest.java b/src/test/java/redis/clients/jedis/ACLJedisTest.java
index 81517b5556..a6a9deff77 100644
--- a/src/test/java/redis/clients/jedis/ACLJedisTest.java
+++ b/src/test/java/redis/clients/jedis/ACLJedisTest.java
@@ -6,6 +6,8 @@
import java.net.URISyntaxException;
import org.junit.BeforeClass;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
import redis.clients.jedis.commands.jedis.JedisCommandsTestBase;
import redis.clients.jedis.util.RedisVersionUtil;
@@ -15,6 +17,7 @@
*
* This test is only executed when the server/cluster is Redis 6. or more.
*/
+@RunWith(Parameterized.class)
public class ACLJedisTest extends JedisCommandsTestBase {
/**
@@ -27,6 +30,10 @@ public static void prepare() throws Exception {
RedisVersionUtil.checkRedisMajorVersionNumber(6));
}
+ public ACLJedisTest(RedisProtocol redisProtocol) {
+ super(redisProtocol);
+ }
+
@Test
public void useWithoutConnecting() {
try (Jedis j = new Jedis()) {
diff --git a/src/test/java/redis/clients/jedis/JedisShardedPubSubBaseTest.java b/src/test/java/redis/clients/jedis/JedisShardedPubSubBaseTest.java
index fb1ecdd87a..68d8455392 100644
--- a/src/test/java/redis/clients/jedis/JedisShardedPubSubBaseTest.java
+++ b/src/test/java/redis/clients/jedis/JedisShardedPubSubBaseTest.java
@@ -50,7 +50,7 @@ protected String encode(byte[] raw) {
});
thread.start();
- assertTrue(countDownLatch.await(10, TimeUnit.MILLISECONDS));
+ assertTrue(countDownLatch.await(20, TimeUnit.MILLISECONDS));
}
}
\ No newline at end of file
diff --git a/src/test/java/redis/clients/jedis/JedisTest.java b/src/test/java/redis/clients/jedis/JedisTest.java
index e9520ff394..52d8c80c02 100644
--- a/src/test/java/redis/clients/jedis/JedisTest.java
+++ b/src/test/java/redis/clients/jedis/JedisTest.java
@@ -17,6 +17,8 @@
import java.util.Map;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
import redis.clients.jedis.exceptions.InvalidURIException;
import redis.clients.jedis.exceptions.JedisConnectionException;
@@ -24,8 +26,13 @@
import redis.clients.jedis.commands.jedis.JedisCommandsTestBase;
import redis.clients.jedis.util.SafeEncoder;
+@RunWith(Parameterized.class)
public class JedisTest extends JedisCommandsTestBase {
+ public JedisTest(RedisProtocol protocol) {
+ super(protocol);
+ }
+
@Test
public void useWithoutConnecting() {
try (Jedis j = new Jedis()) {
diff --git a/src/test/java/redis/clients/jedis/MigratePipeliningTest.java b/src/test/java/redis/clients/jedis/MigratePipeliningTest.java
index ebd4b31eb9..f8e7d8278c 100644
--- a/src/test/java/redis/clients/jedis/MigratePipeliningTest.java
+++ b/src/test/java/redis/clients/jedis/MigratePipeliningTest.java
@@ -14,10 +14,14 @@
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
import redis.clients.jedis.commands.jedis.JedisCommandsTestBase;
import redis.clients.jedis.exceptions.JedisDataException;
import redis.clients.jedis.params.MigrateParams;
+@RunWith(Parameterized.class)
public class MigratePipeliningTest extends JedisCommandsTestBase {
private static final byte[] bfoo = { 0x01, 0x02, 0x03 };
@@ -39,6 +43,10 @@ public class MigratePipeliningTest extends JedisCommandsTestBase {
private Jedis dest;
private Jedis destAuth;
+ public MigratePipeliningTest(RedisProtocol protocol) {
+ super(protocol);
+ }
+
@Before
@Override
public void setUp() throws Exception {
diff --git a/src/test/java/redis/clients/jedis/PipeliningTest.java b/src/test/java/redis/clients/jedis/PipeliningTest.java
index 527b9dfc6d..fffaa06a89 100644
--- a/src/test/java/redis/clients/jedis/PipeliningTest.java
+++ b/src/test/java/redis/clients/jedis/PipeliningTest.java
@@ -24,6 +24,9 @@
import org.hamcrest.Matcher;
import org.hamcrest.Matchers;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
import redis.clients.jedis.commands.ProtocolCommand;
import redis.clients.jedis.commands.jedis.JedisCommandsTestBase;
import redis.clients.jedis.exceptions.JedisDataException;
@@ -31,6 +34,7 @@
import redis.clients.jedis.resps.Tuple;
import redis.clients.jedis.util.SafeEncoder;
+@RunWith(Parameterized.class)
public class PipeliningTest extends JedisCommandsTestBase {
private static final byte[] bfoo = { 0x01, 0x02, 0x03, 0x04 };
@@ -38,6 +42,10 @@ public class PipeliningTest extends JedisCommandsTestBase {
private static final byte[] bbar = { 0x05, 0x06, 0x07, 0x08 };
private static final byte[] bbaz = { 0x09, 0x0A, 0x0B, 0x0C };
+ public PipeliningTest(RedisProtocol protocol) {
+ super(protocol);
+ }
+
@Test
public void pipeline() {
Pipeline p = jedis.pipelined();
diff --git a/src/test/java/redis/clients/jedis/TupleSortedSetTest.java b/src/test/java/redis/clients/jedis/TupleSortedSetTest.java
index 676a19ffa5..59efcb3435 100644
--- a/src/test/java/redis/clients/jedis/TupleSortedSetTest.java
+++ b/src/test/java/redis/clients/jedis/TupleSortedSetTest.java
@@ -6,9 +6,13 @@
import java.util.Collections;
import java.util.List;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
import redis.clients.jedis.resps.Tuple;
import redis.clients.jedis.commands.jedis.JedisCommandsTestBase;
+@RunWith(Parameterized.class)
public class TupleSortedSetTest extends JedisCommandsTestBase {
final byte[] bfoo = { 0x01, 0x02, 0x03, 0x04 };
final byte[] ba = { 0x0A };
@@ -18,6 +22,10 @@ public class TupleSortedSetTest extends JedisCommandsTestBase {
final byte[] be = { 0x0E };
final byte[] bf = { 0x0F };
+ public TupleSortedSetTest(RedisProtocol protocol) {
+ super(protocol);
+ }
+
@Test
public void testBinary() {
List array = new ArrayList();
diff --git a/src/test/java/redis/clients/jedis/commands/CommandsTestsParameters.java b/src/test/java/redis/clients/jedis/commands/CommandsTestsParameters.java
new file mode 100644
index 0000000000..701ed06b08
--- /dev/null
+++ b/src/test/java/redis/clients/jedis/commands/CommandsTestsParameters.java
@@ -0,0 +1,22 @@
+package redis.clients.jedis.commands;
+
+import java.util.Arrays;
+import java.util.Collection;
+
+import redis.clients.jedis.RedisProtocol;
+
+public class CommandsTestsParameters {
+
+ /**
+ * RESP protocol versions we want our commands related tests to run against.
+ * {@code null} means to use the default protocol which is assumed to be RESP2.
+ */
+ public static Collection