This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-16
Channels
- # babashka (53)
- # beginners (61)
- # biff (2)
- # cherry (15)
- # cider (28)
- # clj-kondo (17)
- # clojure (57)
- # clojure-europe (27)
- # clojure-nl (13)
- # clojure-norway (6)
- # clojure-uk (4)
- # clojurescript (30)
- # core-async (2)
- # data-science (39)
- # datomic (16)
- # docker (34)
- # emacs (4)
- # events (1)
- # figwheel-main (9)
- # guix (5)
- # hiccdown (2)
- # honeysql (5)
- # hyperfiddle (5)
- # interceptors (1)
- # jobs (2)
- # joyride (5)
- # lsp (36)
- # midje (1)
- # minimallist (1)
- # nbb (21)
- # off-topic (45)
- # polylith (42)
- # rum (1)
- # shadow-cljs (24)
- # sql (1)
- # squint (62)
- # vrac (1)
- # xtdb (6)
Hi everyone. Me and @pez are working on improving the documentation (https://github.com/polyfy/polylith/issues/195). I have started by updating the landing page of the high-level documentation. Please https://polylith.gitbook.io/polylith/ and see if you like the change! There are more to come.
Cool! One thing I wonder from time to time is if polylith might be a good fit for cljdoc. If there is not already an intro of when to (and also not to) consider polylith for a backend system, that'd be helpful.
Havent’t used cljdoc myself. What would be the main reasons to switch from gitbook to cljdoc?
Oh no, totally not what I meant. I consider using polylith for the cljdoc backend system itself, but never get around to learning if it is a good idea or not.
Okay! Cool!
If you need some help, just let me know!
I should be a good fit for all backend systems, except if the artefacts are different libraries that need to work together and share the same components. There is an issue created for that case https://github.com/polyfy/polylith/issues/212.
Trying to get poly test
working for the first time, after just using the IDE to run tests. Nothing is being run. Is it possible that errors from illegal imports (deeper than the component's root interface) are causing the test runner to simply abort?
Errors like
Error 101: Illegal dependency on namespace db.customer.queries.interface in api.api. Use db.interface instead to fix the problem.
Run this command poly ws out:ws.edn
from the workspace root and send me the ws.edn
file + workspace.edn here on Slack (direct to me) and I will have a look.
Also send deps.edn at the root @U8ZQ1J1RR!
Hm, the var names of all interfaces makes me a bit uneasy to share it all. I'll start a new polylith project just to investigate testing, and take the ws.edn from that if I cannot figure it out. Thanks!
Okay, no problem!
https://github.com/hukka/polylith-testing/tree/main I managed to get this one to run a test in https://github.com/hukka/polylith-testing/blob/main/bases/cli/test/myapp/cli_test.clj, but not anywhere else (in the base src, or component's src or test)
In our real project the vast majority of tests are co-located with the source, some in the components' test folders, and none in the bases' test folders. So that kinda explains why I couldn't get anything to run
Okay, so you understand why you got the problem and how to solve it now?
Ah, no. I have no idea how to make polylith run tests in https://github.com/hukka/polylith-testing/blob/main/bases/cli/src/myapp/cli.clj https://github.com/hukka/polylith-testing/blob/main/components/mycomponent/src/myapp/mycomponent/core.clj and https://github.com/hukka/polylith-testing/blob/main/components/mycomponent/test/myapp/mycomponent_test.clj
Okay, will have a look later.
I made a change in the https://github.com/hukka/polylith-testing/blob/main/bases/cli/src/myapp/cli.clj base (a comment) and then ran the test command (from the shell in this case) and got this output:
Yeah, I also get the cli_test.clj to run. But a change in the component's function does not trigger the tests in the base's src, or component's src or tests
It starts by running the tests for mycomponent
but it stops when that fails, otherwise it would have continued with cli
, so it looks right to me.
Ah, fail fast is on be default. Somehow I thought I had read you'd have to set that manually
Though the failing test that it does run is not in the component, but in the cli. But that doesn't matter
Hm, reading through https://polylith.gitbook.io/poly/workflow/testing and https://polylith.gitbook.io/poly/workflow/configuration but I cannot find a way to run all tests, to get all the failures. Is there one?
But it starts running cli
(because it runs all the bricks alphabetically) and then it continues (if no tests are failing) with mycomponent
. If you change the component naame to e.g. acomponent
it would run that first, and then fail on cli
.
No, we fail fast, and currently there is no way of configuring it to continue the test run even if it fails.
If you have several projects, I guess people would like to configure if the test runner should finish the current project and then stop, or continue with all projects, even if e.g. fails at the first project.
You can create an issue if you like.
And of course I still need to figure out why no tests were run at all on the real project 😕
> Is this something that could be changed by using kaocha as the plugable runner? Seems like it is, when I change to the kaocha runner, it runs all the tests
Okay, so then you will use Kaocha instead?
Is the problem reproducable in your polylith-testing repo also?