-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test support for exec
#131
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
New bb tasks: - clean - delete build work - test:bb - runs all tests under babashka - test:native - runs exec tests against native image of run_exec.clj - test:jvm - (renamed from test) runs non-exec tests under jvm clojure CI: - GitHub Actions updated to run native image tests - jobs renamed to match CircleCI naming convention - CircleCI was doing a subset of GitHub Actions work, it now is a full reflection. - added jdk install support in script/circle_ci.clj - bootstrapping CI to be able to run bb and then scripting in bb is much more pleasant/maintainable than scripting in bash+Powershell - used jdk install support even on linux, instead of trying to to select jdk via docker image. This made config cleaner, allowed for consitent jdk selection across OSes and had surprisingly little performance hit especially after caching jdks. - installing jdks via bb hugely more performant than doing so via brew/scoop/chocolatey - jdk download urls, and shas discovered by disco API. See: https://github.com/foojayio/discoapi - Both CIs are temporarily using a SHAPSHOT release of bb for `babashka.process/exec` reload support. We'll turf this after next release of babashka. Add `run_exec.clj` - a wee program to exercise `exec` - source and build support under ./test-native - includes script-adjacent `bb.edn` to suport running as a script and reloading sources instead of using babashka built-in babashka.process - specify `babashka.process.test.reload` system property to signal that `run_exec.clj` should reload `babashka.process` from sources when running from bb. - note: `test:native` task does not natively compile tests, it only natively compiles `run_exec.clj`. It launches natively compiled `run_exec.clj` via jvm clojure and observes results for correctness. Test utilities moved to `babashka.process.test-utils` so that they can be used by existing `babashka.process-test` and new: - `babashka.process-exec-test` - bb build scripts (specifically: test-native/bb.edn) Add :ps-me to wee dummy wd.clj to support `exec` arg0 testing for macOS and Linux. Add doc/dev.md with some relevant notes/pointers. Other changes: - deleted `script/test` bash script, it is replaced by bb tasks - we now look for bb first in current dir, then on path. This seems the safer way to choose bb when running babashka.process tests from babashka - tests now printing bb version to give confidence we are using the bb we want to be using Bugs found and fixed as a result of testing: - tests using java now understand that java executable path can contain spaces. - test using `javac` seem to be happier running `javac` from same dir as source - `exec` now converting `:env` and `:extra-env` keywords the same way `process` function do, see babashka#123 Closes babashka#117, Fixes babashka#123
Another biggie. Lemme know watcha think. After merge into babashka, we can adjust this: ;;;; babashka.process
;; test built-in babashka.process
(test-namespaces 'babashka.process-test)
;; test babashka.process from source
#_{:clj-kondo/ignore [:duplicate-require]}
(require '[babashka.process] :reload)
(test-namespaces 'babashka.process-test) To maybe something like this: ;;;; babashka.process
;; test built-in babashka.process
(test-namespaces 'babashka.process-test)
(when (= "native" (System/getenv "BABASHKA_TEST_ENV"))
;; test babashka.process from source
#_{:clj-kondo/ignore [:duplicate-require]}
(require '[babashka.process] :reload)
(System/setProperty "babashka.process.test.reload" "true")
(test-namespaces 'babashka.process-test 'babashka.process-exec-test)) |
I'll look at this soon, but I'm on a trip so it'll take a few days
…On Tue, May 23, 2023 at 12:27 AM Lee Read ***@***.***> wrote:
Another biggie. Lemme know watcha think.
As always, happy to collab and adapt.
After merge into babashka, we can adjust this
<https://github.com/babashka/babashka/blob/0f85b02a82d4033f6b9cb697ec0e6919e7e0281b/test-resources/lib_tests/babashka/run_all_libtests.clj#L95-L102>
:
;;;; babashka.process;; test built-in babashka.process
(test-namespaces 'babashka.process-test)
;; test babashka.process from source
#_{:clj-kondo/ignore [:duplicate-require]}
(require '[babashka.process] :reload)
(test-namespaces 'babashka.process-test)
To maybe something like this:
;;;; babashka.process;; test built-in babashka.process
(test-namespaces 'babashka.process-test)
(when (= "native" (System/getenv "BABASHKA_TEST_ENV"))
;; test babashka.process from source
#_{:clj-kondo/ignore [:duplicate-require]}
(require '[babashka.process] :reload)
(System/setProperty "babashka.process.test.reload" "true")
(test-namespaces 'babashka.process-test 'babashka.process-exec-test))
—
Reply to this email directly, view it on GitHub
<#131 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACFSBXNWVKWLJMNXXVH4G3XHPR57ANCNFSM6AAAAAAYLA3SUE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Thanks for the ping! Enjoy your trip! |
Thanks! |
lread
added a commit
to lread/babashka
that referenced
this pull request
May 28, 2023
4 tasks
borkdude
pushed a commit
to babashka/babashka
that referenced
this pull request
May 29, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New bb tasks:
CI:
babashka.process/exec
reload support. We'll turf this after next release of babashka.Add
run_exec.clj
- a wee program to exerciseexec
bb.edn
to suport running as a script and reloading sources instead of using babashka built-in babashka.processbabashka.process.test.reload
system property to signal thatrun_exec.clj
should reloadbabashka.process
from sources when running from bb.test:native
task does not natively compile tests, it only natively compilesrun_exec.clj
. It launches natively compiledrun_exec.clj
via jvm clojure and observes results for correctness.Test utilities moved to
babashka.process.test-utils
so that they can be used by existingbabashka.process-test
and new:babashka.process-exec-test
Add :ps-me to wee dummy wd.clj to support
exec
arg0 testing for macOS and Linux.Add doc/dev.md with some relevant notes/pointers.
Other changes:
script/test
bash script, it is replaced by bb tasksBugs found and fixed as a result of testing:
javac
seem to be happier runningjavac
from same dir as sourceexec
now converting:env
and:extra-env
keywords the same wayprocess
function do, seeexec
does not convert:env
and:extra-env
keywords #123Closes #117, Fixes #123