babashka/script/test

54 lines
1.3 KiB
Text
Raw Normal View History

2019-08-09 12:51:42 +00:00
#!/usr/bin/env bash
2023-04-21 14:39:00 +00:00
set -eo pipefail
2020-05-23 12:53:28 +00:00
if [ "$GRAALVM_HOME" != "" ]
then
export JAVA_HOME=$GRAALVM_HOME
export PATH=$GRAALVM_HOME/bin:$PATH
fi
java -version
unset BABASHKA_PRELOADS
unset BABASHKA_CLASSPATH
unset BABASHKA_PRELOADS_TEST
2020-03-30 18:29:08 +00:00
echo "running tests part 1"
2021-03-04 09:49:16 +00:00
lein "do" clean, test "$@"
2019-08-09 12:51:42 +00:00
2023-02-07 21:24:11 +00:00
echo "running flaky tests"
lein "do" clean, test :flaky || true
2020-05-23 12:53:28 +00:00
export BABASHKA_PRELOADS='(defn __bb__foo [] "foo") (defn __bb__bar [] "bar")'
export BABASHKA_PRELOADS_TEST=true
2020-03-30 18:29:08 +00:00
echo "running tests part 2"
lein test :only babashka.main-test/preloads-test
export BABASHKA_PRELOADS='(defn ithrow [] (/ 1 0))'
export BABASHKA_PRELOADS_TEST=true
echo "running tests part 3"
lein test :only babashka.main-test/preloads-file-location-test
2020-05-23 12:53:28 +00:00
export BABASHKA_PRELOADS="(require '[env-ns])"
export BABASHKA_CLASSPATH_TEST=true
export BABASHKA_CLASSPATH="test-resources/babashka/src_for_classpath_test/env"
echo "running tests part 4"
lein test :only babashka.classpath-test/classpath-env-test
2020-08-26 16:16:11 +00:00
export BABASHKA_POD_TEST=true
lein test :only babashka.pod-test
2020-11-27 08:48:31 +00:00
export BABASHKA_SOCKET_REPL_TEST=true
lein test :only babashka.impl.socket-repl-test
2023-04-21 14:39:00 +00:00
# test invoking script in subdir with bb.edn in parent dir
unset BABASHKA_PRELOADS
2023-04-21 14:50:31 +00:00
unset BABASHKA_CLASSPATH
2023-04-21 14:39:00 +00:00
pushd test-resources/bb_in_root_script_in_other_dir
if [[ $BABASHKA_TEST_ENV = "native" ]]
then
../../bb dir/script.clj
fi
popd