fix #215 by dropping JDK8 and updating drivers

Note: disabled HikariCP testing on MS SQL until I figure out non-SSL connections
This commit is contained in:
Sean Corfield 2022-08-30 23:06:17 -07:00
parent af57829fcb
commit d83ab07f9f
7 changed files with 32 additions and 25 deletions

View file

@ -54,7 +54,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
java: [ '8', '11', '17' ] java: [ '11', '17' ]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions/setup-java@v3 - uses: actions/setup-java@v3

View file

@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
java: [ '8', '11', '16', '17', '18' ] java: [ '11', '16', '17', '18' ]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions/setup-java@v3 - uses: actions/setup-java@v3

View file

@ -5,6 +5,7 @@ Only accretive/fixative changes will be made from now on.
* 1.2.next in progress * 1.2.next in progress
* Address [#218](https://github.com/seancorfield/next-jdbc/issues/218) by moving `:extend-via-metadata true` after the protocols' docstrings. * Address [#218](https://github.com/seancorfield/next-jdbc/issues/218) by moving `:extend-via-metadata true` after the protocols' docstrings.
* Document `:useBulkCopyForBatchInsert` for Microsoft SQL Server via PR [#216](https://github.com/seancorfield/next-jdbc/issues/216) -- [danskarda](https://github.com/danskarda). * Document `:useBulkCopyForBatchInsert` for Microsoft SQL Server via PR [#216](https://github.com/seancorfield/next-jdbc/issues/216) -- [danskarda](https://github.com/danskarda).
* Address [#215](https://github.com/seancorfield/next-jdbc/issues/215) by dropping official support for JDK 8 and updating various JDBC drivers in the testing matrix.
* Address [#214](https://github.com/seancorfield/next-jdbc/issues/214) by updating test/CI versions. * Address [#214](https://github.com/seancorfield/next-jdbc/issues/214) by updating test/CI versions.
* Address [#212](https://github.com/seancorfield/next-jdbc/issues/212) by documenting the problem with SQLite's JDBC driver. * Address [#212](https://github.com/seancorfield/next-jdbc/issues/212) by documenting the problem with SQLite's JDBC driver.
* Fix [#211](https://github.com/seancorfield/next-jdbc/issues/211) by auto-creating `clojure_test` DB in MySQL if needed; also streamline the CI processes. * Fix [#211](https://github.com/seancorfield/next-jdbc/issues/211) by auto-creating `clojure_test` DB in MySQL if needed; also streamline the CI processes.

View file

@ -21,29 +21,23 @@
io.github.cognitect-labs/test-runner io.github.cognitect-labs/test-runner
{:git/tag "v0.5.1" :git/sha "dfb30dd"} {:git/tag "v0.5.1" :git/sha "dfb30dd"}
;; connection pooling ;; connection pooling
;; 5.0.0 is not compatible with JDK 8: com.zaxxer/HikariCP {:mvn/version "5.0.1"}
com.zaxxer/HikariCP {:mvn/version "3.4.2"}
com.mchange/c3p0 {:mvn/version "0.9.5.5"} com.mchange/c3p0 {:mvn/version "0.9.5.5"}
;; JDBC drivers ;; JDBC drivers
;; compatible with JDK8+: org.apache.derby/derby {:mvn/version "10.16.1.1"}
org.apache.derby/derby {:mvn/version "10.14.2.0"} org.apache.derby/derbyshared {:mvn/version "10.16.1.1"}
;; compatible only with JDK9+: org.hsqldb/hsqldb {:mvn/version "2.7.0"}
;; org.apache.derby/derby {:mvn/version "10.15.2.0"} com.h2database/h2 {:mvn/version "2.1.214"}
;; org.apache.derby/derbyshared {:mvn/version "10.15.2.0"}
;; 2.6.1 is not compatible with JDK 8:
org.hsqldb/hsqldb {:mvn/version "2.5.0"}
com.h2database/h2 {:mvn/version "1.4.200"}
net.sourceforge.jtds/jtds {:mvn/version "1.3.1"} net.sourceforge.jtds/jtds {:mvn/version "1.3.1"}
org.mariadb.jdbc/mariadb-java-client {:mvn/version "2.7.4"} org.mariadb.jdbc/mariadb-java-client {:mvn/version "3.0.7"}
mysql/mysql-connector-java {:mvn/version "8.0.30"} mysql/mysql-connector-java {:mvn/version "8.0.30"}
org.postgresql/postgresql {:mvn/version "42.4.1"} org.postgresql/postgresql {:mvn/version "42.5.0"}
io.zonky.test/embedded-postgres {:mvn/version "2.0.0"} io.zonky.test/embedded-postgres {:mvn/version "2.0.1"}
;; 14.1.0 doesn't spin up fast enough: tests timeout at startup after 10s io.zonky.test.postgres/embedded-postgres-binaries-darwin-amd64 {:mvn/version "14.5.0"}
io.zonky.test.postgres/embedded-postgres-binaries-darwin-amd64 {:mvn/version "14.4.0"} io.zonky.test.postgres/embedded-postgres-binaries-linux-amd64 {:mvn/version "14.5.0"}
io.zonky.test.postgres/embedded-postgres-binaries-linux-amd64 {:mvn/version "14.4.0"} io.zonky.test.postgres/embedded-postgres-binaries-windows-amd64 {:mvn/version "14.5.0"}
io.zonky.test.postgres/embedded-postgres-binaries-windows-amd64 {:mvn/version "14.4.0"} org.xerial/sqlite-jdbc {:mvn/version "3.39.2.1"}
org.xerial/sqlite-jdbc {:mvn/version "3.39.2.0"} com.microsoft.sqlserver/mssql-jdbc {:mvn/version "11.2.0.jre11"}
com.microsoft.sqlserver/mssql-jdbc {:mvn/version "9.4.1.jre8"}
;; supplementary test stuff ;; supplementary test stuff
;; use log4j 2.x: ;; use log4j 2.x:
org.apache.logging.log4j/log4j-api {:mvn/version "2.18.0"} org.apache.logging.log4j/log4j-api {:mvn/version "2.18.0"}

View file

@ -8,7 +8,7 @@
[next.jdbc.sql :as sql] [next.jdbc.sql :as sql]
[next.jdbc.test-fixtures [next.jdbc.test-fixtures
:refer [with-test-db ds column default-options :refer [with-test-db ds column default-options
derby? jtds? maria? mssql? mysql? postgres? sqlite?]] derby? jtds? maria? mssql? mysql? postgres? sqlite?]]
[next.jdbc.types :refer [as-other as-real as-varchar]])) [next.jdbc.types :refer [as-other as-real as-varchar]]))
(set! *warn-on-reflection* true) (set! *warn-on-reflection* true)
@ -115,6 +115,8 @@
[8M] [8M]
(sqlite?) (sqlite?)
[8] [8]
(maria?)
[6]
:else :else
[6 7 8]) [6 7 8])
(mapv new-key (mapv new-key
@ -137,6 +139,8 @@
[11M] [11M]
(sqlite?) (sqlite?)
[11] [11]
(maria?)
[9]
:else :else
[9 10 11]) [9 10 11])
(mapv new-key (mapv new-key
@ -159,6 +163,8 @@
[14M] [14M]
(sqlite?) (sqlite?)
[14] [14]
(maria?)
[12]
:else :else
[12 13 14]) [12 13 14])
(mapv new-key (mapv new-key

View file

@ -53,7 +53,7 @@
(println "...done!")))) (println "...done!"))))
(def ^:private test-mssql-map (def ^:private test-mssql-map
{:dbtype "mssql" :dbname "model" {:dbtype "mssql" :dbname "model" :encrypt false :trustServerCertificate true
:user "sa" :password (System/getenv "MSSQL_SA_PASSWORD")}) :user "sa" :password (System/getenv "MSSQL_SA_PASSWORD")})
(def ^:private test-mssql (def ^:private test-mssql
(when (System/getenv "NEXT_JDBC_TEST_MSSQL") test-mssql-map)) (when (System/getenv "NEXT_JDBC_TEST_MSSQL") test-mssql-map))

