This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-11-27
Channels
- # announcements (4)
- # beginners (41)
- # biff (8)
- # cider (14)
- # clj-kondo (5)
- # clojure (45)
- # clojure-brasil (1)
- # clojure-europe (20)
- # clojure-nl (1)
- # clojure-norway (30)
- # clojure-uk (10)
- # clojurescript (8)
- # cursive (25)
- # datomic (20)
- # emacs (11)
- # events (1)
- # hoplon (9)
- # humbleui (7)
- # hyperfiddle (6)
- # lsp (63)
- # matrix (1)
- # observability (20)
- # off-topic (36)
- # polylith (11)
- # re-frame (2)
- # releases (1)
- # rewrite-clj (6)
- # scittle (42)
- # sql (6)
- # squint (86)
- # tools-deps (9)
hey, I'm trying to configure logback-text.xml but when running
poly test project:X
this is not picking the right one
I did both in projects/x/deps.edn:
:aliases {:test {:extra-paths ["../../bases/agents-api/test"]
:extra-deps {org.clojure/test.check {:mvn/version "1.1.0"}}
:jvm-opts ["-Dlogback.configurationFile=./components/log/test/resources/logback-test.xml"]}
and in general deps.edn
:poly
{:main-opts ["-m" "polylith.clj.core.poly-cli.core"]
:jvm-opts ["-Dlogback.configurationFile=./components/log/test/resources/logback-test.xml"]
:extra-deps {polyfy/polylith
{:git/url ""
:sha "f7bae45bd7efbb4dbb7986fe6fb159f6cc72f2a7"
:deps/root "projects/poly"}}}}
my structure is:
log/component/test/resources/logback-test.xml
projects/X/resources/logback.xml
what i'm missing here?I’m not 100% sure if the test runner respects the jvm-opts
. The options will be passed to the main poly
process. Test runner creates isolated classpaths for running tests in the project’s scope. I don’t think those jvm-opts
are available to the default test runner.
Is there a way that you can tell logback to use this configuration file programatically? That way, you can include the file in the extra-paths of the test alias of the component and use it as a resource instead of a relative path.
@U2BDZ9JG3 hey, thanks so what I did actually was to separate it to:
local <> /development/resources/logback.xml
prod <> projects/x/resources
test <> projects/x/test/resources
which seems to be working nowWe have a bunch of JVM opts in our :poly
alias and those get picked up just fine. What test runner are you using @USPQF75AS?
The built-in test runner should pick up those opts from :poly
. The external test runner I created (which we're using at work) picks them up from a JVM option in :poly
via an alias. I don't know if the Kaocha test runner handles this tho'...
I'm using the default one @U04V70XH6. anyway it works now so i'd rather keep going 🙂
The test-resources
directory can now be used as a resources
directory for the test context @USPQF75AS from the master
branch. See https://github.com/polyfy/polylith/issues/305.
How does test-resources help with jvm-opts? Looks like I too need to use Sean’s test-runer.
@UH13Y2FSA Can you explain what problem you are trying to solve? My external test runner is mainly about complete (classloader) isolation and memory management by running each project's tests in a subprocess rather than in the poly
process -- it really doesn't (shouldn't!) have any bearing on JVM options.
I don't understand @U1G0HH87L’s post about test-resources
-- we don't use that at work -- but I assume it is intended to help with configuration files that can differ between development (`resources` in the :dev
project), test (`test-resources`), and production (`resources` in projects
)?
My bad, answered in the wrong thread (the test-resources stuff). Not related to this discussion!
btw we running a production service for already 2 years with polylith - very happy
still haven't merged the other services... but eager to 👍