Skip to content

Commit

Permalink
Do not run the db tests in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
egli committed Nov 4, 2022
1 parent 615231f commit 6b5be80
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/clojure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
- name: Install dependencies
run: lein deps
- name: Run tests
run: lein test
run: lein test :non-database
2 changes: 1 addition & 1 deletion env/test/resources/config.edn
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{:prod false}
{}
2 changes: 2 additions & 0 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@
["vcs" "commit"]
["vcs" "push"]]

:test-selectors {:non-database (complement :database)}

:profiles
{:uberjar {:omit-source true

Expand Down
9 changes: 6 additions & 3 deletions test/clj/mdr2/db/core_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,20 @@
(mount/start
#'mdr2.config/env
#'mdr2.db.core/*db*)
(migrations/migrate ["migrate"] (select-keys env [:database-url]))
#_(migrations/migrate ["migrate"] (select-keys env [:database-url]))
(f)))

(comment
(deftest test-production
(deftest ^:database test-production
(jdbc/with-transaction [t-conn *db* {:rollback-only true}]
(is (= 1 (db/insert-production
t-conn
{:title "The War of the Worlds"
:date 1898
:identifier "b0c3f96e-5c32-11ed-9b6a-0242ac120002"
:state "new"})))
(is (= {}
(is (= {:title "The War of the Worlds"
:date 1898
:identifier "b0c3f96e-5c32-11ed-9b6a-0242ac120002"
:state "new"}
(db/get-production t-conn {:id "1"}))))))

0 comments on commit 6b5be80

Please sign in to comment.