diff --git a/.github/workflows/test-and-release.yml b/.github/workflows/test-and-release.yml index 891eb89..583d7ee 100644 --- a/.github/workflows/test-and-release.yml +++ b/.github/workflows/test-and-release.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '11' + java-version: '21' - name: Setup Clojure uses: DeLaGuardo/setup-clojure@master with: diff --git a/.github/workflows/test-and-snapshot.yml b/.github/workflows/test-and-snapshot.yml index 3d9eb91..11606c8 100644 --- a/.github/workflows/test-and-snapshot.yml +++ b/.github/workflows/test-and-snapshot.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '11' + java-version: '21' - name: Setup Clojure uses: DeLaGuardo/setup-clojure@master with: @@ -75,4 +75,4 @@ jobs: ~/.cpcache key: ${{ runner.os }}-${{ hashFiles('**/deps.edn') }} - name: Run Tests - run: clojure -T:build test + run: clojure -T:build:jdk${{ matrix.java }} test diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cd9b86f..9a664d8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: NEXT_JDBC_TEST_MYSQL: yes NEXT_JDBC_TEST_MARIADB: yes - name: Run All Tests - run: clojure -M:test:runner + run: clojure -M:test:runner:jdk${{ matrix.java }} env: MYSQL_ROOT_PASSWORD: testing NEXT_JDBC_TEST_MYSQL: yes diff --git a/deps.edn b/deps.edn index 30ccdb4..c71aaae 100644 --- a/deps.edn +++ b/deps.edn @@ -40,8 +40,6 @@ io.zonky.test.postgres/embedded-postgres-binaries-windows-amd64 {:mvn/version "17.4.0"} org.xerial/sqlite-jdbc {:mvn/version "3.49.1.0"} com.microsoft.sqlserver/mssql-jdbc {:mvn/version "12.10.0.jre11"} - ;; only need the XTDB JDBC module: - com.xtdb/xtdb-jdbc {:mvn/version "2.0.0-beta7"} ;; use log4j2 to reduce log noise during testing: org.apache.logging.log4j/log4j-api {:mvn/version "2.24.3"} ;; bridge everything into log4j: @@ -52,5 +50,9 @@ org.apache.logging.log4j/log4j-slf4j2-impl {:mvn/version "2.24.3"}} :jvm-opts ["-Dlog4j2.configurationFile=log4j2-info.properties"]} :runner {:main-opts ["-m" "lazytest.main"]} + :jdk11 {} + :jdk17 {} + :jdk21 {:extra-deps {;; only need the XTDB JDBC module: + com.xtdb/xtdb-jdbc {:mvn/version "2.0.0-beta7"}}} :jdk24 {:jvm-opts [;; for SQLite on JDK 24 locally "--enable-native-access=ALL-UNNAMED"]}}} diff --git a/run-tests.clj b/run-tests.clj index f86bd9f..60eb926 100755 --- a/run-tests.clj +++ b/run-tests.clj @@ -10,6 +10,9 @@ (str "-M" (when v (str ":" v)) ":test:runner" + ;; jdk21+ adds xtdb: + (when (System/getenv "NEXT_JDBC_TEST_XTDB") + ":jdk21") ;; to suppress native access warnings on JDK24: ":jdk24") "--output" "dots")] diff --git a/test/next/jdbc/test_fixtures.clj b/test/next/jdbc/test_fixtures.clj index 0cab24a..65aa5da 100644 --- a/test/next/jdbc/test_fixtures.clj +++ b/test/next/jdbc/test_fixtures.clj @@ -67,7 +67,10 @@ (def ^:private test-xtdb-map {:dbtype "xtdb" :dbname "xtdb"}) (def ^:private test-xtdb - (when (System/getenv "NEXT_JDBC_TEST_XTDB") test-xtdb-map)) + (when (and (System/getenv "NEXT_JDBC_TEST_XTDB") + ;; only if we're on jdk21+ + (str/starts-with? (System/getProperty "java.version") "2")) + test-xtdb-map)) (def ^:private test-db-specs (cond-> [test-derby test-h2-mem test-h2 test-hsql test-sqlite]