only run xtdb tests on jdk21+

Signed-off-by: Sean Corfield <sean@corfield.org>
This commit is contained in:
Sean Corfield 2025-04-24 18:04:14 -04:00
parent 2a30c5cffd
commit 150a4aa605
No known key found for this signature in database
6 changed files with 15 additions and 7 deletions

View file

@ -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:

View file

@ -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

View file

@ -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

View file

@ -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"]}}}

View file

@ -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")]

View file

@ -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]