lambdaisland / lambdaisland/kaocha
Prevent loading of namespaces that are skipped
Nobody has claimed this yet.
- Dominant language
- Clojure
- Stars
- 860
- Forks
- 81
- PR merge metrics
- No merged PRs in 30d
Description
Via @borkdude on Clojurians Slack
When using kaocha, is there an equivalent to -n from the cognitect test runner or :only from leiningen, from the command line?
nm, got it: https://cljdoc.org/d/lambdaisland/kaocha/1.0.632/doc/6-focusing-and-skipping#on-a-namespace
I'm trying to port this:clojure -A:test -n babashka.pods.jvm-test ;;=> clojure -A:test:kaocha --focus babashka.pods.jvm-testclojure -A:sci:test -n babashka.pods.sci-test ;;=> clojure -A:sci:test:kaocha --focus babashka.pods.sci-testThis one:
clojure -A:test:kaocha --focus babashka.pods.jvm-testdoesn't work, since the sci library is (deliberately!) not available on the classpath. The code should run without the library, which is part of my test.
With the Cognitest test runner or leiningen that works, but with kaocha it doesn't:$ clojure -A:test:kaocha --focus babashka.pods.jvm-test WARNING: :focus [:babashka.pods.jvm-test] did not match any tests. [E] Randomized with --seed 2027872620ERROR in unit (babashka/pods/sci.clj:1) Exception: clojure.lang.Compiler$CompilerException: Syntax error compiling at (babashka/pods/sci.clj:1:1). #:clojure.error{:phase :compile-syntax-check, :line 1, :column 1, :source "babashka/pods/sci.clj"}So my proposal would be that focus should not load files other than it needs.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing Kaocha's command-line --focus handling and the test namespace discovery/loading path; the issue provides the babashka.pods.jvm-test command as a reproduction. Run that focused command with the optional sci namespace unavailable, and consider the work done when skipped namespaces are not loaded and the focused test runs successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure
- Domain
- cli, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100