From c2328fa0a5284e9bc0d2286ee1aace2f59930085 Mon Sep 17 00:00:00 2001 From: Yury-Fridlyand Date: Wed, 17 Jan 2024 10:41:20 -0800 Subject: [PATCH] Update CI Signed-off-by: Yury-Fridlyand --- .github/workflows/java.yml | 33 ++++++++++++++++++++++++++++++++- java/integTest/build.gradle | 29 +++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/.github/workflows/java.yml b/.github/workflows/java.yml index a4cf018e7a..98ae32f467 100644 --- a/.github/workflows/java.yml +++ b/.github/workflows/java.yml @@ -64,6 +64,32 @@ jobs: with: redis-version: ${{ matrix.redis }} + - name: Start redis + run: | + redis-server --daemonize yes + mkdir cluster-test + cd cluster-test + mkdir 7000 7001 7002 7003 7004 7005 + for port in {7000..7005}; do + pushd $port + cat << EOF > redis.conf + port $port + cluster-enabled yes + daemonize yes + cluster-config-file nodes.conf + cluster-node-timeout 5000 + appendonly yes + dir $PWD + pidfile $PWD/redis.pid + logfile $PWD/redis.log + EOF + redis-server redis.conf & + popd + done + ps axwwu | grep [r]edis + redis-cli --cluster create 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005 --cluster-replicas 1 --cluster-yes + redis-cli -c -p 7000 cluster slots + - name: Build rust part working-directory: java run: cargo build --release @@ -72,15 +98,20 @@ jobs: working-directory: java run: ./gradlew --continue build + - name: Stop redis + if: always() + run: sudo killall -9 redis-server + - name: Upload test reports if: always() continue-on-error: true uses: actions/upload-artifact@v4 with: - name: test-reports-${{ matrix.java }} + name: test-reports-java-${{ matrix.java }}-redis-${{ matrix.redis }}-${{ matrix.os }} path: | java/client/build/reports/** java/integTest/build/reports/** + cluster-test/** build-amazonlinux-latest: if: github.repository_owner == 'aws' diff --git a/java/integTest/build.gradle b/java/integTest/build.gradle index e69de29bb2..840b9047bb 100644 --- a/java/integTest/build.gradle +++ b/java/integTest/build.gradle @@ -0,0 +1,29 @@ +plugins { + id 'java-library' +} + +repositories { + mavenCentral() +} + +dependencies { + // client + implementation project(':client') + + // lombok + testCompileOnly 'org.projectlombok:lombok:1.18.30' + testAnnotationProcessor 'org.projectlombok:lombok:1.18.30' + + // junit + testImplementation 'org.junit.jupiter:junit-jupiter:5.6.2' + testImplementation 'org.mockito:mockito-junit-jupiter:3.12.4' +} + +tasks.withType(Test) { + testLogging { + exceptionFormat "full" + events "started", "skipped", "passed", "failed" + showStandardStreams true + } + jvmArgs "-Djava.library.path=${projectDir}/../target/release:${projectDir}/../target/debug" +}