use a hook @nwjsmith, see https://cljdoc.org/d/lambdaisland/kaocha/0.0-549/doc/plugin-hooks
the available hooks are described here https://cljdoc.org/d/lambdaisland/kaocha/0.0-554/doc/9-extending#extension-types , a pre-load hook should do the trick
what error are you getting @regen?
[E]
Randomized with --seed 882414531
ERROR in unit-cljs (form-init8023564777555120058.clj:1)
Unexpected error executing kaocha-cljs test suite.
Exception: clojure.lang.ExceptionInfo: Kaocha ClojureScript client failed connecting back.
{:kaocha.testable/id :unit-cljs, :cljs/repl-env cljs.repl.browser/repl-env, :cljs/compiler-options {}}
at kaocha.type.cljs$eval6752$fn__6754$fn__6768.invoke (cljs.clj:274)
kaocha.type.cljs$queue_consumer.invokeStatic (cljs.clj:181)
kaocha.type.cljs$queue_consumer.invoke (cljs.clj:173)
kaocha.type.cljs$eval6752$fn__6754.invoke (cljs.clj:252)
...
kaocha.plugin.capture_output$capture_output_wrap_run_hook$fn__2634$fn__2635.invoke (capture_output.clj:83)
...
kaocha.plugin.capture_output$capture_output_wrap_run_hook$fn__2634.doInvoke (capture_output.clj:83)
...
kaocha.testable$run.invokeStatic (testable.clj:119)
kaocha.testable$run.invoke (testable.clj:110)
...
kaocha.testable$run_testable.invokeStatic (testable.clj:189)
kaocha.testable$run_testable.invoke (testable.clj:148)
kaocha.testable$run_testables.invokeStatic (testable.clj:202)
kaocha.testable$run_testables.invoke (testable.clj:192)
kaocha.api$run$fn__3129$fn__3130$fn__3131.invoke (api.clj:106)
...
kaocha.api$run$fn__3129$fn__3130.invoke (api.clj:98)
...
kaocha.api$run$fn__3129.invoke (api.clj:97)
...
kaocha.api$run.invokeStatic (api.clj:83)
kaocha.api$run.invoke (api.clj:71)
kaocha.runner$run.invokeStatic (runner.clj:128)
kaocha.runner$run.invoke (runner.clj:70)
kaocha.runner$_main_STAR_.invokeStatic (runner.clj:161)
kaocha.runner$_main_STAR_.doInvoke (runner.clj:140)
...
kaocha.runner$_main.invokeStatic (runner.clj:172)
kaocha.runner$_main.doInvoke (runner.clj:170)
...
user$eval140.invokeStatic (form-init8023564777555120058.clj:1)
user$eval140.invoke (form-init8023564777555120058.clj:1)
...
0 tests, 1 assertions, 1 errors, 0 failures.
Error encountered performing task 'run' with profile(s): 'base,system,user,provided,dev,kaocha'
Suppressed exit
#kaocha/v1
{:tests [{:id :unit-cljs
:type :kaocha.type/cljs
:test-paths ["test/cljs"]
:cljs/repl-env cljs.repl.browser/repl-env
:bindings {:kaocha.cljs.type/*debug* true}
:capture-output? false
:cljs/timeout 20000}]}
It's set up in leiningen following the kaocha and kaocha-cljs README.
java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.5 LTS"
If I add xvfb-run
when I invoke lein kaocha
or bin/kaocha
it will fail to connect with the same error, although it does manage to start firefox.
$ ps auxw | grep -i firefox
travis 4514 3.6 0.6 2740144 220648 pts/1 Sl 09:06 0:02 firefox <http://localhost:9000?rel=1571389573994>
travis 4571 1.6 0.4 2599076 141576 pts/1 Sl 09:06 0:01 /usr/local/firefox-56.0.2/firefox-bin -contentproc -childID 1 -isForBrowser -prefsLen 1 -prefMapSize 196655 -parentBuildID 20191009172106 -greomni /usr/local/firefox-56.0.2/omni.ja -appomni /usr/local/firefox-56.0.2/browser/omni.ja -appdir /usr/local/firefox-56.0.2/browser 4514 true tab
travis 4628 0.5 0.2 2522396 75228 pts/1 Sl 09:06 0:00 /usr/local/firefox-56.0.2/firefox-bin -contentproc -childID 2 -isForBrowser -prefsLen 6164 -prefMapSize 196655 -parentBuildID 20191009172106 -greomni /usr/local/firefox-56.0.2/omni.ja -appomni /usr/local/firefox-56.0.2/browser/omni.ja -appdir /usr/local/firefox-56.0.2/browser 4514 true tab
travis 4794 0.1 0.1 2495900 53380 pts/1 Sl 09:06 0:00 /usr/local/firefox-56.0.2/firefox-bin -contentproc -childID 3 -isForBrowser -prefsLen 6832 -prefMapSize 196655 -parentBuildID 20191009172106 -greomni /usr/local/firefox-56.0.2/omni.ja -appomni /usr/local/firefox-56.0.2/browser/omni.ja -appdir /usr/local/firefox-56.0.2/browser 4514 true tab
travis 4838 0.0 0.0 21280 2292 pts/1 S+ 09:07 0:00 grep -i firefox
Dependencies are all latest
[org.clojure/clojurescript "1.10.520"]
[lambdaisland/kaocha "0.0-554"]
[lambdaisland/kaocha-cljs "0.0-59"]
If you manage to get Firefox to start then that's already pretty good. I did done digging into an issue people were having when trying to run on CI, but I don't think this is what you're seeing https://github.com/lambdaisland/kaocha-cljs/issues/14#issuecomment-530334119
Have you tried setting the timeout really high? Maybe it's just timing out...
Yea, it seems like browse-url
works fine for me:
$ xvfb-run clojure
Clojure 1.10.1
user=> (clojure.java.browse/browse-url "<https://www.clojure.org>")
$ ps auxw | grep -i firefox
travis 8148 2.7 0.6 2791692 206292 pts/2 Sl+ 11:01 0:03 firefox <https://www.clojure.org>
I set the timeout very high and have waited 5 minutes so far, but no action. ]=
Are you running with debugging on and output capturing off as described in the Kaocha-cljs readme? Might be something useful in there
Yes, but for some reason I'm not getting any more output than what I posted above.