This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-20
Channels
- # announcements (3)
- # babashka (74)
- # beginners (45)
- # biff (3)
- # calva (10)
- # cherry (1)
- # clojure (7)
- # clojure-austin (4)
- # clojure-europe (50)
- # clojure-losangeles (1)
- # clojure-nl (1)
- # clojure-norway (22)
- # clojure-uk (3)
- # cursive (14)
- # data-science (2)
- # datomic (1)
- # emacs (3)
- # events (5)
- # fulcro (5)
- # holy-lambda (64)
- # hyperfiddle (67)
- # introduce-yourself (1)
- # lsp (5)
- # off-topic (1)
- # rdf (1)
- # re-frame (5)
- # reitit (4)
- # releases (3)
- # shadow-cljs (89)
- # spacemacs (4)
- # squint (5)
- # timbre (9)
- # tools-deps (2)
I’m using tools-deps-native to slurp a deps.edn (`slurp-deps`), and then create a basis for a project. The deps-maps is read “correctly”, but basis is always from the current working directory. I’m not sure if this is a bug, or the expected behavior.
I start Babashka as a subprocess of my editor; cwd is where my Babashka project is, but I’m trying to read the classpath, using tools-deps-native, from a different directory (based on deps-map).
Hm..good question. I haven’t tried because I’m using from Babashka.
Does it sound reasonable to you what I’m trying to do? Starting Babashka from its ‘project directory’, and then using tools-deps-native to analyze other projects (in different directories).
perhaps you want to use https://github.com/babashka/tools.bbuild which supports *project-dir*
, see API docs from tools.build
https://clojure.github.io/tools.build/clojure.tools.build.api.html#var-*project-root*
Awesome! I will have a look.
I’m doing a strange experiment 😅 Using Babashka to interface with clj-kondo to analyze a project, persist the analyzes data as JSON files, and query analysis data (JSON files) with DuckDB. It’s an experimental branch of my SublimeText plugin.
What people around here are using bb on an intel Mac? Someone reported that the newer versions stopped working on older macOS versions. This is probably because I'm using a too new xcode version (15). I downgraded xcode in a branch to 12.something and the binary started working again for him. But I want to know if that binary still works for people here. Please test this binary if you're into this target audience: https://output.circle-artifacts.com/output/job/bb481147-ec43-4f0c-896f-9a5008679897/artifacts/0/release/babashka-1.3.189-SNAPSHOT-macos-amd64.tar.gz
The macos version is something like 10.12 or 12.7.2, etc. You can find this in "About my Mac"
Hello there I need help with Babashka testing So i have a script "test-notify-tag.clj" and this script is in test directory which is inside bb directory bb directory have bb.edn file as usual I tried multiple research and help of ChatGPT to run test using bb test command but seem to fail. Edited edn so many times that now i feel lost Can someone help me with bb test ? or link or reference ? To set up?
can you post any output/stacktraces of what happens when it "seems to fail", along with the command that you run to test it?
alright. So i found one blog:
https://blog.michielborkent.nl/babashka-test-runner.html
Before this blog:
i run command
bb test
Error Couldn't find test file
Just now, after reading this blog. i updated my edn file to this:
and it shows 0 test ran
{:paths ["bb" "."]
:deps {}
: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]}}}}}
Terminal output:
Running tests in #{"test"}
Testing exec-34ac8f70-b8ff-4aa4-bfa1-c475a662c238
Ran 0 tests containing 0 assertions.
0 failures, 0 errors.
so test file name is test-notify-tag.clj And this file is inside test directory bb/test/test-notify-tag.clj edn file is inside bb
If you add :paths ["test"]
this isn't adding bb/test
to the classpath, but only test
so rectified edn file would be:
{:paths ["bb" "."]
:deps {}
:tasks
{test:bb {:extra-paths ["bb/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]}}}}}
is it true?
amm cant we segregate all test files somehow inside bb?
of course you can, but the classpath works the same way as in normal Clojure. If you don't know about that, perhaps ask around in #C053AK3F9 to see how it works
noted
i got you! Not so cleaner. Mentioning bb and also adding a folder which exist inside bb
amm aint sure why it still says 0 test ran.
It would be better if you could share your project on Github or at least a reproduction of your problem, else it's really hard to make sense of it
i can understand terminal logs: PS H:\Iroh\Devops\bb> bb test:bb Running tests in #{"test"} Testing exec-f3fecdbd-ec08-42cd-bf1e-0a92cf0a6269 Ran 0 tests containing 0 assertions. 0 failures, 0 errors.
Two potential problems: Don't use hyphens in your file name: rename to:
test_notify_tag.clj
Also for the test runner you need to add the bb/test
directory to the test directories
See
:dirs
here:
https://github.com/cognitect-labs/test-runnerupdated
(ns test-notify-tag
(:require [clojure.test :refer [deftest is testing]]))
file name now is test_notify_tag.clj
edn updated:
{:paths ["bb" "."]
:deps {}
: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"]}
:dirs ["bb/test"]
:org.babashka/cli {:coerce {:nses [:symbol]
:vars [:symbol]}}}}}
is it good?
i think you meant to add dirs
ok. I am gonna again attach updated stuff Cause runner says:
PS H:\Iroh\Devops\bb> bb test:bb
Running tests in #{"bb/test"}
Testing exec-c6db8cdf-d116-4bda-89b2-750d8d19507b
Ran 0 tests containing 0 assertions.
0 failures, 0 errors.
Added and also updated file name
:dirs
you wanna say try "bb\\test" as command?
path name! that makes sense
well, still same logs. 0 test ran
I have required clojure.test and even defined test with deftest
share your code on github (or a similar repro) and I'll have a look. it's really difficult to diagnose this problem without looking at the specific code
i'll do that. rn
does this help? https://github.com/hanisha27/BabashkaTest
Change bb.edn to this:
{:paths ["."]
:deps {}
: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)
:dirs ["test"]
:org.babashka/cli {:coerce {:nses [:symbol]
:vars [:symbol]}}}}}
and then bb test:bb
:
Running tests in #{"test"}
Testing notify-tag-test
Ran 1 tests containing 4 assertions.
0 failures, 0 errors.
this worked! thanks! again
this all makes sense! update in the path and dirs