Fork me on GitHub
#polylith
<
2022-08-16
>
tengstrand09:08:18

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.

metal 2
lread10:08:39

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.

tengstrand10:08:54

Havent’t used cljdoc myself. What would be the main reasons to switch from gitbook to cljdoc?

lread10:08:32

Oh no, totally not what I meant. simple_smile I consider using polylith for the cljdoc backend system itself, but never get around to learning if it is a good idea or not.

tengstrand10:08:25

If you need some help, just let me know!

tengstrand10:08:53

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.

lread11:08:10

Interesting, thanks for that.

👍 1
Hukka11:08:41

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?

Hukka11:08:21

Errors like

Error 101: Illegal dependency on namespace db.customer.queries.interface in api.api. Use db.interface instead to fix the problem.

Hukka11:08:43

poly info shows the * and stx in the expected places

tengstrand13:08:02

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.

tengstrand14:08:27

Also send deps.edn at the root @U8ZQ1J1RR!

Hukka05:08:14

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!

tengstrand06:08:19

Okay, no problem!

Hukka08:08:51

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)

Hukka08:08:56

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

tengstrand08:08:51

Okay, so you understand why you got the problem and how to solve it now?

Hukka08:08:10

And I would really like to 🙂

tengstrand08:08:45

Okay, will have a look later.

tengstrand19:08:10

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:

Hukka06:08:09

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

tengstrand06:08:11

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.

Hukka06:08:43

Ah, fail fast is on be default. Somehow I thought I had read you'd have to set that manually

Hukka06:08:53

Though the failing test that it does run is not in the component, but in the cli. But that doesn't matter

Hukka06:08:43

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?

tengstrand06:08:19

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.

tengstrand06:08:32

No, we fail fast, and currently there is no way of configuring it to continue the test run even if it fails.

tengstrand06:08:43

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.

tengstrand06:08:24

You can create an issue if you like.

Hukka06:08:03

Is this something that could be changed by using kaocha as the plugable runner?

Hukka06:08:24

And of course I still need to figure out why no tests were run at all on the real project 😕

Hukka07:08:46

> 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

Hukka07:08:42

Hmh, but even that doesn't run tests that are co-located with source

tengstrand07:08:42

Okay, so then you will use Kaocha instead?

tengstrand07:08:11

Is the problem reproducable in your polylith-testing repo also?

Hukka07:08:37

Yeah, I haven't gotten anything working in the real repo yet

Hukka06:08:35

Just to make sure, is poly test supposed to run deftests that are in source files? That is files that are in src and which are not named in any special way (like with -test postfix)