This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-31
Channels
- # announcements (2)
- # babashka (145)
- # beginners (260)
- # calva (17)
- # chlorine-clover (7)
- # clj-kondo (9)
- # cljsrn (1)
- # clojure (88)
- # clojure-dev (65)
- # clojure-europe (31)
- # clojure-france (4)
- # clojure-nl (4)
- # clojure-uk (61)
- # clojuredesign-podcast (1)
- # clojurescript (31)
- # code-reviews (1)
- # cursive (32)
- # data-science (2)
- # datascript (9)
- # datomic (39)
- # docker (3)
- # events (1)
- # figwheel (95)
- # figwheel-main (4)
- # fulcro (17)
- # kaocha (2)
- # keechma (1)
- # malli (1)
- # meander (35)
- # nrepl (4)
- # off-topic (1)
- # pathom (8)
- # re-frame (4)
- # reagent (8)
- # reitit (3)
- # releases (1)
- # remote-jobs (2)
- # shadow-cljs (182)
- # sql (30)
- # tools-deps (89)
- # xtdb (31)
hi, i'm using figwheel-main with deps.edn and trying to get command line tests working with the standard test_runner. I am getting an error that it cannot find my test-runner even though i have "test" as an "extra-paths" and the filename has an underscore where the hyphen is.
here is my deps.edn snippet:
:test {:extra-paths ["test"]
:main-opts ["-m" "figwheel.main" "-m" redacted.test-runner]
@johanatan that error is strange it says redacted.test-runner/redacted.test-runner
i change the deps.edn to be: redacted.test-runnerzzz and the zzz was repeated on both sides
i.e., it's definitely getting that token just from the deps.edn (i moved the test.cljs.edn out of the way and it isn't referenced via -co anyway)
here's the full output:
12:07 $ clj -A:test
2020-07-31 12:07:54.932:INFO::main: Logging initialized @6157ms to org.eclipse.jetty.util.log.StdErrLog
Unexpected error (IllegalArgumentException) compiling at (REPL:1).
Namespace redacted.test-runner/redacted.test-runner does not exist. Please check that namespaces with dashes use underscores in the ClojureScript file name.
Full report at:
/var/folders/jz/920rhb8h8xj864001s7_grh80000gn/T/clojure-5208612209110040008.edn
12:08 $ cat test/redacted/test_runner.cljs
ββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β File: test/redacted/test_runner.cljs
ββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
1 β ;; This test runner is intended to be run from the command line
2 β (ns redacted.test-runner
3 β (:require
4 β ;; require all the namespaces that you want to test
5 β [redacted.proj.spec-tests]
6 β [figwheel.main.testing :refer [run-tests-async]]))
7 β
8 β (defn -main [& args]
9 β (run-tests-async 5000))
ββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
@johanatan hmm I just generated a figwheel.main project and the test runner ran just fine
hmm, what else are we missing? is there some other input here that I haven't yet shared ?
here are my deps:
{org.clojure/clojure {:mvn/version "1.10.1"}
org.clojure/clojurescript {:mvn/version "1.10.597"}
devcards {:mvn/version "0.2.6"}
reagent {:mvn/version "0.8.1"}
re-frame {:mvn/version "0.10.8"}
re-com {:mvn/version "2.6.0"}
cljsjs/react {:mvn/version "16.8.4-0"}
cljsjs/react-dom {:mvn/version "16.8.4-0"}
cljsjs/react-popper {:mvn/version "1.0.2-0"}
cljsjs/react-transition-group {:mvn/version "4.3.0-0"}
com.andrewmcveigh/cljs-time {:mvn/version "0.5.2"}
com.gfredericks/test.chuck {:mvn/version "0.2.10"}
org.clojure/test.check {:mvn/version "0.10.0"}
clj-commons/secretary {:mvn/version "1.2.4"}
com.rpl/specter {:mvn/version "1.1.2"}
com.gfredericks/exact {:mvn/version "0.1.11"}
hiccup {:mvn/version "2.0.0-alpha2"}
precise {:mvn/version "0.1.0"}
camel-snake-kebab {:mvn/version "0.4.0"}
org.clojure/core.match {:mvn/version "0.3.0"}
{:mvn/version "1.3.0"}
funcool/promesa {:mvn/version "3.0.0"}
prismatic/schema {:mvn/version "1.1.12"}
com.bhauman/figwheel-main {:mvn/version "0.2.3"}
com.bhauman/rebel-readline {:mvn/version "0.1.4"}
com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"}
nrepl/nrepl {:mvn/version "0.6.0"}
cider/cider-nrepl {:mvn/version "0.22.1"}
cider/piggieback {:mvn/version "0.4.1"}
akiroz.re-frame/storage {:mvn/version "0.1.4"}
testdouble/clojurescript.csv {:mvn/version "0.4.5"}
cljsjs/proj4 {:mvn/version "2.5.0-0"}
day8.re-frame/http-fx {:mvn/version "0.1.6"}
re-frame-utils {:mvn/version "0.1.0"}
day8.re-frame/re-frame-10x {:mvn/version "0.4.2"}}
and have had this problem for 6 months at least. just now getting around to trying to diagnose it
Error in command line args
-- Spec failed --------------------
["-m" "redacted.test-runner/redacted.test-runner"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
should be a CLJS namespace available on the classpath
__ Doc for -m --main _____
Call the -main function from a namespace with args
-------------------------
Detected 1 error
12:28 $ clojure -m figwheel.main -m redacted.test-runner
2020-07-31 12:28:31.570:INFO::main: Logging initialized @6269ms to org.eclipse.jetty.util.log.StdErrLog
Unexpected error (IllegalArgumentException) compiling at (REPL:1).
Namespace redacted.test-runner does not exist. Please check that namespaces with dashes use underscores in the ClojureScript file name.
Full report at:
/var/folders/jz/920rhb8h8xj864001s7_grh80000gn/T/clojure-6073873970012598693.edn
@johanatan if you create an alias to just add the test path it should work
how do we prevent the "eval timed out!" error? my tests successfully run (based on output i'm seeing in the browser's console log) but i always get the following error in the actual command line:
13:10 $ clj -A:test
2020-07-31 13:10:22.336:INFO::main: Logging initialized @5506ms to org.eclipse.jetty.util.log.StdErrLog
[Figwheel] Validating figwheel-main.edn
[Figwheel] figwheel-main.edn is valid \(γ)/
[Figwheel] Compiling build test to "target/public/cljs-out/test-main.js"
[Figwheel] Successfully compiled build test to "target/public/cljs-out/test-main.js" in 14.239 seconds.
Opening URL
Eval timed out!
No stacktrace available.
Execution error (ExceptionInfo) at cljs.repl/evaluate-form (repl.cljc:578).
Eval timed out!
Full report at:
/var/folders/jz/920rhb8h8xj864001s7_grh80000gn/T/clojure-2697828571253767923.edn
(i tried both run-tests
and run-test-async
[the latter with a very high timeout value])
@johanatan you have to give it a bigger timeout!
@johanatan there is a :repl-eval-timeout that you can set in figwheel options