This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-10
Channels
- # announcements (3)
- # asami (4)
- # babashka (21)
- # beginners (97)
- # calva (32)
- # cider (4)
- # clj-kondo (7)
- # cljdoc (1)
- # clojure (70)
- # clojure-europe (27)
- # clojure-nl (10)
- # clojure-norway (18)
- # clojure-uk (8)
- # clojure-ukraine (1)
- # clojurescript (5)
- # datalevin (7)
- # docker (1)
- # emacs (3)
- # fulcro (4)
- # girouette (4)
- # graalvm (2)
- # graphql (9)
- # gratitude (3)
- # honeysql (4)
- # hoplon (3)
- # hyperfiddle (7)
- # jobs (3)
- # kaocha (31)
- # lsp (23)
- # malli (7)
- # missionary (6)
- # nextjournal (9)
- # off-topic (6)
- # pathom (13)
- # polylith (13)
- # practicalli (3)
- # remote-jobs (3)
- # reveal (7)
- # schema (1)
- # sci (23)
- # shadow-cljs (31)
- # tools-deps (62)
- # xtdb (8)
I am wondering if I am doing something wrong. After I make a change in the tests of a component, the
test
command is running the exact same tests twice. This is just because the component is being used in two projects. In both projects the relevant components used in the test are exactly the same though.Even though it is a simple test, it takes around a minute from the poly shell (startup time?). I’m thinking this could at least be halved by running the test only once. But this goes against the possibility that one of the projects uses a different implementation. I haven’t used this swap feature yet, but I’m paying the price for it. Is there a way to make this scenario more efficient?
I found a nice solution after reading the documentation one more time. I can filter for just the project I’m interesting in (at this time): poly test project:<project-name>
and it will only run the tests for that brick from the perspective of that project. Perfect 🙂
Cool!
From the documentation I read to keep our fast _brick_ tests fast enough to give us a really fast feedback loop
(https://polylith.gitbook.io/poly/workflow/testing). What do you consider really fast? The test
command is only fast for me when there are no changes, if some brick is affected, it takes at least half a minute. Enough to make me impatient unfortunately
I would say it’s a balance between how confident you want to be and how long you think is a reasonable time to run the tests.
Is the Poly project itself still a good example of how to organise the classpath with polylith? I see that deps are defined in the https://github.com/polyfy/polylith/blob/master/deps.edn#L34-L46 whereas I think the https://polylith.gitbook.io/poly/workflow/libraries is saying that the deps should be defined in the components so that they are self-contained
You're conflating two different things
> see that deps are defined in the https://github.com/polyfy/polylith/blob/master/deps.edn#L34-L46
some deps that happen to be useful during development
> the deps should be defined in the components so that they are self-contained
the deps that are used by the components
the "main deps.edn" is the deps.edn of the Dev project that the documentation mentions:
> Libraries are specified in deps.edn
in each component, base, and project
> Dev project src ./deps.edn
> :aliases
> :dev
> :extra-deps
There's nothing wrong with having some dependencies that are useful during development in the development deps.edn
I see your point. Adding some extra deps for development is ok. But I see that it’s not just about extra deps. There is redundancy between the component deps and the deps in the main deps.edn (e.g. zprint, me.raynes/fs, mvxcvi/puget)
In https://github.com/furkan3ayraktar/clojure-polylith-realworld-example-app I see the same pattern
I wonder if these “examples” need to be updated or if I just have some misunderstandings
Both @U2BDZ9JG3 and me use Cursive which doesn’t suport the :local/root syntax correctly. If you use Emacs/Cider or VSCode/Calva, then you don’t have to repeat libraries that are specified in bricks that are specified using the :local/root syntax in ./deps.edn.
You can refer to this issue: https://github.com/cursive-ide/cursive/issues/2554
Thank you, that helps!