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 9f2a25c commit 2d1ecc7
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 4 deletions.
46 changes: 42 additions & 4 deletions .github/workflows/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ jobs:
engine: ${{ fromJson(needs.load-engine-matrix.outputs.matrix) }}
host:
- {
OS: ubuntu,
RUNNER: ubuntu-latest,
TARGET: x86_64-unknown-linux-gnu
}
OS: ubuntu,
RUNNER: ubuntu-latest,
TARGET: x86_64-unknown-linux-gnu,
}
# - {
# OS: macos,
# RUNNER: macos-latest,
Expand Down Expand Up @@ -195,3 +195,41 @@ jobs:
with:
cargo-toml-folder: ./java
name: lint java rust

test-modules:
if: github.repository_owner == 'valkey-io'
name: Running Module Tests
runs-on: [self-hosted, linux, ARM64]
timeout-minutes: 15
steps:
- name: Setup self-hosted runner access
run: sudo chown -R $USER:$USER /home/ubuntu/actions-runner/_work/valkey-glide

- uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 17

- name: Install protoc (protobuf)
uses: arduino/setup-protoc@v3
with:
version: "26.1"
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Test java wrapper
working-directory: java
run: ./gradlew :integTest:modulesTest -Dcluster-endpoints=${{ secrets.MEMDB_MODULES_ENDPOINT }} -Dtls=true

- name: Upload test reports
if: always()
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: test-reports-modules
path: |
java/integTest/build/reports/**
16 changes: 16 additions & 0 deletions java/integTest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,19 @@ tasks.withType(Test) {
logger.quiet "${desc.className}.${desc.name}: ${result.resultType} ${(result.getEndTime() - result.getStartTime())/1000}s"
}
}

test {
filter {
excludeTestsMatching 'glide.modules.*'
}
}

tasks.register('modulesTest', Test) {
doFirst {
clusterHosts = System.getProperty("cluster-endpoints")
}

filter {
includeTestsMatching 'glide.modules.*'
}
}
22 changes: 22 additions & 0 deletions java/integTest/src/test/java/glide/modules/BasicTests.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/** 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 glide.api.GlideClusterClient;
import glide.api.models.commands.InfoOptions.Section;
import lombok.SneakyThrows;
import org.junit.jupiter.api.Test;

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

0 comments on commit 2d1ecc7

Please sign in to comment.