kaocha

Official support channel: https://clojureverse.org/c/projects/kaocha
plexus 2020-01-15T07:40:59.008800Z

I know nothing about github actions... Can you verify that the node executable is available?

2020-01-15T08:34:18.010Z

Yes, it is available. But actually this is not only about gh actions. I'm having the same problem on my local machine.

miikka 2020-01-15T08:39:13.010500Z

metosin/sieppari runs cljs tests in github actions like this: https://github.com/metosin/sieppari/blob/develop/.github/workflows/main.yml

miikka 2020-01-15T08:39:38.011200Z

there haven't been too many commits to sieppari so I wouldn't say that it's heavily tested but at least it passed the last couple of times it was used 😛

2020-01-15T08:50:37.012100Z

more or less how I’m trying to do except instead of leiningen I’m using tools-deps

2020-01-15T08:51:01.012500Z

Let me prepare minimal reproducible repo

2020-01-15T09:42:53.014400Z

there are two problems: • clojurescript tests runner got stuck and will be killed by GH action • locally I can get exception: “Exception: clojure.lang.ExceptionInfo: Kaocha ClojureScript client failed connecting back.”

plexus 2020-01-15T09:58:57.017100Z

> locally I can get exception: “Exception: clojure.lang.ExceptionInfo: Kaocha ClojureScript client failed connecting back.” This is a generic error which means something went wrong on the cljs repl side.

2020-01-15T10:00:47.017700Z

how can I debug this?

2020-01-15T10:03:06.019600Z

I found debug section in README. will give it a try

plexus 2020-01-15T10:03:19.019900Z

there's some info in the kaocha-cljs README about getting more debugging information, this may yield some useful information, but likely it won't. the truth is that the node repl-env provides very little help when things go wrong. e.g. if node outputs an error message before the repl is fully initialized then that just gets swallowed.

2020-01-15T10:03:57.020300Z

this is something:

Compile sources, elapsed time: 68.163645 msecs
[goog.require could not find: kaocha_cljs_problem.core

ReferenceError: cljs is not defined
    at Socket.<anonymous> ([stdin]:89:28)
    at Socket.emit (events.js:209:13)
    at Socket.emit (domain.js:476:20)
    at addChunk (_stream_readable.js:305:12)
    at readableAddChunk (_stream_readable.js:282:13)
    at Socket.push (_stream_readable.js:220:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:182:23)
    at Domain.<anonymous> ([stdin]:50:21)
    at Domain.emit (events.js:209:13)
    at Domain.emit (domain.js:476:20)

plexus 2020-01-15T10:05:57.021100Z

it is... I would have to poke at the node repl-env implementation to even begin to get an idea of where that could be coming from

plexus 2020-01-15T10:09:08.023Z

sorry, I don't have a ton of bandwidth for this right now, but I'm happy to answer questions if you want to continue to dig into it. Kaocha relies on the cljs repl abstraction, and these have turned out to be hard to troubleshoot when things go wrong, and we might have to either reconsider our approach in the future, or take ownership of these repl-env implementations (i.e. fork them) to provide better instrumentation

2020-01-15T10:11:14.023500Z

no worries, I will try to investigate more

2020-01-15T10:21:40.024900Z

[#:cljs{:compiler-options {:output-dir out, :closure-warnings {:check-types :off, :check-variables :off}, :closure-defines {kaocha.type.cljs.log_level DEBUG, kaocha.type.cljs.root_log_level DEBUG, cljs.core._STAR_target_STAR_ nodejs}, :ups-libs nil, :cache-analysis true, :closure-module-roots [], :optimizations :none, :ups-foreign-libs [], :aot-cache false, :ignore-js-module-exts [.css], :preamble [cljs/imul.js], :ups-externs nil, :opts-cache cljsc_opts.edn, :source-map true, :cache-analysis-format :transit, :target :nodejs, :emit-constants nil}}
EVAL:  (require (quote kaocha.cljs.websocket-client) (quote kaocha.cljs.run))
EVAL:  ((fn wait-for-websocket-client [] (if (exists? kaocha.cljs.websocket-client) (kaocha.cljs.websocket-client/connect! 57105) (js/setTimeout wait-for-websocket-client 50))))
EVAL:  :require-websocket-client-done8287
:cljs/err -> {:val "WARNING: Use of undeclared Var goog.debug.LogBuffer/CAPACITY at line 45 .cljs_node_repl/lambdaisland/glogi/console.cljs\n", :type :cljs/err}
WARNING: Use of undeclared Var goog.debug.LogBuffer/CAPACITY at line 45 .cljs_node_repl/lambdaisland/glogi/console.cljs

:cljs/err -> {:val "TypeError: Cannot read property 'error__GT_str' of undefined\n    at Socket.<anonymous> ([stdin]:89:28)\n    at Socket.emit (events.js:209:13)\n    at Socket.emit (domain.js:476:20)\n    at addChunk (_stream_readable.js:305:12)\n    at readableAddChunk (_stream_readable.js:282:13)\n    at Socket.push (_stream_readable.js:220:10)\n    at TCP.onStreamRead (internal/stream_base_commons.js:182:23)\n    at Domain.<anonymous> ([stdin]:50:21)\n    at Domain.emit (events.js:209:13)\n    at Domain.emit (domain.js:476:20)\n", :type :cljs/err}
TypeError: Cannot read property 'error__GT_str' of undefined
    at Socket.<anonymous> ([stdin]:89:28)
    at Socket.emit (events.js:209:13)
    at Socket.emit (domain.js:476:20)
    at addChunk (_stream_readable.js:305:12)
    at readableAddChunk (_stream_readable.js:282:13)
    at Socket.push (_stream_readable.js:220:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:182:23)
    at Domain.<anonymous> ([stdin]:50:21)
    at Domain.emit (events.js:209:13)
    at Domain.emit (domain.js:476:20)

EVAL:  :cljs/quit
E]
More errors) 1. Looks like client did not try to exit when :cljs/quit evaluated 2. “Cannot read property ‘error__GT_str’” this looks like main problem, but I’m not sure where does it comming from

plexus 2020-01-15T10:44:20.026Z

ok, I need to investigate this. @s_zharinov pointed out something similar. I wonder if it's a regression in a recent release, or if it has to do with the clojurescript version

2020-01-15T11:00:01.027600Z

quick investigation gives me that with clojurescript “1.10.520” :cljs/quit shuts down main process. “1.10.597" runs forever even when :cljs/quit fired

👀 1
2020-01-15T11:00:44.028300Z

also extra warning appears in logs:

:cljs/err -> {:val "WARNING: Use of undeclared Var goog.debug.LogBuffer/CAPACITY at line 45 .cljs_node_repl/lambdaisland/glogi/console.cljs\n", :type :cljs/err}
WARNING: Use of undeclared Var goog.debug.LogBuffer/CAPACITY at line 45 .cljs_node_repl/lambdaisland/glogi/console.cljs