Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
Yury-Fridlyand committed Oct 3, 2024
1 parent 367bec4 commit cce10e4
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
5 changes: 5 additions & 0 deletions java/DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,11 @@ You can combine this with test filter as well:
./gradlew :integTest:test -Dcluster-endpoints=localhost:7000 -Dstandalone-endpoints=localhost:6379 --tests 'TransactionTests' -Dtls=true
```
To run server modules test (it doesn't start servers):
```bash
./gradlew :integTest:modulesTest -Dcluster-endpoints=localhost:7000 -Dtls=true
```

### Generate files
To (re)generate protobuf code, use the following command:

Expand Down
23 changes: 23 additions & 0 deletions java/integTest/src/test/java/glide/modules/JsonTests.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/** Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0 */
package glide.modules;

import static glide.TestUtilities.commonClusterClientConfig;
import static glide.api.models.configuration.RequestRoutingConfiguration.SimpleSingleNodeRoute.RANDOM;
import static org.junit.jupiter.api.Assertions.assertTrue;

import glide.api.GlideClusterClient;
import glide.api.models.commands.InfoOptions.Section;
import lombok.SneakyThrows;
import org.junit.jupiter.api.Test;

public class JsonTests {
@Test
@SneakyThrows
public void check_module_loaded() {
var client =
GlideClusterClient.createClient(commonClusterClientConfig().requestTimeout(5000).build())
.get();
var info = client.info(new Section[] {Section.MODULES}, RANDOM).get().getSingleValue();
assertTrue(info.contains("# json_core_metrics"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import static glide.TestUtilities.commonClusterClientConfig;
import static glide.api.models.configuration.RequestRoutingConfiguration.SimpleSingleNodeRoute.RANDOM;
import static org.junit.jupiter.api.Assertions.assertTrue;

import glide.api.GlideClusterClient;
import glide.api.models.commands.InfoOptions.Section;
Expand All @@ -11,13 +12,13 @@

public class VectorSearchTests {

// TODO: remove when real tests added
@Test
@SneakyThrows
public void connection_check() {
public void check_module_loaded() {
var client =
GlideClusterClient.createClient(commonClusterClientConfig().requestTimeout(5000).build())
.get();
System.out.println(client.info(new Section[] {Section.MODULES}, RANDOM).get().getSingleValue());
var info = client.info(new Section[] {Section.MODULES}, RANDOM).get().getSingleValue();
assertTrue(info.contains("# search_index_stats"));
}
}

0 comments on commit cce10e4

Please sign in to comment.