+3
-2
@@ -1,9 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
# Run the full suite (unit + integration) with line coverage and write the joint
|
||||
# report to target/coverage/merged.
|
||||
# Run the full suite (UI + unit + integration) with line coverage. The Clojure suites'
|
||||
# joint report goes to target/coverage/merged; the UI's is separate (target/coverage/ui).
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
script/ui-coverage
|
||||
script/unit-coverage
|
||||
script/integration-coverage
|
||||
script/coverage-report
|
||||
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
# Run the UI's tests under c8 inside a Node + JDK image; needs only Docker. The report is
|
||||
# copied out with `docker cp` (not a bind mount) so it works when this itself runs in a
|
||||
# job container. Output: target/coverage/ui.
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
source script/lib/docker.sh
|
||||
|
||||
build_ui_test_image
|
||||
|
||||
id=$(docker create --security-opt apparmor=unconfined tbd-ui-test npm run coverage)
|
||||
trap 'docker rm -f "$id" >/dev/null' EXIT
|
||||
|
||||
status=0
|
||||
docker start -a "$id" || status=$?
|
||||
|
||||
rm -rf target/coverage/ui
|
||||
mkdir -p target/coverage
|
||||
docker cp "$id:/build/target/coverage/ui" target/coverage/ || echo "[test] WARNING: no UI coverage report was produced"
|
||||
exit "$status"
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
# Run the UI's (ClojureScript) tests inside a Node + JDK image; needs only Docker.
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
source script/lib/docker.sh
|
||||
|
||||
build_ui_test_image
|
||||
exec docker run --rm --security-opt apparmor=unconfined tbd-ui-test
|
||||
@@ -18,3 +18,9 @@ build_unit_image() {
|
||||
use_builder
|
||||
docker buildx build --load --build-arg DEPS_ALIASES=test:cov -t tbd-unit .
|
||||
}
|
||||
|
||||
# Builds the UI's test image (Node + JDK, the UI's deps, sources and tests), tagged tbd-ui-test.
|
||||
build_ui_test_image() {
|
||||
use_builder
|
||||
docker buildx build --load --target ui-test -t tbd-ui-test .
|
||||
}
|
||||
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
# Run the unit tests, then the integration tests (stops at the first failure).
|
||||
# Run the UI tests, the unit tests, then the integration tests (stops at the first failure).
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
script/ui-test
|
||||
script/unit-test
|
||||
script/integration-test
|
||||
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
# Run the UI's tests with line coverage (c8, mapped back to the ClojureScript); the report goes
|
||||
# to target/coverage/ui. Needs Node and a JDK, like script/ui-test.
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/../ui"
|
||||
|
||||
[[ -d node_modules ]] || npm ci
|
||||
exec npm run coverage
|
||||
+3
-2
@@ -1,7 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
# Run the UI's (ClojureScript) tests under Node. Needs Node and a JDK, like script/ui-build.
|
||||
# Run the UI's (ClojureScript) tests under Node, in a jsdom window. Needs Node and a JDK, like
|
||||
# script/ui-build. script/docker-ui-test does the same with only Docker.
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/../ui"
|
||||
|
||||
[[ -d node_modules ]] || npm ci
|
||||
exec npx shadow-cljs compile test
|
||||
exec npm test
|
||||
|
||||
Reference in New Issue
Block a user