This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-19
Channels
- # aws (2)
- # babashka (4)
- # babashka-sci-dev (7)
- # beginners (92)
- # biff (7)
- # calva (64)
- # cider (2)
- # cljsrn (14)
- # clojure (8)
- # clojure-australia (5)
- # clojure-europe (14)
- # clojure-norway (8)
- # clojure-spec (36)
- # clojurescript (19)
- # component (15)
- # cursive (1)
- # data-science (6)
- # girouette (5)
- # hyperfiddle (3)
- # juxt (5)
- # leiningen (10)
- # lsp (7)
- # malli (12)
- # nbb (90)
- # polylith (1)
- # portal (11)
- # rdf (7)
- # reagent (6)
- # reitit (40)
- # remote-jobs (1)
- # shadow-cljs (21)
- # specter (5)
- # squint (83)
- # tools-deps (17)
- # vim (7)
We can pick this up after any vacations 🙂
-----
Hi! After hitting some friction working on tests for neil dep upgrade
, I figured that all I really wanted was to be able to run a few tests of my choice, not the whole test suite. So I gave it a shot.
Example invocation:
bb test-only tests/dep-search-help-test tests/dep-search-test
I've got an implementation that looks like it's working well.
;; bb.edn task:
test-only {:depends [gen-script]
:requires ([babashka.neil.test-runner])
:task (exec 'babashka.neil.test-runner/run-only)}
;; new function in babashka.neil.test-runner:
(defn run-only
{:org.babashka/cli {:coerce {:only [:symbol]}
:args->opts (repeat :only)}}
[{:keys [only]}]
(doseq [test-sym only]
(let [t (requiring-resolve test-sym)]
(assert t)
(t))))
WIP branch: https://github.com/teodorlu/neil/tree/test-onlyunrelated babashka/cli comment: exec
seems a bit arbitrarily mapped to something that relates to :org.babashka/cli
.
I would perhaps expect something like this in tasks.edn:
:tasks {:requires ([babashka.fs :as fs]
[clojure.string :as str]
[selmer.parser :as p]
[selmer.util :refer [without-escaping]]
[babashka/cli :as cli])
then
test-only {:depends [gen-script]
:requires ([babashka.neil.test-runner])
:task (cli/exec 'babashka.neil.test-runner/run-only)}
. But now there's a public API, so keeping it as-is might be better. Not sure, others can be the judge of that.Just creating a new test namespace would also kind of solve the problem. Depends on how we want to encourage people working with tests, I guess.
If this is an addition we want, I can add it to the neil dep upgrade
PR, or create a separate PR.