From 8507dfda0412ccd82d2584cf219d0375e617513e Mon Sep 17 00:00:00 2001 From: Pavlo Strunkin Date: Mon, 2 Nov 2026 21:44:36 +0200 Subject: [PATCH 1/2] Run the examples against a VRT server in CI, like examples-js and examples-python The browser examples now run against a 6.0.0-rc1 server from .github/vrt/docker-compose.yml; Appium and the standalone folder client stay compile-only. Running them showed three breakages that compiling hid: - jdi-light-testng: Surefire 3.6 no longer reads TestNG suite XML, so the retry listener moves to a ServiceLoader file, and JDI Light 1.6 needs Java 21 (java.util.SequencedCollection). CI now uses Java 21, and the example no longer ignores test failures. - allure-junit5-gradle-kts asserted OK, which a new baseline never is; it now fails only on UNRESOLVED. Co-Authored-By: Claude Opus 5.5 --- .github/dependabot.yml | 9 ++++ .github/vrt/docker-compose.yml | 33 ++++++++++++++ .github/workflows/ci.yml | 43 +++++++++++++++++-- README.md | 2 +- .../examples/junit5/AllureImageDiffTest.java | 4 +- jdi-light-testng/pom.xml | 6 +-- .../services/org.testng.ITestNGListener | 1 + .../src/test/resources/general.xml | 13 ------ 8 files changed, 86 insertions(+), 25 deletions(-) create mode 100644 .github/vrt/docker-compose.yml create mode 100644 jdi-light-testng/src/test/resources/META-INF/services/org.testng.ITestNGListener delete mode 100644 jdi-light-testng/src/test/resources/general.xml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index eb6a038..4f5da55 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -49,6 +49,15 @@ updates: patterns: - "*" + - package-ecosystem: docker-compose + directory: "/.github/vrt" + schedule: + interval: weekly + groups: + docker: + patterns: + - "*" + - package-ecosystem: github-actions directory: "/" schedule: diff --git a/.github/vrt/docker-compose.yml b/.github/vrt/docker-compose.yml new file mode 100644 index 0000000..9399a96 --- /dev/null +++ b/.github/vrt/docker-compose.yml @@ -0,0 +1,33 @@ +services: + api: + image: visualregressiontracker/api:6.0.0-rc1 + environment: + DATABASE_URL: postgresql://vrt:vrt@postgres:5432/vrt + JWT_SECRET: ci + APP_FRONTEND_URL: http://localhost:8080 + BODY_PARSER_JSON_LIMIT: 5mb + ports: + - "4200:3000" + depends_on: + migration: + condition: service_completed_successfully + migration: + image: visualregressiontracker/migration:6.0.0-rc1 + environment: + DATABASE_URL: postgresql://vrt:vrt@postgres:5432/vrt + DEFAULT_USER_EMAIL: visual-regression-tracker@example.com + DEFAULT_USER_PASSWORD: "123456" + DEFAULT_USER_API_KEY: DEFAULTUSERAPIKEYTOBECHANGED + depends_on: + postgres: + condition: service_healthy + postgres: + image: postgres:17 + environment: + POSTGRES_USER: vrt + POSTGRES_PASSWORD: vrt + POSTGRES_DB: vrt + healthcheck: + test: ["CMD-SHELL", "pg_isready -d vrt -U vrt"] + interval: 2s + retries: 30 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 64b63b7..e5275d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,17 +19,25 @@ jobs: strategy: fail-fast: false matrix: - example: [appium-maven, jdi-light-testng, playwright, selenium-maven, standalone-from-folder-maven] + example: [jdi-light-testng, playwright, selenium-maven] + defaults: + run: + working-directory: ${{ matrix.example }} steps: - uses: actions/checkout@v7 + - name: Start Visual Regression Tracker + working-directory: .github/vrt + run: docker compose up -d --quiet-pull - uses: actions/setup-java@v6 with: distribution: temurin - java-version: 17 + java-version: 21 cache: maven cache-dependency-path: ${{ matrix.example }}/pom.xml - run: mvn -B test-compile - working-directory: ${{ matrix.example }} + - name: Wait for Visual Regression Tracker + run: timeout 180 bash -c 'until curl -s -o /dev/null http://localhost:4200; do sleep 2; done' + - run: mvn -B test gradle: name: ${{ matrix.example }} @@ -38,12 +46,39 @@ jobs: fail-fast: false matrix: example: [allure-junit5-gradle-kts, selenide-gradle] + defaults: + run: + working-directory: ${{ matrix.example }} steps: - uses: actions/checkout@v7 + - name: Start Visual Regression Tracker + working-directory: .github/vrt + run: docker compose up -d --quiet-pull - uses: actions/setup-java@v6 with: distribution: temurin - java-version: 17 + java-version: 21 - uses: gradle/actions/setup-gradle@v6 - run: ./gradlew testClasses + - name: Wait for Visual Regression Tracker + run: timeout 180 bash -c 'until curl -s -o /dev/null http://localhost:4200; do sleep 2; done' + - run: ./gradlew test + + # Appium needs an iOS simulator and the standalone client a folder of images, so CI only compiles them. + compile: + name: ${{ matrix.example }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + example: [appium-maven, standalone-from-folder-maven] + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-java@v6 + with: + distribution: temurin + java-version: 21 + cache: maven + cache-dependency-path: ${{ matrix.example }}/pom.xml + - run: mvn -B test-compile working-directory: ${{ matrix.example }} diff --git a/README.md b/README.md index d05edae..16a08cc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Visual Regression Tracker examples for Java -Each folder is a separate project on [sdk-java](https://github.com/Visual-Regression-Tracker/sdk-java) 5.5.0 from JitPack (Java 17): +Each folder is a separate project on [sdk-java](https://github.com/Visual-Regression-Tracker/sdk-java) 5.5.0 from JitPack (Java 17; JDI Light needs Java 21): - [Playwright + Maven + JUnit 4](playwright) - [Selenium 4 + Maven + JUnit 4](selenium-maven) diff --git a/allure-junit5-gradle-kts/src/test/java/io/qameta/allure/examples/junit5/AllureImageDiffTest.java b/allure-junit5-gradle-kts/src/test/java/io/qameta/allure/examples/junit5/AllureImageDiffTest.java index 4dfb1ce..bbee2a7 100644 --- a/allure-junit5-gradle-kts/src/test/java/io/qameta/allure/examples/junit5/AllureImageDiffTest.java +++ b/allure-junit5-gradle-kts/src/test/java/io/qameta/allure/examples/junit5/AllureImageDiffTest.java @@ -19,7 +19,7 @@ import java.io.InputStream; import java.net.URI; -import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; public class AllureImageDiffTest { @@ -72,6 +72,6 @@ public void imageDiffExample() throws IOException, InterruptedException { attachScreenshotToAllureReport(result.getImageUrl(), "actual"); attachScreenshotToAllureReport(result.getBaselineUrl(), "expected"); attachScreenshotToAllureReport(result.getDiffUrl(), "diff"); - assertEquals(TestRunStatus.OK, result.getTestRunResponse().getStatus()); + assertNotEquals(TestRunStatus.UNRESOLVED, result.getTestRunResponse().getStatus()); } } diff --git a/jdi-light-testng/pom.xml b/jdi-light-testng/pom.xml index 4b7427d..d1eeb1e 100644 --- a/jdi-light-testng/pom.xml +++ b/jdi-light-testng/pom.xml @@ -20,7 +20,7 @@ chrome UTF-8 - 17 + 21 1.9.26 https://jdi-testing.github.io/jdi-light/ 2.35.5 @@ -71,10 +71,6 @@ ${project.build.directory}/allure-results - - src/test/resources/general.xml - - true -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar" diff --git a/jdi-light-testng/src/test/resources/META-INF/services/org.testng.ITestNGListener b/jdi-light-testng/src/test/resources/META-INF/services/org.testng.ITestNGListener new file mode 100644 index 0000000..c9e8f5a --- /dev/null +++ b/jdi-light-testng/src/test/resources/META-INF/services/org.testng.ITestNGListener @@ -0,0 +1 @@ +org.mytests.tests.testng.RetryListenerClass diff --git a/jdi-light-testng/src/test/resources/general.xml b/jdi-light-testng/src/test/resources/general.xml deleted file mode 100644 index 101c623..0000000 --- a/jdi-light-testng/src/test/resources/general.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file From c1f34a8af166d89d5ffb10963c9be5e05020efe6 Mon Sep 17 00:00:00 2001 From: Pavlo Strunkin Date: Mon, 2 Nov 2026 21:46:24 +0200 Subject: [PATCH 2/2] Let the allure example fail its build, keep Java 17 outside JDI Light Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 10 ++++++---- allure-junit5-gradle-kts/build.gradle.kts | 1 - 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e5275d4..2f1f31f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: - uses: actions/setup-java@v6 with: distribution: temurin - java-version: 21 + java-version: ${{ matrix.example == 'jdi-light-testng' && 21 || 17 }} cache: maven cache-dependency-path: ${{ matrix.example }}/pom.xml - run: mvn -B test-compile @@ -57,7 +57,7 @@ jobs: - uses: actions/setup-java@v6 with: distribution: temurin - java-version: 21 + java-version: 17 - uses: gradle/actions/setup-gradle@v6 - run: ./gradlew testClasses - name: Wait for Visual Regression Tracker @@ -72,13 +72,15 @@ jobs: fail-fast: false matrix: example: [appium-maven, standalone-from-folder-maven] + defaults: + run: + working-directory: ${{ matrix.example }} steps: - uses: actions/checkout@v7 - uses: actions/setup-java@v6 with: distribution: temurin - java-version: 21 + java-version: 17 cache: maven cache-dependency-path: ${{ matrix.example }}/pom.xml - run: mvn -B test-compile - working-directory: ${{ matrix.example }} diff --git a/allure-junit5-gradle-kts/build.gradle.kts b/allure-junit5-gradle-kts/build.gradle.kts index 74fc513..bb27893 100644 --- a/allure-junit5-gradle-kts/build.gradle.kts +++ b/allure-junit5-gradle-kts/build.gradle.kts @@ -22,5 +22,4 @@ dependencies { tasks.test { useJUnitPlatform() - ignoreFailures = true }