Skip to content

Commit a249801

Browse files
committed
libs tests: tweak update lein deps skill lib
On a run on my dev box, I noticed the tests for this lib were failing but the failure was not being detected by the libs tests script. The recommended way to run tests for this lib always exits with 0, even when tests fail. We now run the tests a second time via node, which will exit with non-zero on failure. The reason this test was failing on my dev box was because I had selected GraalVM via SDKman as my java. This includes a version of node under GraalVM which caused the failure.
1 parent 2eb2845 commit a249801

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

script/libs_tests.clj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,9 @@
244244

245245
(defn- update-leiningen-dependencies-skill-prep [{:keys [home-dir]}]
246246
(status/line :detail "=> Installing node deps")
247-
(shcmd ["npm" "ci"] {:dir home-dir}))
247+
(shcmd ["npm" "ci"] {:dir home-dir})
248+
(status/line :detail "=> Running tests as recommended, but this cmd always exits with 0, so consider this a prep step")
249+
(shcmd ["npm" "run" "test"] {:dir home-dir}))
248250

249251
;;
250252
;; zprint
@@ -359,7 +361,8 @@
359361
:patch-fn update-leiningen-dependencies-skill-patch
360362
:prep-fn update-leiningen-dependencies-skill-prep
361363
:show-deps-fn cli-deps-tree
362-
:test-cmds [["npm" "run" "test"]]}
364+
:test-cmds [;; running tests a 2nd time via node to get non-zero exit code on failure
365+
["node" "tests.js"]]}
363366
{:name "zprint"
364367
:version "1.1.1"
365368
:platforms [:clj :cljs]

0 commit comments

Comments
 (0)