Fork me on GitHub
#polylith
<
2022-04-29
>
imre13:04:23

QQ: is it okay for one project to have a test-time dependency on another project?

imre14:04:49

(check doesn't seem to complain so I'm assuming it is)

furkan3ayraktar15:04:35

Do you include the other project as a :local/root dep? In that case, the resulting classpath for running the tests will be the union of the both projects. So, it won’t be isolated to the project running the tests anymore. Can you share a little bit more context? I would like to understand where the need comes from.

imre15:04:18

Sure, so it's to do with the test-runner example implementation 🙂 and especially dogfooding it.

imre15:04:54

so test-runner is what runs in the poly alias classloader

imre15:04:48

and by default, it invokes commands from the kaocha-wrapper project in the classloader of the project under test, so projects under test should have kaocha-wrapper on their classpaths

imre15:04:55

Now, the example project demonstrates how you'd use this in a polylith workspace, and as a result, it has a test-time dependency on, well, the component wrapped by the kaocha-wrapper project, but also all of that component's in-workspace dependencies, which are only collected in the kaocha-wrapper project itself

furkan3ayraktar15:04:21

I think this could be a rare valid case for using it the way you use 😄. Good that poly tool didn’t have a check for that!

imre15:04:33

Thanks for confirming that 🙂

🙌 1