This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-01-15
Channels
- # aleph (1)
- # announcements (7)
- # beginners (6)
- # calva (24)
- # cider (18)
- # clj-otel (1)
- # clojars (8)
- # clojure (22)
- # clojure-dev (11)
- # clojure-europe (52)
- # clojure-finland (12)
- # clojure-nl (1)
- # clojure-norway (28)
- # clojure-uk (7)
- # clojured (1)
- # cursive (6)
- # datomic (1)
- # events (1)
- # humbleui (41)
- # hyperfiddle (75)
- # lsp (46)
- # malli (34)
- # matrix (1)
- # off-topic (16)
- # releases (1)
- # shadow-cljs (12)
- # squint (11)
- # timbre (1)
- # tools-deps (24)
hey all, I'm trying to run my tests in a CI pipeline (or just via the CLI).
I have some tests under the tests
folder and the following alias in my deps.edn
:
:test {:extra-paths ["config/test" "tests"]}
How can I run all the tests through a CLI command?
We are not using lein
Hi @U057T406Y15. You'll need a https://practical.li/clojure/testing/test-runners/. And then you need to call this test runner in your deps.edn-alias https://github.com/seancorfield/dot-clojure/blob/develop/deps.edn#L35.
For kaocha https://cljdoc.org/d/lambdaisland/kaocha/1.87.1366/doc/2-installing#clojure-cli--depsedn
You can also write your own runner, if you want to be incredibly basic. Clojure’s runner is a good example: https://github.com/clojure/clojure/blob/master/src/script/run_test.clj
Anyone seen this or similar error and know what I should look for to fix ?
"Execution error (ClassNotFoundException) at jdk.internal.loader.BuiltinClassLoader/loadClass (BuiltinClassLoader.java:641).\norg.eclipse.jetty.util.Trie\n",
It happens when run-jetty is launched, I am thinking dependency conflict ?
I was doing so project clean up and updating dependencies.
definitely deps version related downgrading to this older version fixes it
ring/ring {:mvn/version "1.9.4"}
ring/ring-jetty-adapter {:mvn/version "1.9.4"}
upgrading to 1.10 is fine just 1.11 that starts throwing the error
So this was caused by xtdb I pulled in xtdb http server for the "EntityRef" function but xtdb is using an older version of jetty
Well partly from knowing that I had not changed the code and had just been updating then looking at the deps tree with this command
clj -X:deps tree | grep --color -E 'jetty|$'
which show the tree and highlights any use of jetty so i could see which libraries pulled in jetty
Always a pain to debug though as there is no hint that its version related, yeah that really helps when you have a huge dependency tree 🙂
Trying to get #CPABC1H61 working seamlessly with #C02PR4GM873 and #C053Q1QSG. So far I'm running it with default configs through nvim-lspconfig
and installing it with mason.nvim
on Arch linux. Everything works as expected, except that I get unresolved symbol errors on everything from the overtone library, and I am not able to jump to the definitions of those symbols. I silenced the errors by putting {:config-in-ns {core {:linters {:unresolved-symbol {:level :off}}}}}
in the .clj-kondo/config.edn
of the project root, in addition to generating the linter files from within the overtone project itself. Did anybody have success in getting this working?
The proper way is to configure clj-kondo to understand those macros, and even best to move that config to the overtone lib itself so others using the lib will get the config working out of the box
Makes sense. Will open an issue!
Probably an easy one but... I have a list of tests where I define a test as a map of {:args ... :ouput ...}. I want to deftest where I essentially do the following:
(deftest tests
(map
(λ [{:keys [args output]}]
(is (= (apply testfunc args) output)))
test-cases))
But when I try to run this no assertions are found. There must be a way to do this...Because map
is lazy. Look at are
in clojure.test
which is intended for this sort of thing.
You could also just replace map
with run!
here -- or switch to doseq
since you want side-effects (the assertions), rather than a sequence result.