This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-04
Channels
- # announcements (5)
- # aws (11)
- # babashka (15)
- # beginners (101)
- # biff (14)
- # calva (45)
- # clj-kondo (18)
- # cljs-dev (5)
- # clojure (178)
- # clojure-austin (5)
- # clojure-europe (8)
- # clojure-france (1)
- # clojure-nl (12)
- # clojure-norway (6)
- # clojure-spec (4)
- # clojure-uk (1)
- # clojurescript (13)
- # community-development (2)
- # conjure (6)
- # cursive (8)
- # datahike (1)
- # datalevin (3)
- # datascript (36)
- # datomic (6)
- # emacs (2)
- # etaoin (2)
- # fulcro (5)
- # graalvm (6)
- # gratitude (3)
- # introduce-yourself (1)
- # jobs-discuss (1)
- # lsp (19)
- # malli (4)
- # nbb (11)
- # off-topic (4)
- # other-languages (1)
- # pathom (19)
- # pedestal (1)
- # shadow-cljs (22)
- # spacemacs (16)
- # tools-deps (31)
- # vim (7)
Q: I’m running node tests using the instructions here: https://shadow-cljs.github.io/docs/UsersGuide.html#target-node-test when run via the node process they return a non-zero exit code as expected on my laptop. When I run in CI (bitbucket) i.e. docker, the same command returns zero even when the tests report failures. Has anyone seen this before?
Here’s the CLI command….
npx shadow-cljs -A:cljs:git-deps:test compile test-ci && node cljs-out/test-ci/node-tests.js
and the config
{:target :node-test
:compiler-options {:optimizations :whitespace}
:output-to "cljs-out/test-ci/node-tests.js"
;:ns-regexp "^\b([a-z\\-]+)\b(?<!render|ignoreme)-test"
; cannot use autorun if return code is needed. see shadow docs link above
:autorun true}
@thheller if there’s nothing obvious then I’ll try a local docker repro next. I’d guess its a docker env problem. CI is often painful
I'm also not a docker expert or any container expert. so no idea what the rules of those even are and if they even check error codes
@thheller I got to the bottom of this one. I was using node fs/mkdirSync and that was failing in CI (not on localhost). If an fs/foo call throws an exception, the return code from the tests is zero. once I fixed the fs call, the tests properly returned non-zero for actual test fails
I’m running a chain of promises and the fs fail is in the last one. maybe that’s the key? I’m using promesa for the chain
Same exact cli command. Since ci is Docker I will try local docker to try and reproduce
I'll put the invocations in a thread tomorrow for you to verify. A bit late here now
Funny story... I keep raving about how excited I am at work about Shadow Grove. So a colleague mailed me a Shadow Grove T-Shirt. Apparently it's a brewery near him! Gotta get you one of these, @thheller
I would totally buy a shadow cljs shirt.
If you had to generate an index.html before starting your shadow app is there some configuration for that or do i just just run that logic then shadow server functions like (server/start!). I have to imagine it's the latter.