Fork me on GitHub
#clojure
<
2024-01-15
>
itaied09:01: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

itaied10:01:20

great! thanks it worked

👍 1
timo10:01:05

BTW there is a #C053AK3F9 channel

👍 1
Noah Bogart17:01:11

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

👍 1
Oliver Marks15:01:51

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.

Oliver Marks15:01:13

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"}

Oliver Marks15:01:00

upgrading to 1.10 is fine just 1.11 that starts throwing the error

Oliver Marks16:01:05

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

phill17:01:04

How did you troubleshoot it?

Oliver Marks17:01:30

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|$'

Oliver Marks17:01:08

which show the tree and highlights any use of jetty so i could see which libraries pulled in jetty

🆒 3
phill17:01:36

The |$ is a neat trick to cause non-matching lines to be matched (without highlight)!

Oliver Marks17:01:18

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 🙂

Kenneth Flak15:01:42

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?

ericdallo16:01:33

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

1
Kenneth Flak18:01:11

Makes sense. Will open an issue!

Zach21:01:59

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...

seancorfield21:01:09

Because map is lazy. Look at are in clojure.test which is intended for this sort of thing.

seancorfield21:01:21

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.

Zach22:01:42

ty, are looks just about right