diff --git a/.circleci/config.yml b/.circleci/config.yml index a76d26c..f6d4506 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,12 +4,12 @@ references: base_config: &base_config working_directory: ~/elo docker: - - image: circleci/clojure:lein-2.8.1 + - image: circleci/clojure:tools-deps-1.9.0.391 base_docker: &base_docker working_directory: ~/elo docker: - - image: circleci/clojure:lein-2.8.1 + - image: circleci/clojure:tools-deps-1.9.0.391 environment: DATABASE_URL: postgres://elo@localhost/elo_test @@ -25,10 +25,10 @@ jobs: - checkout - restore_cache: keys: - - clj-deps-{{ checksum "project.clj" }} + - clj-deps-{{ checksum "deps.edn" }} - - run: lein cljfmt check - - run: lein eastwood + - run: clojure -A:cljfmt + - run: clojure -A:eastwood test_clj: <<: *base_docker @@ -36,9 +36,9 @@ jobs: - checkout - restore_cache: keys: - - clj-deps-{{ checksum "project.clj" }} + - clj-deps-{{ checksum "deps.edn" }} - - run: lein migratus migrate + - run: bin/migrate - run: bin/kaocha --plugin kaocha.plugin/junit-xml --junit-xml-file test-results/kaocha/results.xml - store_test_results: path: test-results @@ -48,18 +48,7 @@ jobs: - ~/.m2/repository - ~/.lein - key: clj-deps-{{ checksum "project.clj" }} - - test_cljs: - <<: *base_docker - steps: - - checkout - - run: sudo apt install rhino - - restore_cache: - keys: - - clj-deps-{{ checksum "project.clj" }} - - - run: lein test-cljs || true + key: clj-deps-{{ checksum "deps.edn" }} coverage_clj: <<: *base_docker @@ -67,9 +56,9 @@ jobs: - checkout - restore_cache: keys: - - clj-deps-{{ checksum "project.clj" }} + - clj-deps-{{ checksum "deps.edn" }} - - run: lein migratus migrate + - run: bin/migrate - run: bin/kaocha --plugin cloverage --codecov - store_artifacts: @@ -83,7 +72,6 @@ workflows: version: 2 build: jobs: - - test_cljs - test_clj - coverage_clj - cljfmt diff --git a/bin/kaocha b/bin/kaocha index 3797a52..8f647cc 100755 --- a/bin/kaocha +++ b/bin/kaocha @@ -1,3 +1,3 @@ #!/usr/bin/env bash -lein kaocha "$@" +clojure -A:kaocha "$@" diff --git a/bin/migrate b/bin/migrate new file mode 100755 index 0000000..3338734 --- /dev/null +++ b/bin/migrate @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +clojure -m byf.migrate \ No newline at end of file diff --git a/deps.edn b/deps.edn new file mode 100644 index 0000000..f8053fb --- /dev/null +++ b/deps.edn @@ -0,0 +1,79 @@ +{:paths ["src/clj" "src/cljc"] + :aliases + {:eastwood {:extra-deps {jonase/eastwood {:mvn/version "RELEASE"}} + :main-opts ["-m" "eastwood.lint" "{:source-paths,[\"src\"],:test-paths,[\"test\"]}"]} + + :graph {:extra-deps {org.clojure/tools.deps.graph {:mvn/version "0.2.24"}} + :main-opts ["-m" "clojure.tools.deps.graph"]} + + :cljfmt {:extra-deps {cljfmt {:mvn/version "0.6.4"}} + :main-opts ["-m" "cljfmt.main" "check"]} + + :carve {:extra-deps {borkdude/carve {:git/url "https://github.com/borkdude/carve" + :sha "f9a4bc98d79ac61e9c52c99bdeadfaa67cf2e63f"}} + :main-opts ["-m" "carve.main"]} + + :kaocha {:extra-deps {lambdaisland/kaocha {:mvn/version "0.0-590"} + lambdaisland/kaocha-cloverage {:mvn/version "0.0-32"} + lambdaisland/kaocha-junit-xml {:mvn/version "0.0-70"}} + :extra-paths ["test/cljc" "test/clj"] + :main-opts ["-m" "kaocha.runner"]}} + + :deps {org.clojure/clojure {:mvn/version "1.10.1"}, + cljsjs/moment {:mvn/version "2.24.0-0"}, + metosin/ring-http-response {:mvn/version "0.9.1"}, + ns-tracker {:mvn/version "0.4.0"}, + day8.re-frame/tracing-stubs {:mvn/version "0.5.3"}, + org.clojure/spec.alpha {:mvn/version "0.2.176"}, + com.cemerick/url {:mvn/version "0.1.1"}, + org.clojure/tools.cli {:mvn/version "0.4.2"}, + com.bhauman/figwheel-main {:mvn/version "0.2.3"}, + day8.re-frame/http-fx {:mvn/version "0.1.6"}, + cljs-http {:mvn/version "0.1.46"}, + integrant/repl {:mvn/version "0.3.1"}, + bidi {:mvn/version "2.1.6"}, + prone {:mvn/version "2019-07-08"}, + cljsjs/react-dom {:mvn/version "16.9.0-0"}, + ring/ring-defaults {:mvn/version "0.3.2"}, + org.clojure/clojurescript {:mvn/version "1.10.520"}, + aero {:mvn/version "1.1.3"}, + ring/ring-json {:mvn/version "0.5.0"}, + medley {:mvn/version "1.2.0"}, + aysylu/loom {:mvn/version "1.0.2"}, + environ/environ.core {:mvn/version "0.3.1"}, + org.postgresql/postgresql {:mvn/version "42.2.8"}, + datascript {:mvn/version "0.18.5"}, + reagent-utils {:mvn/version "0.3.3"}, + http-kit {:mvn/version "2.3.0"}, + ring {:mvn/version "1.7.1"}, + buddy {:mvn/version "2.0.0"}, + cljsjs/react {:mvn/version "16.9.0-0"}, + nilenso/honeysql-postgres {:mvn/version "0.2.6"}, + cljs-ajax {:mvn/version "0.8.0"}, + cljsjs/vega {:mvn/version "5.4.0-0"}, + org.webjars/font-awesome {:mvn/version "5.10.1"}, + antizer {:mvn/version "0.3.1"}, + com.taoensso/sente {:mvn/version "1.14.0-RC2"}, + org.clojure/data.csv {:mvn/version "0.1.4"}, + com.taoensso/timbre {:mvn/version "4.10.0"}, + org.clojure/java.jdbc {:mvn/version "0.7.10"}, + hiccup {:mvn/version "1.0.5"}, + integrant {:mvn/version "0.7.0"}, + migratus {:mvn/version "1.0.9"}, + junit/junit {:mvn/version "4.12"}, + com.andrewmcveigh/cljs-time {:mvn/version "0.5.2"}, + venantius/accountant {:mvn/version "0.2.4"}, + org.clojure/tools.reader {:mvn/version "1.3.2"}, + clj-http {:mvn/version "3.10.0"}, + cljsjs/vega-lite {:mvn/version "3.4.0-0"}, + buddy/buddy-auth {:mvn/version "2.2.0"}, + reifyhealth/specmonstah {:mvn/version "2.0.0-alpha-1"}, + expound {:mvn/version "0.7.2"}, + org.clojure/test.check {:mvn/version "0.10.0"}, + ring-cljsjs {:mvn/version "0.2.0"}, + lambdaisland/uri {:mvn/version "1.2.1"}, + bk/ring-gzip {:mvn/version "0.3.0"}, + ring/ring-mock {:mvn/version "0.4.0"}, + honeysql {:mvn/version "0.9.8"}, + re-frame {:mvn/version "0.10.9"}, + ring-oauth2 {:mvn/version "0.1.4"}}} diff --git a/project.clj b/project.clj index 614cc48..1f625ec 100644 --- a/project.clj +++ b/project.clj @@ -101,7 +101,6 @@ :aliases {"fig" ["trampoline" "run" "-m" "figwheel.main"] "fig:build" ["trampoline" "run" "-m" "figwheel.main" "-b" "dev"] "cljs-prod" ["run" "-m" "figwheel.main" "--build-once" "prod"] - "test-cljs" ["doo" "rhino" "test" "once"] "kaocha" ["with-profile" "+kaocha" "run" "-m" "kaocha.runner"] "seed" ["run" "-m" "byf.seed"]} @@ -142,13 +141,7 @@ [ring/ring-mock "0.4.0"]]}} :cljsbuild {:builds - [{:id "test" - :source-paths ["src/cljs" "src/cljc" "test/cljs" "test/cljc"] - :compiler {:output-to "target/unit-test.js" - :main 'byf.runner - :optimizations :whitespace}} - - {:id "min" + [{:id "min" :source-paths ["src/cljs" "src/cljc"] :compiler {:main byf.core :output-to "resources/public/cljs-out/dev-main.js" diff --git a/setup_db.sh b/setup_db.sh index 89b0927..b0e3d28 100755 --- a/setup_db.sh +++ b/setup_db.sh @@ -9,7 +9,7 @@ dropdb --if-exists $DEV; createdb $DEV dropdb --if-exists $TEST; createdb $TEST -DATABASE_URL="postgres://byf@localhost:5445/byf" lein migratus migrate -DATABASE_URL="postgres://byf@localhost:5445/byf_test" lein migratus migrate +DATABASE_URL="postgres://byf@localhost:5445/byf" bin/migrate +DATABASE_URL="postgres://byf@localhost:5445/byf_test" bin/migrate DATABASE_URL="postgres://byf@localhost:5445/byf" lein run -m byf.seed diff --git a/src/clj/byf/migrate.clj b/src/clj/byf/migrate.clj new file mode 100644 index 0000000..331483f --- /dev/null +++ b/src/clj/byf/migrate.clj @@ -0,0 +1,14 @@ +(ns byf.migrate + (:gen-class) + (:require [migratus.core :as migratus] + [byf.config :refer [value]])) + +(defn config + [] + {:store :database + :migration-dir "resources/migrations" + :db (value :database-url)}) + +(defn -main + [& args] + (migratus/migrate (config))) diff --git a/test/cljs/byf/common/handlers_test.cljs b/test/cljs/byf/common/handlers_test.cljs deleted file mode 100644 index d20265b..0000000 --- a/test/cljs/byf/common/handlers_test.cljs +++ /dev/null @@ -1,15 +0,0 @@ -(ns byf.common.handlers-test - (:require [byf.common.handlers :as sut] - [cljs.test :as t :refer-macros [deftest testing is]])) - - -(deftest get-in-test - (testing "get in" - (is (= "value" - (sut/get-in* {::page {:key "value"}} - ::page - [:key]) - )))) - -(comment - (cljs.test/run-tests)) diff --git a/test/cljs/byf/runner.cljs b/test/cljs/byf/runner.cljs deleted file mode 100644 index 2feb024..0000000 --- a/test/cljs/byf/runner.cljs +++ /dev/null @@ -1,11 +0,0 @@ -(ns byf.runner - (:require [doo.runner :refer-macros [doo-tests]] - [byf.algorithms.elo-test] - [byf.rankings-test] - [byf.stats-test] - [byf.games-test])) - -(doo-tests 'byf.algorithms.elo-test - 'byf.rankings-test - 'byf.stats-test - 'byf.games-test)