This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-13
Channels
- # aleph (16)
- # announcements (8)
- # aws (5)
- # babashka (54)
- # beginners (48)
- # calva (7)
- # cider (7)
- # clojure (209)
- # clojure-brasil (4)
- # clojure-europe (20)
- # clojure-italy (12)
- # clojure-nl (21)
- # clojure-uk (69)
- # clojurescript (24)
- # cursive (11)
- # datascript (7)
- # datomic (47)
- # emacs (14)
- # graphql (20)
- # hoplon (25)
- # jobs (1)
- # kaocha (1)
- # leiningen (14)
- # meander (7)
- # off-topic (44)
- # other-languages (1)
- # pathom (20)
- # re-frame (2)
- # reagent (51)
- # reitit (3)
- # remote-jobs (1)
- # shadow-cljs (46)
- # spacemacs (5)
- # sql (65)
- # tools-deps (86)
- # vim (11)
I noticed a couple of strange things, first that when I do
shadow-cljs compile test && node out/node-tests.js
already with the first step the test actually run
even if according to the doc they should only run when you execute them with node
the other thing is that in CI even if there are test failures it's always reported as success, which I suspect means it's not returning something different from 0?
ah yes I do have autorun
maybe I need two different profiles then? autorun is useful I guess while doing local dev
CI systems are known for killing the shadow-cljs JVM when it starts consuming too much memory, so you may need to restrict it to less memory. see https://shadow-cljs.github.io/docs/UsersGuide.html#jvm-opts
ah no I don't think that's the rason
it is definitively finishing normally
let's see if that maybe fixes the return code problem as well
uhm no
~/p/p/footy (fix-test-run|…) $
shadow-cljs compile test --config-merge "{:autorun false}" && node out/node-tests.js
shadow-cljs - config: /Users/acrotti/projects/personal/footy/shadow-cljs.edn cli version: 2.8.83 node: v13.10.1
shadow-cljs - connected to server
NPM dependency "react" has installed version "^16.12.0"
"16.8.6" was required by jar:file:/Users/acrotti/.m2/repository/re-frame/re-frame/0.10.9/re-frame-0.10.9.jar!/deps.cljs
NPM dependency "react-dom" has installed version "^16.12.0"
"16.8.6" was required by jar:file:/Users/acrotti/.m2/repository/re-frame/re-frame/0.10.9/re-frame-0.10.9.jar!/deps.cljs
[:test] Compiling ...
[:test] Build completed. (175 files, 1 compiled, 0 warnings, 0.56s)
c
Testing footy.handlers-test
Games = [:footy.handlers/games]
^R
e
FAIL in (specs-test) (cljs-runtime/day8/re_frame/test.cljc:99:18)
expected: (db/valid-db? (clojure.core/deref games) (clojure.core/deref players-list))
actual: (not (db/valid-db? [:footy.handlers/games] [:footy.handlers/players-list]))
failed with args [:footy.handlers/failed {:uri /games.edn, :last-method GET, :last-error , :last-error-code 0, :debug-message No Error, :status 0, :status-text Request failed., :failure :failed}]
~/p/p/footy (fix-test-run|…) $ echo $status
0
so it always returns 0
I guess it's because it's not a real test runner it's just node?
dunno the default test runner should definitely be setting the exit code https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/test/node.cljs#L12
mm wait but
~/p/p/footy (fix-test-run|…) $ which node
/usr/local/bin//node
so should I be running the node from shadow-cljs?
but I don't know how much you are modifying the defaults, so if you override :runner-ns
for example it might not unless you hook it up correctly yourself
it's quite a trivial config
:test {:target :node-test
:output-to "out/node-tests.js"
:ns-regexp "-test$"
:autorun true}
but I see some re-frame testing ns ... dunno how that works. maybe it doesn't use the default testing stuff and never triggers that error
ah ok let me try if disabling the rf test and making another test fail works
ah yes that was it!
the rf test is just something like
(deftest specs-test
(testing "Game map is valid"
(rf-test/run-test-async
it was the async
run-test-sync works fine
makes sense I guess, I use it in another project though and I never noticed these issues
a different runner there though
thanks a lot @U05224H0W I was not suspecting that at all
just run things without &&
in 2 separate steps ... makes it easier to figure out which part is actually failing
Hi folks, I generate a package locally "toto-0.1.1.jar" and I would like to use it in a demo project. How can I configure "shadow-cljs.edn" to say to use my local package "toto-0.1.1.jar" instead of looking at any remote repositories?
run lein install
to install it in your local repo. shadow-cljs will use that without looking at any remotes, just add the dependency by its regular name