bbin icon indicating copy to clipboard operation
bbin copied to clipboard

Enable running most of bbin's test suite on a JVM

Open teodorlu opened this issue 1 year ago • 5 comments

This PR enables a JVM-based workflow. The tests that pass without modification on a JVM can now be run on a JVM. The tests that fail on JVM only run on Babashka (for now).

In addition, test data has been updated to reflect the reality - per 2024-11-27, the latest version of org.babashka/http-server is 0.1.13.

Please answer the following questions and leave the below in as part of your PR.

teodorlu avatar Nov 27 '24 22:11 teodorlu

In addition to the comments in the diff, I added Kaocha and Launchpad. I did that mostly out of habit, I like using the tools.

Thoughts? Do you prefer staying "leaner" with regards to tooling?

I added Launchpad to bb.edn. If that will cause Launchpad to be added to bbin user machines, it's behavior we maybe don't want.

teodorlu avatar Nov 27 '24 22:11 teodorlu

From @borkdude on Slack:

can we get rid of those bin/ scripts and add those commands to bb tasks and swap koacha for the cognitect test runner, unless you're very attached to koacha? (edited)

https://clojurians.slack.com/archives/C02FBBU61A9/p1732745453495049?thread_ts=1732744901.186879&cid=C02FBBU61A9

teodorlu avatar Nov 27 '24 22:11 teodorlu

I've removed Kaocha and Launchpad.

I like using Kaocha from within my Emacs, but I can load Kaocha with clojure.repl.deps/add-lib anyway — no reason to have two test runners (and possible confusion) in this project because of that. We do want the cognitect test runner to run tests on Babashka anyway.

As for Launchpad: Adding a Launchpad dep to bb.edn would cause everyone using bbin to have to download Launchpad, and I don't want that.


I still have to set up a deps.edn alias to run the tests with cognitect-test-runner on the JVM, and ensure it runs smoothly.

teodorlu avatar Jan 03 '25 12:01 teodorlu

@borkdude I think we're mostly there, but I'd like your thoughts on the tests that are failing in CI: https://github.com/teodorlu/bbin/actions/runs/12601558300/job/35122890533

My observations:

  1. I run local tests on bb (bb test) and on JVM (bb test:clj), all tests are green.
  2. I think I'm doing the same thing in CI, but in CI some of the tests are red on JVM.

It would also be helpful to know you get the CI behavior locally (red) or as I do (green).

teodorlu avatar Jan 03 '25 17:01 teodorlu

Local development was the motivation for getting the test suite running on a JVM, so CI might not be needed for now.

teodorlu avatar Jan 05 '25 11:01 teodorlu