View file

@ -327,7 +327,10 @@ VALUES ('Pear', 'green', 49, 47)
(deftest issue-146 (deftest issue-146
;; since we use an embedded PostgreSQL data source, we skip this: ;; since we use an embedded PostgreSQL data source, we skip this:
(when-not (postgres?) (when-not (or (postgres?)
;; and now we skip MS SQL because we can't use the db-spec
;; we'd need to build the jdbcUrl with encryption turned off:
(and (mssql?) (not (jtds?))))
(testing "Hikari and SavePoints" (testing "Hikari and SavePoints"
(with-open [^HikariDataSource ds (c/->pool HikariDataSource (with-open [^HikariDataSource ds (c/->pool HikariDataSource
(let [db (db)] (let [db (db)]
@ -798,7 +801,10 @@ INSERT INTO fruit (name, appearance) VALUES (?,?)
(let [[url etc] (#'c/spec->url+etc (db)) (let [[url etc] (#'c/spec->url+etc (db))
ds (jdbc/get-datasource (assoc etc :jdbcUrl url))] ds (jdbc/get-datasource (assoc etc :jdbcUrl url))]
(cond (derby?) (is (= {:create true} etc)) (cond (derby?) (is (= {:create true} etc))
(mssql?) (is (= #{:user :password} (set (keys etc)))) (mssql?) (is (= (cond-> #{:user :password}
(not (jtds?))
(conj :encrypt :trustServerCertificate))
(set (keys etc))))
(mysql?) (is (= #{:user :password :useSSL :allowMultiQueries} (mysql?) (is (= #{:user :password :useSSL :allowMultiQueries}
(disj (set (keys etc)) :disableMariaDbDriver))) (disj (set (keys etc)) :disableMariaDbDriver)))
:else (is (= {} etc))) :else (is (= {} etc)))