This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-21
Channels
- # announcements (10)
- # aws (10)
- # babashka (23)
- # beginners (111)
- # biff (8)
- # calva (25)
- # clj-kondo (9)
- # cljsrn (4)
- # clojure (72)
- # clojure-belgium (6)
- # clojure-europe (50)
- # clojure-germany (2)
- # clojure-nl (1)
- # clojure-norway (6)
- # clojure-uk (1)
- # datahike (3)
- # emacs (10)
- # graalvm (19)
- # graphql (3)
- # juxt (7)
- # kaocha (9)
- # malli (23)
- # nbb (20)
- # pathom (17)
- # pedestal (6)
- # polylith (11)
- # portal (8)
- # remote-jobs (3)
- # shadow-cljs (18)
- # sql (3)
- # tools-deps (20)
{...
:tasks
{-install-ws {:doc "Ensure ws is installed for koacha-cljs."
:task ws/-main}
test-bb {:doc "Run tests using Babashka"
:requires ([cognitect.test-runner :as runner])
:task ((apply runner/-main "-d" "test" *command-line-args*))}
test-clj {:doc "Run tests using Clojure"
:task (clojure "-M:test:runner" "clj")}
test-cljs {:doc "Run tests using ClojureScript"
:depends [-install-ws]
:task (clojure "-M:test:runner" "cljs")}
test {:doc "Run all tests"
:depends [test-clj test-cljs test-bb]}}}
If I run bb test
, it runs all 3 test suites in specified order.
But if in test/depends
I swap the order, to put test-bb
first, then any tasks listed after it do not run.
Or if I run bb run --parallel test
,then again only test-bb
runs, exiting long before the JVM has time to start up for the other tasks.You can probably call this function instead: https://github.com/cognitect-labs/test-runner/blob/7284cda41fb9edc0f3bc6b6185cfb7138fc8a023/src/cognitect/test_runner/api.clj#L16
Problem is that takes away all the infrastructure around picking test suites to run. But I'm just going to ignore that for now. It's plenty fast enough for this project to just run every BB test every time.
@U90R0EPHA You can do this:
(merge default-opts (babashka.cli/parse-args *commmand-line-args*))
I've made a babashka cli wrapper around test-runner here: https://github.com/babashka/cli/blob/main/test/babashka/test_runner.clj
and then options on the command line will be parsed accordingly and passed to the API function
So this basically:
{:tasks {test:bb {:extra-paths ["test"]
:extra-deps {io.github.cognitect-labs/test-runner
{:git/tag "v0.5.1" :git/sha "dfb30dd"}}
:task (exec 'cognitect.test-runner.api/test)
:exec-args {:dirs ["test"]}
:org.babashka/cli {:coerce {:nses [:symbol]
:vars [:symbol]}}}}}
Say I have a big repo, with some subfoloders made up of babashka tasks we've written, each in their own subfolder with their own bb.edn. Would it be possible somehow to make a root bb.edn I can expose as a Git dependency, with each of the subfolders as local dependencies? I've attempted to set this up but I found that :local/root
/`:local/deps` didn't work because they wouldn't find the bb.edn files. Is this even a good idea, or would I be better just reorganizing things around a single shared bb.edn?
Is there any special way to call out to a task from a script or from a task function? or should I just shell out to calling bb?
Trying to use pod-babashka-fswatcher
, but every file save triggers 4 duplicate :write
events. Is this common and/or expected?