Skip to content

Commit

Permalink
test: update tests accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
J0sueTM committed Jun 3, 2024
1 parent 5a905bc commit 2d1dc0b
Show file tree
Hide file tree
Showing 21 changed files with 33 additions and 26 deletions.
8 changes: 5 additions & 3 deletions deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,20 @@
lambdaisland/fetch {:mvn/version "1.1.60"}

;; back
com.moclojer/components {:mvn/version "0.0.2"}
com.moclojer/components {:git/url "https://github.com/moclojer/components.git"
:git/sha "ad3ba26b129b55d54f004e8b8d3a46f3594e4547"}
com.cognitect.aws/api {:mvn/version "0.8.561"}
com.cognitect.aws/endpoints {:mvn/version "1.1.12.230"}
com.cognitect.aws/s3 {:mvn/version "822.2.1145.0"}
org.clojure/core.async {:mvn/version "1.6.681"}
buddy/buddy-sign {:mvn/version "3.5.351"}
cheshire/cheshire {:mvn/version "5.11.0"}
clj-http/clj-http {:mvn/version "3.12.3"}
com.fzakaria/slf4j-timbre {:mvn/version "0.3.21"}
com.github.seancorfield/honeysql {:mvn/version "2.3.928"}
com.github.seancorfield/next.jdbc {:mvn/version "1.3.834"}
com.stuartsierra/component {:mvn/version "1.1.0"}
viesti/timbre-json-appender {:mvn/version "0.2.13"}
com.fzakaria/slf4j-timbre {:mvn/version "0.3.21"}
com.taoensso/timbre {:mvn/version "6.3.1"}
metosin/malli {:mvn/version "0.11.0"}
metosin/muuntaja {:mvn/version "0.6.8"}
Expand Down Expand Up @@ -55,7 +57,7 @@
:clojure-lsp {:replace-deps {com.github.clojure-lsp/clojure-lsp-standalone {:mvn/version "2022.09.01-15.27.31"}}
:main-opts ["-m" "clojure-lsp.main"]}
;; clj -M:migratus
:migratus {:main-opts ["-m" "components.migrations"]}
:migratus {:main-opts ["-m" "com.moclojer.components.migrations"]}
;; clj -X:run
:run {:main-opts ["-m" "back.api.server"]
:exec-fn back.api.server/-main}
Expand Down
6 changes: 3 additions & 3 deletions resources/back/config.edn
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
:proxy-pass #or [#env PROXY_PASS "foobar"]}
:max-verification-attempts 20
:verification-timeout-ms 3000}
:redis-worker {:uri #or [#env REDIS_URL "redis://localhost:6379"]}
:redis-publisher {:uri #or [#env REDIS_URL "redis://localhost:6379"]}
:mq {:uri #or [#env REDIS_URL "redis://localhost:6379"]}
:database {:dbtype "postgres"
:jdbc-url #or [#env DATABASE_URL "postgresql://localhost:5432/postgres?user=postgres&password=postgres"]}}
:jdbc-url #or [#env DATABASE_URL "postgresql://localhost:5432/postgres?user=postgres&password=postgres"]}
:migration-dir "back/migrations"}

6 changes: 6 additions & 0 deletions src/dev/api/dev.clj
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@
:workers (component/using (components/new-consumer p.workers/workers false)
[:config :database :publisher])))

(comment
(def c (component/start (components/new-config "back/config.edn")))
c
;;
)

(comment
;; init
(utils/start-system-dev! sys-atom (build-system-map))
Expand Down
2 changes: 1 addition & 1 deletion src/dev/utils.clj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
(components/setup-logger [["*" :info]] :auto :dev)
(when init-pg?
(pg-emb/init-pg)
(migrations/migrate (migrations/build-complete-db-config "back/config.edn"))
(migrations/migrate (migrations/build-complete-db-config "back/config.edn")))
(->> sys-map
component/start
(reset! sys-atom))))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
(defn- create-and-start-components []
(component/start-system
(component/system-map
:config (components/new-config "~/back/config.edn")
:config (components/new-config "back/config.edn")
:http (components/new-http-mock [])
:router (components/new-router routes/routes)
:database (component/using (components/new-database) [:config])
Expand Down
2 changes: 1 addition & 1 deletion test/back/back/integration/api/create_mock_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
(defn- create-and-start-components []
(component/start-system
(component/system-map
:config (components/new-config "~/back/config.edn")
:config (components/new-config "back/config.edn")
:http (components/new-http-mock [])
:router (components/new-router routes/routes)
:database (component/using (components/new-database)
Expand Down
2 changes: 1 addition & 1 deletion test/back/back/integration/api/customer_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
(defn- create-and-start-components []
(component/start-system
(component/system-map
:config (components/new-config "~/back/config.edn")
:config (components/new-config "back/config.edn")
:http (components/new-http-mock {})
:router (components/new-router routes/routes)
:database (component/using (components/new-database) [:config])
Expand Down
2 changes: 1 addition & 1 deletion test/back/back/integration/api/db/customers_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
(defn- create-and-start-components []
(component/start-system
(component/system-map
:config (components/new-config "~/back/config.edn")
:config (components/new-config "back/config.edn")
:database (component/using (components/new-database) [:config]))))

(defflow flow-db-insert-user-test
Expand Down
2 changes: 1 addition & 1 deletion test/back/back/integration/api/db/get_username_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
(defn- create-and-start-components []
(component/start-system
(component/system-map
:config (components/new-config "~/back/config.edn")
:config (components/new-config "back/config.edn")
:database (component/using (components/new-database) [:config]))))

(defflow flow-db-get-username
Expand Down
2 changes: 1 addition & 1 deletion test/back/back/integration/api/db/mocks_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
(defn- create-and-start-components []
(component/start-system
(component/system-map
:config (components/new-config "~/back/config.edn")
:config (components/new-config "back/config.edn")
:database (component/using (components/new-database) [:config]))))

(defflow flow-db-insert-mock-test
Expand Down
2 changes: 1 addition & 1 deletion test/back/back/integration/api/delete_mock_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
(defn- create-and-start-components []
(component/start-system
(component/system-map
:config (components/new-config "~/back/config.edn")
:config (components/new-config "back/config.edn")
:http (components/new-http-mock [])
:router (components/new-router routes/routes)
:storage (component/using (components/new-storage) [:config])
Expand Down
2 changes: 1 addition & 1 deletion test/back/back/integration/api/healthcheck_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
(defn- create-and-start-components []
(component/start-system
(component/system-map
:config (components/new-config "~/back/config.edn")
:config (components/new-config "back/config.edn")
:http (components/new-http-mock {})
:router (components/new-router routes/routes)
:database (component/using (components/new-database)
Expand Down
2 changes: 1 addition & 1 deletion test/back/back/integration/api/update_mock_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
(defn- create-and-start-components []
(component/start-system
(component/system-map
:config (components/new-config "~/back/config.edn")
:config (components/new-config "back/config.edn")
:http (components/new-http-mock {})
:router (components/new-router routes/routes)
:database (component/using (components/new-database)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
(defn- create-and-start-components []
(component/start-system
(component/system-map
:config (components/new-config "~/back/config.edn")
:config (components/new-config "back/config.edn")
:http (components/new-http-mock {})
:router (components/new-router routes/routes)
:database (component/using (components/new-database) [:config])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

(defn- create-and-start-components []
(component/system-map
:config (components/new-config "~/back/config.edn")
:config (components/new-config "back/config.edn")
:http (components/new-http-mock
(vals (select-keys
mocked-responses
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

(defn- create-and-start-components []
(component/system-map
:config (components/new-config "~/back/config.edn")
:config (components/new-config "back/config.edn")
:http (components/new-http-mock mocked-responses)
:publisher (component/using (components/new-publisher-mock) [:config])))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@

(defn- create-and-start-components []
(component/system-map
:config (components/new-config "~/back/config.edn")
:config (components/new-config "back/config.edn")
:http (components/new-http-mock mocked-responses)
:publisher (component/using (components/new-publisher-mock)
[:config])))
:publisher (component/using (components/new-publisher-mock) [:config])))

(sf/defflow
flow-fail-retrieve-data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
(defn- create-and-start-components []
(component/start-system
(component/system-map
:config (components/new-config "~/back/config.edn")
:config (components/new-config "back/config.edn")
:sentry (component/using (components/new-sentry-mock) [:config])
;; this test should have redis up to run!
;; docker-compose -f docker/docker-compose.yml redis up
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
(defn- create-and-start-components []
(component/start-system
(component/system-map
:config (components/new-config "~/back/config.edn")
:config (components/new-config "back/config.edn")
:http (components/new-http-mock {})
:router (components/new-router routes/routes)
:database (component/using (components/new-database) [:config])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
(defn- create-and-start-components []
(component/start-system
(component/system-map
:config (components/new-config "~/back/config.edn")
:config (components/new-config "back/config.edn")
:http (components/new-http-mock {})
:router (components/new-router routes/routes)
:database (component/using (components/new-database) [:config])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
(defn- create-and-start-components []
(component/start-system
(component/system-map
:config (components/new-config "~/back/config.edn")
:config (components/new-config "back/config.edn")
:http (components/new-http-mock {})
:router (components/new-router routes/routes)
:database (component/using (components/new-database) [:config])
Expand Down

0 comments on commit 2d1dc0b

Please sign in to comment.