Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test-on-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
fail-fast: false
matrix:
redis_version:
- "8.4"
- "8.2"
- "8.0"
- "7.4"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH := ./redis-git/src:${PATH}

# Supported test env versions
SUPPORTED_TEST_ENV_VERSIONS := 8.2 8.0 7.4 7.2 6.2
SUPPORTED_TEST_ENV_VERSIONS := 8.4 8.2 8.0 7.4 7.2 6.2
DEFAULT_TEST_ENV_VERSION := 8.2
REDIS_ENV_WORK_DIR := $(or ${REDIS_ENV_WORK_DIR},/tmp/redis-env-work)
CLIENT_LIBS_TEST_IMAGE := redislabs/client-libs-test:8.2.2
Expand Down
1 change: 1 addition & 0 deletions src/test/java/io/redis/test/utils/RedisVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public class RedisVersion implements Comparable<RedisVersion> {
public static final RedisVersion V7_4 = RedisVersion.of("7.4");
public static final RedisVersion V8_0_0_PRE = RedisVersion.of("7.9.0");
public static final RedisVersion V8_0_0 = RedisVersion.of("8.0.0");
public static final RedisVersion V8_4_0 = RedisVersion.of("8.4.0");

private final int major;
private final int minor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.fail;
import static redis.clients.jedis.util.RedisConditions.ModuleVersion.SEARCH_MOD_VER_80M3;
import static redis.clients.jedis.util.RedisConditions.ModuleVersion.SEARCH_MOD_VER_84RC1;

import io.redis.test.annotations.SinceRedisVersion;
import io.redis.test.utils.RedisVersion;
Expand Down Expand Up @@ -267,12 +268,7 @@ public void testApplyAndFilterAggregations() {
sc.addSortableNumericField("subj1");
sc.addSortableNumericField("subj2");
client.ftCreate(index, IndexOptions.defaultOptions(), sc);
// client.addDocument(new Document("data1").set("name", "abc").set("subj1", 20).set("subj2", 70));
// client.addDocument(new Document("data2").set("name", "def").set("subj1", 60).set("subj2", 40));
// client.addDocument(new Document("data3").set("name", "ghi").set("subj1", 50).set("subj2", 80));
// client.addDocument(new Document("data4").set("name", "abc").set("subj1", 30).set("subj2", 20));
// client.addDocument(new Document("data5").set("name", "def").set("subj1", 65).set("subj2", 45));
// client.addDocument(new Document("data6").set("name", "ghi").set("subj1", 70).set("subj2", 70));

addDocument(new Document("data1").set("name", "abc").set("subj1", 20).set("subj2", 70));
addDocument(new Document("data2").set("name", "def").set("subj1", 60).set("subj2", 40));
addDocument(new Document("data3").set("name", "ghi").set("subj1", 50).set("subj2", 80));
Expand All @@ -287,7 +283,12 @@ public void testApplyAndFilterAggregations() {

// actual search
AggregationResult res = client.ftAggregate(index, r);
assertEquals(3, res.getTotalResults());

if (RedisConditions.of(client).moduleVersionIsGreaterThanOrEqual(SEARCH_MOD_VER_84RC1)) {
//prior to 8.4rc1, the returned total result was reported as 3 (number of results before filter),
// while 2 rows were actually returned
assertEquals(2, res.getTotalResults());
}

Row r1 = res.getRow(0);
assertNotNull(r1);
Expand Down
3 changes: 2 additions & 1 deletion src/test/java/redis/clients/jedis/util/RedisConditions.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ public class RedisConditions {

public enum ModuleVersion {

SEARCH_MOD_VER_80M3("SEARCH", 79903);
SEARCH_MOD_VER_80M3("SEARCH", 79903),
SEARCH_MOD_VER_84RC1("SEARCH", 80390);

private final String moduleName;
private final int version;
Expand Down
8 changes: 8 additions & 0 deletions src/test/resources/env/.env.v8.4
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
REDIS_VERSION=8.4-RC1-pre.2
REDIS_STACK_VERSION=8.4-RC1-pre.2
CLIENT_LIBS_TEST_IMAGE=redislabs/client-libs-test
REDIS_ENV_CONF_DIR=./
REDIS_MODULES_DIR=/tmp
REDIS_ENV_WORK_DIR=/tmp/redis-env-work

ENABLE_MODULE_COMMAND_DIRECTIVE=--enable-module-command yes
Loading