polylith

DenisMc 2024-08-28T16:01:04.625789Z

Hi, I’m configuring the polylith-kaocha wrapper, following the instructions on https://github.com/imrekoszo/polylith-kaocha. However, when I run clojure -M:poly test :verbose , I get the following error:

ERROR in unit (load.clj:48)
Failed loading tests:
Exception: java.lang.NullPointerException: Cannot invoke "Object.hashCode()" because "key" is null
 at java.util.concurrent.ConcurrentHashMap.get (ConcurrentHashMap.java:936)
    ...
    kaocha.type.ns$eval4321$fn__4322.invoke (ns.clj:38)
    ...
    kaocha.testable$load.invokeStatic (testable.clj:94)
    kaocha.testable$load.invoke (testable.clj:75)
    kaocha.testable$load_testables.invokeStatic (testable.clj:153)
    kaocha.testable$load_testables.invoke (testable.clj:145)
    kaocha.load$load_test_namespaces.invokeStatic (load.clj:48)
    kaocha.load$load_test_namespaces.doInvoke (load.clj:36)
    ...
    kaocha.type.clojure.test$eval5747$fn__5748.invoke (test.clj:16)
    ...
    kaocha.testable$load.invokeStatic (testable.clj:94)
    kaocha.testable$load.invoke (testable.clj:75)
    kaocha.testable$load_testables.invokeStatic (testable.clj:153)
    kaocha.testable$load_testables.invoke (testable.clj:145)
    kaocha.api$test_plan.invokeStatic (api.clj:58)
    kaocha.api$test_plan.invoke (api.clj:51)
    kaocha.api$run$fn__3692.invoke (api.clj:103)
    ...
Any pointers from anyone on where I might be going wrong here?

imre 2024-08-28T16:28:02.294069Z

This already happens inside kaocha itself so at least the connection is working. Do you have a test.edn you can share?

DenisMc 2024-08-28T16:33:09.599369Z

I don’t have a custom test.edn right now, should it default to the default-tests.edn in the wrapper in this case?

imre 2024-08-28T16:36:33.764489Z

It should, yes. Was just wondering if it could have anything to do with it.

imre 2024-08-28T16:36:57.266929Z

Unfortunately the stack trace doesn't say much, it points to somewhere around here: https://github.com/lambdaisland/kaocha/blob/15e553ddba5497a91099f0edda8433d66ef1094f/src/kaocha/type/ns.clj#L38C17-L39

imre 2024-08-28T16:37:12.135229Z

So I'm guessing it has trouble loading a namespace perhaps

imre 2024-08-28T16:40:50.832589Z

I'd try narrowing the scope of the test run to see if I can locate the problematic namespace

DenisMc 2024-08-28T16:43:14.967949Z

Thanks, I’ll try that

2024-09-01T01:11:04.210629Z

not sure if related, i noticed some bugs with test on <=0.2.19, we're on 0.2.20 now.

2024-08-28T21:34:10.703549Z

Hi, I'm having difficulty attempting to implement the same interface in multiple components (only one of which is included in any given project), but poly info is giving me an error that makes it look as if because I have it included in one component not declared as a dependency of one of the projects it can't find the same namespace as defined in the component actually defined as a dependency of the project. I've checked and the signatures are 100% identical - not sure what I'm doing wrong here, as the poly documentation seems to indicate I should be able to do this.

seancorfield 2024-08-28T21:49:26.751919Z

Can you provide a bit more detail? At work we have multiple implementations of a couple of interfaces. What exactly is the error? What exactly are your namespaces and component names?

2024-08-28T22:14:22.406799Z

@seancorfield Nevermind, I figured it out, was doing something stupid. Thanks for responding anyway!

seancorfield 2024-08-28T23:20:28.987369Z

Would you share? Maybe it's something that could be clearer in the docs or examples?