Skip to content

Fix failing ModuleTest & test against 8.0-RC1-pre #4131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 7, 2025
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
11 changes: 8 additions & 3 deletions src/test/java/redis/clients/jedis/commands/jedis/ModuleTest.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package redis.clients.jedis.commands.jedis;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.hasProperty;
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import java.util.Collections;
import java.util.List;

import org.junit.Assume;
Expand Down Expand Up @@ -53,15 +57,16 @@ public void testModules() {

List<Module> modules = jedis.moduleList();

assertEquals("testmodule", modules.get(0).getName());
assertThat(modules, hasItem(hasProperty("name", equalTo("testmodule"))));

Object output = jedis.sendCommand(ModuleCommand.SIMPLE);
assertTrue((Long) output > 0);

} finally {

assertEquals("OK", jedis.moduleUnload("testmodule"));
assertEquals(Collections.emptyList(), jedis.moduleList());
List<Module> modules = jedis.moduleList();
assertThat(modules, not(hasItem(hasProperty("name", equalTo("testmodule")))));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,8 @@ public void dropIndex() throws Exception {
client.ftSearch(index, new Query("hello world"));
fail("Index should not exist.");
} catch (JedisDataException de) {
assertTrue(de.getMessage().contains("no such index"));
// error message updated to "No such index" with Redis 8.0.0
assertTrue(de.getMessage().toLowerCase().contains("no such index"));
}
assertEquals(100, client.dbSize());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,8 @@ public void dropIndex() {
client.ftSearch(index, "hello world");
fail("Index should not exist.");
} catch (JedisDataException de) {
assertTrue(de.getMessage().contains("no such index"));
// toLowerCase - Error message updated to "No such index" with Redis 8.0.0
assertTrue(de.getMessage().toLowerCase().contains("no such index"));
}
assertEquals(100, client.dbSize());
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/env/.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
REDIS_VERSION=8.0-M05-pre
REDIS_STACK_VERSION=8.0-M05-pre
REDIS_VERSION=8.0-RC1-pre
REDIS_STACK_VERSION=8.0-RC1-pre
CLIENT_LIBS_TEST_IMAGE=redislabs/client-libs-test
REDIS_ENV_CONF_DIR=./
REDIS_MODULES_DIR=/tmp
Expand Down
Loading