Fork me on GitHub
#polylith
<
2022-05-10
>
Jungin Kwon08:05:22

The poly test command doesn't recognize circleci's config.clj, has anyone had this experience?

imre08:05:18

do you happen to have a repo where this is reproduced?

imre08:05:50

Or perhaps some more detail on what it means that it isn't recognized?

Jungin Kwon08:05:12

I am using https://github.com/circleci/circleci.test#global-fixtures of circleci. When I do poly test ,it seems that global fixtures are not loaded. This is my alias

:test      {:extra-paths ["test" "test/resources"]
            :extra-deps  {integrant/repl           {:mvn/version "0.3.2"}
                          circleci/circleci.test   {:mvn/version "0.5.0"}
                          cloverage/cloverage      {:mvn/version "1.2.2"}
                          peridot/peridot          {:mvn/version "0.5.3"}
                          district0x/graphql-query {:mvn/version "1.0.6"}}
            :main-opts   ["-m" "cloverage.coverage"
                          "-p" "src" "-s" "test"
                          "--runner" "circleci.test"]}

Jungin Kwon08:05:43

clojure -M:test command works fine.

imre09:05:10

from your main-opts it appears to me when you run clojure -M:test it will invoke cloverage, which then will route to a circleci-specific runner. Is that observation correct?

imre09:05:18

I'm not familiar with circleci's runner, but I think that is the piece that "knows" about that config.clj you mentioned. Out of the box poly test is unaware of circleci (and cloverage) and so it doesn't know what to do with that circleci-specific file. If you depend on this functionality, you might want to implement and plug in a custom test runner that proxies to circleci's own. This has only recently become an option: https://github.com/polyfy/polylith/pull/196 (disclaimer: I'm the author of that PR as I needed that pluggability to connect with the kaocha test runner. I am not a polylith team member however.) If you decide to go this way, you might decide to take a look at https://github.com/imrekoszo/polylith-kaocha which is the implementation I ended up with.

imre09:05:25

On the other hand, if the only thing you need from circleci is global fixtures, polylith has a thing called "test setup and teardown" which appear to me to be similar to the global fixtures you mentioned. This is built into polylith, so you won't need a custom test runner to use them. See more at https://polylith.gitbook.io/poly/workflow/testing#test-setup-and-teardown

Jungin Kwon10:05:30

Got it. Thank you @U08BJGV6E!

1