This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-03
Channels
- # announcements (3)
- # asami (4)
- # aws (1)
- # babashka (22)
- # beginners (111)
- # calva (3)
- # cider (1)
- # clj-kondo (55)
- # clj-on-windows (9)
- # cljsrn (1)
- # clojure (13)
- # clojure-europe (35)
- # clojure-losangeles (3)
- # clojure-nl (2)
- # clojure-norway (2)
- # clojure-spec (2)
- # clojure-uk (5)
- # clojurescript (51)
- # conjure (5)
- # cursive (5)
- # datascript (1)
- # datomic (27)
- # deps-new (8)
- # depstar (41)
- # emacs (4)
- # fulcro (24)
- # graphql (4)
- # gratitude (8)
- # helix (36)
- # jobs (2)
- # leiningen (2)
- # lsp (11)
- # off-topic (24)
- # pathom (23)
- # pedestal (2)
- # polylith (27)
- # re-frame (12)
- # reagent (7)
- # reitit (1)
- # releases (3)
- # remote-jobs (1)
- # rewrite-clj (4)
- # sci (1)
- # shadow-cljs (27)
- # spacemacs (12)
- # tools-deps (31)
- # web-security (2)
Is there any tried integration between poly test
and kaocha
? The latter has a couple of useful plugins that we use and would like to keep in case of a switch to polylith.
I haven’t tried kaocha
myself, but the poly
tool supports adding setup
and teardown
functions to be defined, which are run before and after the tests are executed for a project.
The build in test
runner only runs tests for code that has changed since the last stable point in time, which can save you a lot of time. The tool gives you plenty of options in how to run your tests, but if you miss some functionality, please let me know!
Hmmm I think I'll have to look into this deeper. kaocha is a rather advanced test runner that does its job well (has a plugin for automatic spec/fdef testing for example) and I'd love to integrate it into the poly workflow
And on the tool integration note, do you have a tried way to lint the entire monorepo with clj-kondo?
At work we have a :lint
alias in the root deps.edn
and then we run clojure -M:lint --lint ./bases --lint ./components --lint ./projects
.
In ./deps.ednn
:
:lint {:extra-deps {clj-kondo/clj-kondo {:mvn/version "2021.03.03"}}
:main-opts ["-m" "clj-kondo.main"]}
Ideally on the poly/kaocha integration I'd want poly to figure out which bricks (or namespaces?) need to be tested so that could be relayed to kaocha
You can execute poly ws get:changes:project-to-bricks-to-test
and poly ws get:changes:project-to-projects-to-test
to see which bricks and projects that you need to run tests for.
> clojure -M:lint --lint ./bases --lint ./components --lint ./projects
Why do you lint the projects directory? Surely it has no code? Just deps.edn
files and maybe some config?
It normally has a test
directory where you put your project tests (created when the project is created).
And clj-kondo
can lint deps.edn
files too, right?
Yes, you are https://github.com/clj-kondo/clj-kondo/blob/master/doc/linters.md#depsedn, didn’t know that.
@U08BJGV6E @U096GDTLL I'm curious what you like about Kaocha compared to other runners, that you feel is missing from poly test
?
i havent tried out poly test yet so its very possible nothing. We the kaocha extensions for cloverage and junit output as well. I am still very much in the research/understanding phase. Just getting questions figured out as they pop in my head, lol
> You can execute `poly ws get:changes:project-to-bricks-to-test` and `poly ws get:changes:project-to-projects-to-test`to see which bricks and projects that you need to run tests for.
Hmm, Kaocha's --focus
does not seem designed for focusing specific test files, and even specific tests, not specific directories. But I guess that's what its test suites are for
@U04V70XH6 Kaocha has a nice https://github.com/lambdaisland/kaocha#features out of which we currently use: • filtering • pluggable reporting • randomize test order • profiling • plugins (cloverage, orchestra, automatic spec test generation) I has nice configurability and if you have it on the classpath in your repl session you can execute tests from there, using the same config you would get in ci or a command line run.
If you want @U08BJGV6E you can add a comment to https://github.com/polyfy/polylith/issues/126 issue.
@U04V70XH6 I also found the https://lambdaisland.com/blog/2018-11-02-test-wars-new-hope that made me consider kaocha in the first place
@U1G0HH87L added my thoughts there
Thank for you feedback @U08BJGV6E!