kaocha

Official support channel: https://clojureverse.org/c/projects/kaocha
Margo 2021-04-13T12:24:43.024100Z

Good afternoon everyone! I have recently purchased a new Mac M1 with Apple silicon and it looks like kaocha doen't work in there. I was advised to join this channel.

dharrigan 2021-04-13T12:25:03.024300Z

It runs for me fine on my Mac Mini M1

dharrigan 2021-04-13T12:25:15.024800Z

You'll need to elaborate further on what specifically is not working.

Margo 2021-04-13T12:25:18.024900Z

I can tell that, yes

Alys Brooks 2021-04-14T20:46:10.036900Z

Hmm, that's unfortunate. Can you attach the whole stacktrace?

Margo 2021-04-13T12:25:26.025100Z

So, the issue is:

Margo 2021-04-13T12:27:58.025200Z

I have kaocha with lein on the project,

Margo 2021-04-13T12:28:03.025400Z

[lambdaisland/kaocha "1.0.669"]
                                [lambdaisland/kaocha-junit-xml "0.0.76"]

Margo 2021-04-13T12:28:16.025600Z

:aliases {"kaocha" ["with-profile" "test" "run" "-m" "kaocha.runner"]

Margo 2021-04-13T12:28:38.025800Z

as I run

lein kaocha unit

Margo 2021-04-13T12:28:41.026Z

I get:

Margo 2021-04-13T12:29:03.026200Z

ERROR in unit (core.clj:6)
Exception: clojure.lang.Compiler$CompilerException: Syntax error macroexpanding at (core.clj:6:3).
#:clojure.error{:phase :execution, :line 6, :column 3, :source "core.clj"}
 at clojure.lang.Compiler$InvokeExpr.eval (Compiler.java:3707)

dharrigan 2021-04-13T12:29:24.026400Z

Two things

dharrigan 2021-04-13T12:29:39.026600Z

Perhaps best to upgrade to the latest kaocha, you're quite behind

dharrigan 2021-04-13T12:29:52.026800Z

and are you running with an ARM JVM?

Margo 2021-04-13T12:30:24.027Z

I would need to run it by my team (the upgrade part)

dharrigan 2021-04-13T12:30:44.027200Z

You can try locally first, no?

Margo 2021-04-13T12:30:54.027400Z

Sure, I meant in general

Margo 2021-04-13T12:31:18.027600Z

I meant I would need to be able to work with the current setup before we upgrade

Margo 2021-04-13T12:31:28.027800Z

I do not think I am running ARM JVM

Margo 2021-04-13T12:31:32.028Z

How can I check?

dharrigan 2021-04-13T12:31:37.028200Z

java --version

Margo 2021-04-13T12:33:11.028400Z

openjdk 16 2021-03-16
OpenJDK Runtime Environment AdoptOpenJDK (build 16+36)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 16+36, mixed mode, sharing)

dharrigan 2021-04-13T12:33:18.028600Z

yup, non arm

Margo 2021-04-13T12:33:27.028800Z

ok, so I would need arm?

dharrigan 2021-04-13T12:33:41.029Z

I would suggest yes

Margo 2021-04-13T12:34:37.029200Z

May I ask about more info/pointers as to why?

Margo 2021-04-13T12:34:52.029400Z

I mean, I get it, to get kaocha to work in my case, but in general?

dharrigan 2021-04-13T12:34:58.029600Z

Yes

dharrigan 2021-04-13T12:35:12.029800Z

You are running the JVM under a translation layer, rosetta2

dharrigan 2021-04-13T12:35:19.030Z

there are no guarantees

dharrigan 2021-04-13T12:35:34.030200Z

best use a JVM that is designed to run specifically with your chipset.

dharrigan 2021-04-13T12:35:49.030400Z

Until there is a release of openjdk/adoptjdk that has ARM support

Margo 2021-04-13T12:42:25.030600Z

I have done some digging, can you maybe tell me your version of java?

Margo 2021-04-13T12:42:35.030800Z

If that is ok, of coarse

dharrigan 2021-04-13T12:42:53.031Z

❯ java --version
openjdk 11.0.10 2021-01-19 LTS
OpenJDK Runtime Environment Zulu11.45+27-CA (build 11.0.10+9-LTS)
OpenJDK 64-Bit Server VM Zulu11.45+27-CA (build 11.0.10+9-LTS, mixed mode)

dharrigan 2021-04-13T12:42:55.031200Z

nothing to hide

dharrigan 2021-04-13T12:43:10.031400Z

I'm running the Azul ARM JVM

Margo 2021-04-13T12:56:03.031800Z

Instaled through Zulu, trying to change java version

schmandle 2021-04-13T13:09:30.033Z

Anybody else experiencing problems using Kaocha with the latest Clojurescript?

schmandle 2021-04-13T13:09:39.033300Z

