Skip to content

Commit 0bcac5c

Browse files
ggivoa-TODO-rov
andauthored
Add Redis 8.4 to test matrix (#4337) (#4338)
* Add Redis 8.4 to test matrix (#4337) * fix AggregationTest totalResults (#4337) * Bump to RC1 v2 --------- Co-authored-by: aleksandar.todorov <[email protected]>
1 parent e7bf717 commit 0bcac5c

File tree

6 files changed

+21
-9
lines changed

6 files changed

+21
-9
lines changed

.github/workflows/test-on-docker.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
fail-fast: false
3939
matrix:
4040
redis_version:
41+
- "8.4"
4142
- "8.2"
4243
- "8.0"
4344
- "7.4"

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH := ./redis-git/src:${PATH}
22

33
# Supported test env versions
4-
SUPPORTED_TEST_ENV_VERSIONS := 8.2 8.0 7.4 7.2 6.2
4+
SUPPORTED_TEST_ENV_VERSIONS := 8.4 8.2 8.0 7.4 7.2 6.2
55
DEFAULT_TEST_ENV_VERSION := 8.2
66
REDIS_ENV_WORK_DIR := $(or ${REDIS_ENV_WORK_DIR},/tmp/redis-env-work)
77
CLIENT_LIBS_TEST_IMAGE := redislabs/client-libs-test:8.2.2

src/test/java/io/redis/test/utils/RedisVersion.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ public class RedisVersion implements Comparable<RedisVersion> {
77
public static final RedisVersion V7_4 = RedisVersion.of("7.4");
88
public static final RedisVersion V8_0_0_PRE = RedisVersion.of("7.9.0");
99
public static final RedisVersion V8_0_0 = RedisVersion.of("8.0.0");
10+
public static final RedisVersion V8_4_0 = RedisVersion.of("8.4.0");
1011

1112
private final int major;
1213
private final int minor;

src/test/java/redis/clients/jedis/modules/search/AggregationTest.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import static org.junit.jupiter.api.Assertions.assertNull;
77
import static org.junit.jupiter.api.Assertions.fail;
88
import static redis.clients.jedis.util.RedisConditions.ModuleVersion.SEARCH_MOD_VER_80M3;
9+
import static redis.clients.jedis.util.RedisConditions.ModuleVersion.SEARCH_MOD_VER_84RC1;
910

1011
import io.redis.test.annotations.SinceRedisVersion;
1112
import io.redis.test.utils.RedisVersion;
@@ -267,12 +268,7 @@ public void testApplyAndFilterAggregations() {
267268
sc.addSortableNumericField("subj1");
268269
sc.addSortableNumericField("subj2");
269270
client.ftCreate(index, IndexOptions.defaultOptions(), sc);
270-
// client.addDocument(new Document("data1").set("name", "abc").set("subj1", 20).set("subj2", 70));
271-
// client.addDocument(new Document("data2").set("name", "def").set("subj1", 60).set("subj2", 40));
272-
// client.addDocument(new Document("data3").set("name", "ghi").set("subj1", 50).set("subj2", 80));
273-
// client.addDocument(new Document("data4").set("name", "abc").set("subj1", 30).set("subj2", 20));
274-
// client.addDocument(new Document("data5").set("name", "def").set("subj1", 65).set("subj2", 45));
275-
// client.addDocument(new Document("data6").set("name", "ghi").set("subj1", 70).set("subj2", 70));
271+
276272
addDocument(new Document("data1").set("name", "abc").set("subj1", 20).set("subj2", 70));
277273
addDocument(new Document("data2").set("name", "def").set("subj1", 60).set("subj2", 40));
278274
addDocument(new Document("data3").set("name", "ghi").set("subj1", 50).set("subj2", 80));
@@ -287,7 +283,12 @@ public void testApplyAndFilterAggregations() {
287283

288284
// actual search
289285
AggregationResult res = client.ftAggregate(index, r);
290-
assertEquals(3, res.getTotalResults());
286+
287+
if (RedisConditions.of(client).moduleVersionIsGreaterThanOrEqual(SEARCH_MOD_VER_84RC1)) {
288+
//prior to 8.4rc1, the returned total result was reported as 3 (number of results before filter),
289+
// while 2 rows were actually returned
290+
assertEquals(2, res.getTotalResults());
291+
}
291292

292293
Row r1 = res.getRow(0);
293294
assertNotNull(r1);

src/test/java/redis/clients/jedis/util/RedisConditions.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ public class RedisConditions {
2020

2121
public enum ModuleVersion {
2222

23-
SEARCH_MOD_VER_80M3("SEARCH", 79903);
23+
SEARCH_MOD_VER_80M3("SEARCH", 79903),
24+
SEARCH_MOD_VER_84RC1("SEARCH", 80390);
2425

2526
private final String moduleName;
2627
private final int version;

src/test/resources/env/.env.v8.4

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
REDIS_VERSION=8.4-RC1-pre.2
2+
REDIS_STACK_VERSION=8.4-RC1-pre.2
3+
CLIENT_LIBS_TEST_IMAGE=redislabs/client-libs-test
4+
REDIS_ENV_CONF_DIR=./
5+
REDIS_MODULES_DIR=/tmp
6+
REDIS_ENV_WORK_DIR=/tmp/redis-env-work
7+
8+
ENABLE_MODULE_COMMAND_DIRECTIVE=--enable-module-command yes

0 commit comments

Comments
 (0)