Fork me on GitHub
#polylith
<
2021-10-19
>
tengstrand03:10:59

For you who wants support for the :local/root syntax in profiles, please check out the https://github.com/polyfy/polylith/tree/issue-146 branch. See also https://github.com/polyfy/polylith/issues/146.

seancorfield16:10:25

Although check returns OK when the profiles are specified as just :extra-deps with :local/root, test does not run correctly (the components from the profiles are not found).

seancorfield16:10:23

Here's how I have the profiles now:

:+default {:extra-deps {;; by default, we use Hato:
                          poly/http-client-hato {:local/root "components/http-client-hato"}}}

  :+httpkit {:extra-deps {;; but we can switch to the http-kit version:
                          poly/http-client-httpkit {:local/root "components/http-client-httpkit"}}}
but when I run the tests for dev:
clojure$ test :dev :all
Projects to run tests from: activator, api, auth, development, eros-features, frankieee, login, migration, preview, system, worldsingles, wsadmin, wsbilling-admin, wsbilling-member, wsbilling-rebill, wsmessaging, wsphotoqueue, wsseogeo

Running tests from the activator project, including 1 brick: http-client-hato

Testing ws.http-client.interface-test

Ran 2 tests containing 43 assertions.
0 failures, 0 errors.
...
# projects work since they explicitly depend on the Hato component or the httpkit component
...
Running tests from the development project, including 36 bricks: affiliate-link, artifact-uploader, billing-machine, billing-sdk, billing-shared, caching, configuration, crud-form, datasources, date-time, environment, exceptions, feature-flag-admin, feature-flags, file-system, frankieee, gdpr, google-search-console, host-services, http-client-hato, http-client-response, member-engagement, messaging-sdk, safe-coercions, seo-json-renderer, seo-keyword, site, slack-notifications, system-properties, user-attributes, admin, artifact-uploader-cli, batch-jobs, eros-features-cli, frankieee-cli, preview-web
java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at polylith.clj.core.common.class_loader$invoke_in_STAR_.invokeStatic(class_loader.clj:31)
...
Caused by: Syntax error compiling at (ws/http_client/impl.clj:1:1).
	at clojure.lang.Compiler.load(Compiler.java:7652)
	at clojure.lang.RT.loadResourceScript(RT.java:381)
	at clojure.lang.RT.loadResourceScript(RT.java:372)
	at clojure.lang.RT.load(RT.java:459)
	at clojure.lang.RT.load(RT.java:424)
...
Caused by: java.io.FileNotFoundException: Could not locate hato/client__init.class, hato/client.clj or hato/client.cljc on classpath.
	at clojure.lang.RT.load(RT.java:462)
	at clojure.lang.RT.load(RT.java:424)
	at clojure.core$load$fn__6860.invoke(core.clj:6149)
	at clojure.core$load.invokeStatic(core.clj:6148)
	at clojure.core$load.doInvoke(core.clj:6132)
...
Couldn't run test statement for the development project: (do (clojure.core/use (quote clojure.test)) (clojure.core/require (quote ws.admin.web-test)) (clojure.test/run-tests (quote ws.admin.web-test))) java.lang.reflect.InvocationTargetException

seancorfield16:10:22

That's with SHA 75945bc6d746ec3448f02e43b0a4cc6e3f2a9bb4 which is the tip of issue-146. Here's what I've had to use before and what still works with issue-146:

:+default {:extra-deps {;; by default, we use Hato:
                          poly/http-client-hato {:local/root "components/http-client-hato"}}
             ;; seems like a bug that we still need to specify _paths_?
             :extra-paths ["components/http-client-hato/src"
                           "components/http-client-hato/test"]}

  :+httpkit {:extra-deps {;; but we can switch to the http-kit version:
                          poly/http-client-httpkit {:local/root "components/http-client-httpkit"}}
             ;; seems like a bug that we still need to specify _paths_?
             :extra-paths ["components/http-client-httpkit/src"
                           "components/http-client-httpkit/test"]}

tengstrand18:10:17

Okay, will have a look tomorrow.

tengstrand03:10:21

Good morning @U04V70XH6. It works on my test project, so I think I need to take a closer look at your setup. Can you please execute ws out:ws.edn and email me the result.

seancorfield03:10:40

Not until I'm back at work tomorrow. Did you test with a different external library dep in each implementation?

tengstrand03:10:58

Yes, I did. I must have missed something. I need to dig deeper into this.