rose on  command-result-cache [!?] 🐳  took 10s
❯ grep clojurescript deps.edn
         org.clojure/clojurescript {:mvn/version "1.10.773"}

rose on  command-result-cache [!?] 🐳 
❯ bin/kaocha
WARNING: Wrong number of args (2) passed to IndexedSeq at line 16 file:/home/kjetil/.m2/repository/thinktopic/aljabr/0.1.1/aljabr-0.1.1.jar!/thinktopic/aljabr/core.cljc
unit:   100% [==================================================] 279/279
279 tests, 1105 assertions, 0 failures.

rose on  command-result-cache [!?] 🐳  took 1m1s
❯ git checkout -- deps.edn

rose on  command-result-cache [!?] 🐳 
❯ grep clojurescript deps.edn
         org.clojure/clojurescript {:mvn/version "1.10.844"}

rose on  command-result-cache [!?] 🐳 
❯ bin/kaocha
WARNING: Wrong number of args (2) passed to IndexedSeq at line 16 file:/home/kjetil/.m2/repository/thinktopic/aljabr/0.1.1/aljabr-0.1.1.jar!/thinktopic/aljabr/core.cljc
unit:     0% [                                                  ]   0/279

Randomized with --seed 2049207396
ERROR in unit (main.java:40)
Unexpected error executing kaocha-cljs test suite.
Exception: clojure.lang.ExceptionInfo: ClojureScript Error while loading Kaocha websocket client
{:val {:via [{:type clojure.lang.ExceptionInfo, :message "Execution error (TypeError) at (<cljs repl>:1).\nlambdaisland.glogi.logger.call(...).addHandler is not a function\n", :data {:type :js-eval-exception, :error {:status :exception, :value "Execution error (TypeError) at (<cljs repl>:1).\nlambdaisland.glogi.logger.call(...).addHandler is not a function\n"}, :repl-env #cljs.repl.node.NodeEnv{:host "localhost", :port 58289, :path nil, :socket #object[clojure.lang.Atom 0x42f183d1 {:status :ready, :val {:socket #object[java.net.Socket 0x2b80cd8f "Socket[addr=localhost/127.0.0.1,port=58289,localport=34156]"], :in #object[java.io.BufferedReader 0x6736791a "java.io.BufferedReader@6736791a"], :out #object[java.io.BufferedWriter 0x1d868003 "java.io.BufferedWriter@1d868003"]}}], :proc #object[clojure.lang.Atom 0x53276769 {:status :ready, :val #object[java.lang.ProcessImpl 0x7ee63437 "Process[pid=30391, exitValue=137]"]}], :state #object[clojure.lang.Atom 0x2acc6c58 {:status :ready, :val {:listeners 0}}], :debug-port nil}, :form (require (quote kaocha.cljs.websocket-client) (quote kaocha.cljs.run)), :js "goog.require('kaocha.cljs.websocket_client');\ngoog.require('kaocha.cljs.run');\n'nil';\n"}, :at [cljs.repl$evaluate_form invokeStatic "repl.cljc" 577]}], :trace [[cljs.repl$evaluate_form invokeStatic "repl.cljc" 577] [cljs.repl$evaluate_form invoke "repl.cljc" 498] [cljs.repl$eval_cljs invokeStatic "repl.cljc" 692] [cljs.repl$eval_cljs invoke "repl.cljc" 685] [kaocha.cljs.queue_eval_loop$start_BANG_$fn__3934$fn__3939 invoke "queue_eval_loop.clj" 78] [kaocha.cljs.queue_eval_loop$start_BANG_$fn__3934 invoke "queue_eval_loop.clj" 69] [cljs.compiler$with_core_cljs invokeStatic "compiler.cljc" 1456] [cljs.compiler$with_core_cljs invoke "compiler.cljc" 1445] [kaocha.cljs.queue_eval_loop$start_BANG_ invokeStatic "queue_eval_loop.clj" 55] [kaocha.cljs.queue_eval_loop$start_BANG_ doInvoke "queue_eval_loop.clj" 40] [clojure.lang.RestFn invoke "RestFn.java" 470] [kaocha.cljs.prepl$prepl$fn__3955$fn__3956 invoke "prepl.clj" 14] [kaocha.cljs.prepl$prepl$fn__3955 invoke "prepl.clj" 13] [clojure.core$binding_conveyor_fn$fn__5772 invoke "core.clj" 2034] [clojure.lang.AFn call "AFn.java" 18] [java.util.concurrent.FutureTask run "FutureTask.java" 264] [java.util.concurrent.ThreadPoolExecutor runWorker "ThreadPoolExecutor.java" 1130] [java.util.concurrent.ThreadPoolExecutor$Worker run "ThreadPoolExecutor.java" 630] [java.lang.Thread run "Thread.java" 832]], :cause "Execution error (TypeError) at (<cljs repl>:1).\nlambdaisland.glogi.logger.call(...).addHandler is not a function\n", :data {:type :js-eval-exception, :error {:status :exception, :value "Execution error (TypeError) at (<cljs repl>:1).\nlambdaisland.glogi.logger.call(...).addHandler is not a function\n"}, :repl-env #cljs.repl.node.NodeEnv{:host "localhost", :port 58289, :path nil, :socket #object[clojure.lang.Atom 0x42f183d1 {:status :ready, :val {:socket #object[java.net.Socket 0x2b80cd8f "Socket[addr=localhost/127.0.0.1,port=58289,localport=34156]"], :in #object[java.io.BufferedReader 0x6736791a "java.io.BufferedReader@6736791a"], :out #object[java.io.BufferedWriter 0x1d868003 "java.io.BufferedWriter@1d868003"]}}], :proc #object[clojure.lang.Atom 0x53276769 {:status :ready, :val #object[java.lang.ProcessImpl 0x7ee63437 "Process[pid=30391, exitValue=137]"]}], :state #object[clojure.lang.Atom 0x2acc6c58 {:status :ready, :val {:listeners 0}}], :debug-port nil}, :form (require (quote kaocha.cljs.websocket-client) (quote kaocha.cljs.run)), :js "goog.require('kaocha.cljs.websocket_client');\ngoog.require('kaocha.cljs.run');\n'nil';\n"}}, :ns "cljs.user", :form "(require (quote kaocha.cljs.websocket-client) (quote kaocha.cljs.run))", :type :cljs/ret}
 at kaocha.type.cljs$eval7043$fn__7045$fn__7050.invoke (cljs.clj:263)
    kaocha.type.cljs$queue_consumer.invokeStatic (cljs.clj:188)
    kaocha.type.cljs$queue_consumer.invoke (cljs.clj:173)
    kaocha.type.cljs$eval7043$fn__7045.invoke (cljs.clj:258)
    ...
    kaocha.plugin.capture_output$capture_output_wrap_run_hook$fn__2318$fn__2319.invoke (capture_output.clj:83)
    ...
    kaocha.plugin.capture_output$capture_output_wrap_run_hook$fn__2318.doInvoke (capture_output.clj:83)
    ...
    kaocha.testable$run.invokeStatic (testable.clj:128)
    kaocha.testable$run.invoke (testable.clj:119)
    kaocha.testable$run_testable.invokeStatic (testable.clj:212)
    kaocha.testable$run_testable.invoke (testable.clj:157)
    kaocha.testable$run_testables.invokeStatic (testable.clj:225)
    kaocha.testable$run_testables.invoke (testable.clj:215)
    kaocha.api$run$fn__2825$fn__2826$fn__2827.invoke (api.clj:138)
    ...
    kaocha.api$run$fn__2825$fn__2826.invoke (api.clj:112)
    ...
    kaocha.api$run$fn__2825.invoke (api.clj:111)
    ...
    kaocha.api$run.invokeStatic (api.clj:98)
    kaocha.api$run.invoke (api.clj:85)
    kaocha.runner$run.invokeStatic (runner.clj:135)
    kaocha.runner$run.invoke (runner.clj:76)
    kaocha.runner$_main_STAR_.invokeStatic (runner.clj:179)
    kaocha.runner$_main_STAR_.doInvoke (runner.clj:147)
    ...
    kaocha.runner$_main.invokeStatic (runner.clj:190)
    kaocha.runner$_main.doInvoke (runner.clj:188)
    ...
0 tests, 1 assertions, 1 errors, 0 failures.

rose on  command-result-cache [!?] 🐳  took 42s
❯

schmandle 2021-04-13T13:55:33.034400Z

Downgrading kaocha-cljs to 0.0-68 made it work. So the combination kaocha-cljs 0. 0-71 and clojurescript 1.10.844 seems to be problematic

schmandle 2021-04-13T13:57:24.034800Z

ah! probably https://github.com/lambdaisland/glogi/issues/10

Alys Brooks 2021-04-13T16:13:11.035600Z

Thanks for reporting that, @schmandle! I can upgrade Kaocha-cljs to use the latest version of Glogi

Alys Brooks 2021-04-13T16:15:20.035700Z

Please keep us updated as to whether switching to an ARM JVM fixes the issue!

Margo 2021-04-13T16:53:53.035900Z

Unfortunately, it did not

Margo 2021-04-13T16:54:16.036100Z

java --version
openjdk 15.0.2 2021-01-19
OpenJDK Runtime Environment Zulu15.29+15-CA (build 15.0.2+7)
OpenJDK 64-Bit Server VM Zulu15.29+15-CA (build 15.0.2+7, mixed mode)

Margo 2021-04-13T16:55:05.036300Z

this is the version I have not, does not seem to work

dharrigan 2021-04-13T17:34:13.036500Z

It must be something deeper, I'm afraid. I don't have the experience you are having. I develop also on a M1 mini.

schmandle 2021-04-13T18:13:50.036800Z

Great. Thanks!