diff --git a/.github/workflows/java.yml b/.github/workflows/java.yml index 5106aec4ce..6744a4b54b 100644 --- a/.github/workflows/java.yml +++ b/.github/workflows/java.yml @@ -121,6 +121,64 @@ jobs: benchmarks/results/** java/client/build/reports/spotbugs/** + test-pubsub: + needs: load-engine-matrix + timeout-minutes: 35 + strategy: + # Run all jobs + fail-fast: false + matrix: + java: + - 17 + engine: ${{ fromJson(needs.load-engine-matrix.outputs.matrix) }} + host: + - { + OS: ubuntu, + RUNNER: ubuntu-latest, + TARGET: x86_64-unknown-linux-gnu + } + + runs-on: ${{ matrix.host.RUNNER }} + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Set up JDK ${{ matrix.java }} + uses: actions/setup-java@v4 + with: + distribution: "temurin" + java-version: ${{ matrix.java }} + + - name: Install shared software dependencies + uses: ./.github/workflows/install-shared-dependencies + with: + os: ${{ matrix.host.OS }} + target: ${{ matrix.host.TARGET }} + github-token: ${{ secrets.GITHUB_TOKEN }} + engine-version: ${{ matrix.engine.version }} + + - name: Install protoc (protobuf) + uses: arduino/setup-protoc@v3 + with: + version: "26.1" + repo-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Test pubsub + working-directory: java + run: ./gradlew :integTest:pubsubTest + + - name: Upload test & spotbugs reports + if: always() + continue-on-error: true + uses: actions/upload-artifact@v4 + with: + name: test-reports-pubsub-java-${{ matrix.java }}-${{ matrix.engine.type }}-${{ matrix.engine.version }}-${{ matrix.host.RUNNER }} + path: | + java/integTest/build/reports/** + utils/clusters/** + build-amazonlinux-latest: if: github.repository_owner == 'valkey-io' strategy: diff --git a/java/DEVELOPER.md b/java/DEVELOPER.md index bd04f278af..fffe3658b4 100644 --- a/java/DEVELOPER.md +++ b/java/DEVELOPER.md @@ -232,6 +232,12 @@ To run end-to-end tests, use the following command: ./gradlew :integTest:test ``` +To run integration tests for pubsub feature: + +```bash +./gradlew :integTest:pubsubTest +``` + To run a single test, use the following command: ```bash ./gradlew :integTest:test --tests '*.functionLoad_and_functionList' --rerun diff --git a/java/integTest/build.gradle b/java/integTest/build.gradle index 2b56978a08..5997ea5f06 100644 --- a/java/integTest/build.gradle +++ b/java/integTest/build.gradle @@ -93,15 +93,21 @@ tasks.register('startStandalone') { } } +tasks.register('beforeTests') {} +tasks.register('afterTests') {} -test.dependsOn 'stopAllBeforeTests' +beforeTests.dependsOn 'stopAllBeforeTests' stopAllBeforeTests.finalizedBy 'clearDirs' clearDirs.finalizedBy 'startStandalone' clearDirs.finalizedBy 'startCluster' -test.finalizedBy 'stopAllAfterTests' -test.dependsOn ':client:buildRustRelease' +afterTests.finalizedBy 'stopAllAfterTests' +beforeTests.dependsOn ':client:buildRustRelease' tasks.withType(Test) { + useJUnitPlatform() + dependsOn 'beforeTests' + finalizedBy 'afterTests' + doFirst { println "Cluster ports = ${clusterPorts}" println "Standalone ports = ${standalonePorts}" @@ -122,3 +128,15 @@ tasks.withType(Test) { logger.quiet "${desc.className}.${desc.name}: ${result.resultType} ${(result.getEndTime() - result.getStartTime())/1000}s" } } + +test { + filter { + excludeTestsMatching 'glide.PubSubTests' + } +} + +tasks.register('pubsubTest', Test) { + filter { + includeTestsMatching 'glide.PubSubTests' + } +}