This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-30
Channels
- # adventofcode (95)
- # announcements (17)
- # babashka (28)
- # beginners (107)
- # calva (34)
- # clj-kondo (7)
- # cljs-dev (20)
- # cljsrn (1)
- # clojure (95)
- # clojure-europe (41)
- # clojure-italy (3)
- # clojure-nl (5)
- # clojure-spec (7)
- # clojure-uk (4)
- # clojurescript (77)
- # cursive (7)
- # data-science (1)
- # datalog (4)
- # datomic (12)
- # events (3)
- # fulcro (32)
- # graalvm (2)
- # hugsql (19)
- # introduce-yourself (4)
- # jobs (2)
- # lsp (20)
- # membrane-term (19)
- # numerical-computing (1)
- # off-topic (8)
- # pathom (3)
- # polylith (17)
- # portal (42)
- # re-frame (7)
- # reagent (32)
- # remote-jobs (1)
- # shadow-cljs (86)
- # spacemacs (3)
- # tools-deps (52)
- # uncomplicate (1)
- # xtdb (23)
I have a polylith workspace which i recently migrated to the newer workspace.edn
version. After the migration, I can't seem to be able to run my component's tests using poly test :dev
. The issue is that i have a helper namespace in {project-root}/test/{org}/test/with_system.cljc
for my tests, which i added to the :test
alias and is indexed fine by Intellij, but poly test runner can't seem to find it
Caused by: java.io.FileNotFoundException: Could not locate fully/test/with_system__init.class, fully/test/with_system.clj or fully/test/with_system.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.
In terms of previous discussion, I've switched back to :extra-paths
way of importing my components to the dev alias just in case.I’m not exactly sure I follow where you put the with_system.cljc
file. Maybe you can execute the tree
command so that I see exactly where you put it.
├── bases
│ └── server
│ ├── deps.edn
│ └── src
│ └── fully
│ └── server
│ └── core.clj
├── components
│ ├──
│ │ ├── deps.edn
│ │ └── src
│ │ └── fully
│ │ └── config
│ │ ├── api.cljc
│ │ └── core.cljc
│ ├── errors
│ │ ├── deps.edn
│ │ └── src
│ │ └── fully
│ │ └── errors
│ │ ├── api.clj
│ │ └── core.clj
│ ├── logger.timbre
│ │ ├── deps.edn
│ │ └── src
│ │ └── fully
│ │ └── logger
│ │ ├── api.clj
│ │ └── core.clj
│ ├── middleware
│ │ ├── deps.edn
│ │ └── src
│ │ └── fully
│ │ └── middleware
│ │ ├── api.clj
│ │ └── core.clj
│ ├── repository.crux
│ │ ├── deps.edn
│ │ ├── src
│ │ │ └── fully
│ │ │ └── repository
│ │ │ ├── api.clj
│ │ │ └── core.clj
│ │ └── test
│ │ └── fully
│ │ └── repository
│ │ └── core_test.clj
│ ├── resolver.pathom
│ │ ├── deps.edn
│ │ └── src
│ │ └── fully
│ │ └── resolver
│ │ ├── api.clj
│ │ └── core.clj
│ ├── ring-handler.reitit
│ │ ├── deps.edn
│ │ └── src
│ │ └── fully
│ │ └── ring_handler
│ │ ├── api.clj
│ │ └── core.clj
│ ├── ring-server.jetty
│ │ ├── deps.edn
│ │ └── src
│ │ └── fully
│ │ └── ring_server
│ │ ├── api.clj
│ │ └── core.clj
│ ├── routes.default
│ │ ├── deps.edn
│ │ └── src
│ │ └── fully
│ │ └── routes
│ │ ├── api.clj
│ │ └── core.clj
│ ├── schema.malli
│ │ ├── deps.edn
│ │ ├── src
│ │ │ └── fully
│ │ │ └── schema
│ │ │ ├── api.cljc
│ │ │ └── core.cljc
│ │ └── test
│ │ └── fully
│ │ └── schema
│ │ └── core_test.cljc
│ └── system
│ ├── deps.edn
│ └── src
│ └── fully
│ └── system
│ ├── api.clj
│ └── core.clj
├── config
│ └── dev
│ └── env.edn
├── default-registry
│ └── auth
│ └── auth.edn
├── deps.edn
├── development
│ ├── resources
│ │ └── schema.edn
│ └── src
│ ├── dev.clj
│ └── system.clj
├── fully.iml
├── logo.png
├── projects
├── protocols
│ └── src
│ └── fully
│ └── protocols
│ ├── repository.clj
│ ├── resolver.clj
│ ├── ring.clj
│ └── schema.cljc
├── readme.md
├── test
│ └── fully
│ └── test
│ └── system.cljc
└── workspace.edn
I renamed with_system.cljc
to system.cljc
in hopes that that could be the issue
Try putting the namespace under projects/testproj/fully/test/system.cljc
.
but then i would have to run the test runner using that project no?
I changed my mind! Maybe you can put that test code in a component instead, like test-helper
or similar?
@U1G0HH87L went with this approach and it looks like it works.
└── test-helper
├── deps.edn
└── src
└── fully
└── test_helper
└── with_system.cljc
Although now when i do poly test :dev
it appears as a tested component which is not necessarily true.
Running tests from the development project, including 3 bricks: repository.crux, schema.malli, test-helper
My deps.edn
looks like this:
:test {:extra-paths ["components/test-helper/src"
"components/repository.crux/test"
"components/schema.malli/test"]}
But it is part of the test execution (used by other tests). Also, you should rename the components that have a dot in their names, like from shchema.malli
to shema-malli
.
What is this workspace.edn file used for? It's generated by the tool but I haven't seen anything to indicate that it's used for anything.
The keys are explained https://polylith.gitbook.io/poly/workflow/configuration.
Is there documentation on it somewhere?
The different keys are explained through out the documentation, with start from the https://polylith.gitbook.io/poly/architecture/workspace section.