fix #211
This commit is contained in:
parent
00fb7437c0
commit
6ea7150326
6 changed files with 45 additions and 30 deletions
17
.github/workflows/test-and-release.yml
vendored
17
.github/workflows/test-and-release.yml
vendored
|
|
@ -33,16 +33,19 @@ jobs:
|
|||
run: docker-compose up -d
|
||||
env:
|
||||
MYSQL_ROOT_PASSWORD: testing
|
||||
- name: Create ClojureTest
|
||||
run: ./run-tests.sh create
|
||||
- name: Run MariaDB Tests
|
||||
run: clojure -X:test
|
||||
env:
|
||||
MYSQL_ROOT_PASSWORD: testing
|
||||
- name: Run All Tests
|
||||
run: ./run-tests.sh
|
||||
env:
|
||||
MYSQL_ROOT_PASSWORD: testing
|
||||
- name: Run Tests
|
||||
NEXT_JDBC_TEST_MYSQL: yes
|
||||
NEXT_JDBC_TEST_MARIADB: yes
|
||||
- name: Run All Tests and Release
|
||||
run: clojure -T:build ci :snapshot false
|
||||
env:
|
||||
MYSQL_ROOT_PASSWORD: testing
|
||||
NEXT_JDBC_TEST_MYSQL: yes
|
||||
NEXT_JDBC_TEST_MSSQL: yes
|
||||
MSSQL_SA_PASSWORD: Str0ngP4ssw0rd
|
||||
- name: Deploy Release
|
||||
run: clojure -T:build deploy :snapshot false
|
||||
env:
|
||||
|
|
|
|||
17
.github/workflows/test-and-snapshot.yml
vendored
17
.github/workflows/test-and-snapshot.yml
vendored
|
|
@ -31,16 +31,19 @@ jobs:
|
|||
run: docker-compose up -d
|
||||
env:
|
||||
MYSQL_ROOT_PASSWORD: testing
|
||||
- name: Create ClojureTest
|
||||
run: ./run-tests.sh create
|
||||
- name: Run MariaDB Tests
|
||||
run: clojure -X:test
|
||||
env:
|
||||
MYSQL_ROOT_PASSWORD: testing
|
||||
- name: Run All Tests
|
||||
run: ./run-tests.sh
|
||||
env:
|
||||
MYSQL_ROOT_PASSWORD: testing
|
||||
- name: Run Tests
|
||||
NEXT_JDBC_TEST_MYSQL: yes
|
||||
NEXT_JDBC_TEST_MARIADB: yes
|
||||
- name: Run All Tests and Snapshot
|
||||
run: clojure -T:build ci :snapshot true
|
||||
env:
|
||||
MYSQL_ROOT_PASSWORD: testing
|
||||
NEXT_JDBC_TEST_MYSQL: yes
|
||||
NEXT_JDBC_TEST_MSSQL: yes
|
||||
MSSQL_SA_PASSWORD: Str0ngP4ssw0rd
|
||||
- name: Deploy Snapshot
|
||||
run: clojure -T:build deploy :snapshot true
|
||||
env:
|
||||
|
|
|
|||
13
.github/workflows/test.yml
vendored
13
.github/workflows/test.yml
vendored
|
|
@ -31,14 +31,19 @@ jobs:
|
|||
run: docker-compose up -d
|
||||
env:
|
||||
MYSQL_ROOT_PASSWORD: testing
|
||||
- name: Create ClojureTest
|
||||
run: ./run-tests.sh create
|
||||
- name: Run MariaDB Tests
|
||||
run: clojure -X:test
|
||||
env:
|
||||
MYSQL_ROOT_PASSWORD: testing
|
||||
- name: Run Tests
|
||||
run: ./run-tests.sh
|
||||
NEXT_JDBC_TEST_MYSQL: yes
|
||||
NEXT_JDBC_TEST_MARIADB: yes
|
||||
- name: Run All Tests
|
||||
run: clojure -X:test
|
||||
env:
|
||||
MYSQL_ROOT_PASSWORD: testing
|
||||
NEXT_JDBC_TEST_MYSQL: yes
|
||||
NEXT_JDBC_TEST_MSSQL: yes
|
||||
MSSQL_SA_PASSWORD: Str0ngP4ssw0rd
|
||||
|
||||
build-graalvm-new:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ Only accretive/fixative changes will be made from now on.
|
|||
|
||||
* 1.2.next in progress
|
||||
* 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 [#210](https://github.com/seancorfield/next-jdbc/issues/210) by updating CI to test against MySQL and SQL Server.
|
||||
* Switch SQL Server testing setup to `docker-compose`.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
# start databases with: docker-compose up
|
||||
# then: ./run-tests.sh create
|
||||
# - creates a new database in MySQL for running tests
|
||||
# then:
|
||||
#
|
||||
# test against "all" databases with MySQL JDBC driver:
|
||||
# ./run-tests.sh
|
||||
|
|
@ -10,12 +9,6 @@
|
|||
# test against "all" databases with MariaDB JDBC driver:
|
||||
# ./run-tests.sh maria
|
||||
|
||||
if test "$1" = "create"
|
||||
then
|
||||
sleep 30
|
||||
# assumes you already have a MySQL instance running locally
|
||||
NEXT_JDBC_TEST_MYSQL=yes clojure -X:test next.jdbc.test-fixtures/create-clojure-test
|
||||
fi
|
||||
if test "$1" = "maria"
|
||||
then
|
||||
NEXT_JDBC_TEST_MSSQL=yes MSSQL_SA_PASSWORD=Str0ngP4ssw0rd \
|
||||
|
|
|
|||
|
|
@ -36,13 +36,21 @@
|
|||
(def ^:private test-mysql
|
||||
(when (System/getenv "NEXT_JDBC_TEST_MYSQL") test-mysql-map))
|
||||
|
||||
(defn create-clojure-test [_]
|
||||
(defn- create-clojure-test []
|
||||
(when test-mysql
|
||||
(let [mysql (assoc test-mysql :dbname "mysql")]
|
||||
(println "Creating clojure-test database in MySQL...")
|
||||
(jdbc/execute-one! mysql ["create database if not exists clojure_test"])
|
||||
(println "...done!")
|
||||
(shutdown-agents))))
|
||||
(loop [n 0]
|
||||
(when (try
|
||||
(jdbc/execute-one! mysql ["create database if not exists clojure_test"])
|
||||
false ; done
|
||||
(catch Throwable t
|
||||
(when (< 10 n) (throw t))
|
||||
(println "\t" (ex-message t) "(will retry)")
|
||||
(Thread/sleep 3000)
|
||||
true))
|
||||
(recur (inc n))))
|
||||
(println "...done!"))))
|
||||
|
||||
(def ^:private test-mssql-map
|
||||
{:dbtype "mssql" :dbname "model"
|
||||
|
|
@ -226,6 +234,8 @@ CREATE PROCEDURE FRUITP" (cond (hsqldb?) "() READS SQL DATA DYNAMIC RESULT SETS
|
|||
{:return-keys false})
|
||||
(t)))))
|
||||
|
||||
(create-clojure-test)
|
||||
|
||||
(comment
|
||||
;; this is a convenience to bring next.jdbc's test dependencies
|
||||
;; into any REPL that has the add-lib3 branch of tools.deps.alpha
|
||||
|
|
|
|||
Loading…
Reference in a new issue