Fork me on GitHub
#polylith
<
2022-07-13
>
imre20:07:44

polylith 4
🎉 6
Jungwoo Kim10:07:23

Hi imre! I’m trying to use polylith-kaocha and am I right that some hooks like pre|post-test|load(etc) don’t support yet? I’ve looked up the source code and found nothing about it.

Jungwoo Kim10:07:55

cuz I want to do integration tests and need some hooks!

imre10:07:58

Kaocha hook you mean? Those should be supported

imre10:07:25

You provide your kaocha config as a resource and whatever you set in it should be grand

Jungwoo Kim10:07:36

yeah, I mean Kaocha hooks

imre10:07:00

But if you have trouble with something, let me know

imre10:07:23

Repro case is welcome in these cases

Jungwoo Kim10:07:42

That already works but I think I’m confused with hooks in kaocha config and https://github.com/imrekoszo/polylith-kaocha#hooking-into-parts-of-the-process one.

imre10:07:41

Ah, those are polylith-kaocha's own hooks

👍 1
imre10:07:02

In casr it does something differently from how consumers like

👍 1
Jungwoo Kim10:07:36

Then, all I just have to do is make hooks in kaocha config?

imre10:07:06

That's where I'd start yeah

imre10:07:36

Theres no connection between the two groups of hooks

Jungwoo Kim10:07:58

Ok cool! great! wanna ask one more thing!

Jungwoo Kim10:07:56

clojure -Srepro -M:poly test project:my-project
I do test my-project including serveral bricks (bases/components) including also have tests. In that case, how hooks in kaocha config placed in my-project work?

Jungwoo Kim10:07:34

tests.edn in my-project and I imagined that every bricks are hooked pre-test

imre10:07:42

no, the kaocha runner is only invoked once per project

imre10:07:03

in the current implementation, that is

Jungwoo Kim10:07:43

Ahh, do you consider my requirement is needed in the future?

Jungwoo Kim10:07:06

at the same time, that’s not a good use case cuz polylith suggest that integ test would be in a project, not in bricks. That means, in general, we wouldn’t need hooks in bricks?

imre10:07:32

I’m not sure. Polylith doesn’t have per-brick test setup/teardown. I haven’t had the need to have that. Integration tests should IMO operate at the project level

imre10:07:07

If this presents a difficulty, you could add a https://github.com/imrekoszo/polylith-kaocha/blob/182e88dfb3aebcc4be321130fd7d0e6e77beafc6/bases/example/test/polylith_kaocha/example/hooks.clj#L19 and invoke kaocha in a different way, i.e. per brick somehow

imre11:07:01

I saw there is a fork of polylith-kaocha that adds support for https://github.com/imrekoszo/polylith-kaocha/compare/master...SavageMessiah:polylith-kaocha:exclude-bricks?w=true, not sure if that is something that would help you

👍 1
imre11:07:12

You could also create an issue in the repo so a potential feature could be discussed and specified

👍 1
Jungwoo Kim23:07:56

Thanks for your comment. I’ll figure out my test structure and needs. 🙂