@@ -37,7 +37,7 @@
|
||||
(format "%3d/%-3d %6.1f%%" hit total pct))
|
||||
|
||||
(defn read-source [file]
|
||||
;; Cloverage's SF: paths are usually project-relative already (src/vibe/core.clj); fall
|
||||
;; Cloverage's SF: paths are usually project-relative already (src/tbd/core.clj); fall
|
||||
;; back to the source roots in case they are classpath-relative.
|
||||
(some (fn [dir] (let [f (io/file dir file)] (when (.isFile f) (slurp f))))
|
||||
[nil "src" "test" "integration-test"]))
|
||||
@@ -52,7 +52,7 @@
|
||||
(format "<td class=\"%s\">%.1f%% <small>(%d/%d)</small></td>"
|
||||
(pct-class (:pct s)) (:pct s) (:hit s) (:total s))))
|
||||
files (sort (keys merged))]
|
||||
(str "<!doctype html><meta charset=utf-8><title>vibe line coverage</title>
|
||||
(str "<!doctype html><meta charset=utf-8><title>tbd line coverage</title>
|
||||
<style>
|
||||
body{font:14px system-ui;margin:2em;color:#222}table{border-collapse:collapse}
|
||||
td,th{padding:4px 12px;border-bottom:1px solid #ddd;text-align:left}
|
||||
@@ -61,7 +61,7 @@ pre{margin:0;font:12px ui-monospace,monospace}pre span{display:block;white-space
|
||||
.c{background:#e3f6e8}.u{background:#fde3e1}.g{display:inline-block;width:9em;color:#888}
|
||||
details{margin:1em 0}summary{cursor:pointer;font-weight:600}
|
||||
</style>
|
||||
<h1>vibe line coverage</h1>
|
||||
<h1>tbd line coverage</h1>
|
||||
<table><tr><th>File</th>"
|
||||
(apply str (for [k (keys per-suite)] (str "<th>" (name k) "</th>")))
|
||||
"<th>merged</th></tr>"
|
||||
|
||||
@@ -8,7 +8,7 @@ source script/lib/docker.sh
|
||||
|
||||
build_unit_image
|
||||
|
||||
id=$(docker create --security-opt apparmor=unconfined vibe-unit \
|
||||
id=$(docker create --security-opt apparmor=unconfined tbd-unit \
|
||||
clojure -M:cov -m cloverage.coverage \
|
||||
--src-ns-path src --test-ns-path test \
|
||||
--lcov --html --output target/coverage/unit)
|
||||
|
||||
@@ -5,4 +5,4 @@ cd "$(dirname "$0")/.."
|
||||
source script/lib/docker.sh
|
||||
|
||||
build_unit_image
|
||||
exec docker run --rm --security-opt apparmor=unconfined vibe-unit clojure -M:test "$@"
|
||||
exec docker run --rm --security-opt apparmor=unconfined tbd-unit clojure -M:test "$@"
|
||||
|
||||
@@ -28,7 +28,7 @@ free_port_in_range() {
|
||||
}
|
||||
|
||||
port=$(free_port_in_range 30000 40000)
|
||||
echo "[test] starting vibe-app on random port $port${COVERAGE:+ (under coverage instrumentation)}"
|
||||
echo "[test] starting tbd-app on random port $port${COVERAGE:+ (under coverage instrumentation)}"
|
||||
|
||||
compose=(docker compose)
|
||||
if [[ -n "${COVERAGE:-}" ]]; then
|
||||
@@ -38,7 +38,7 @@ fi
|
||||
use_builder
|
||||
|
||||
cd integration-test
|
||||
export VIBE_PORT=$port
|
||||
export TBD_PORT=$port
|
||||
|
||||
teardown() {
|
||||
local status=$?
|
||||
@@ -56,9 +56,9 @@ trap 'exit 143' TERM
|
||||
# builds. DEPS_ALIASES must match build.args in docker-compose.coverage.yml.
|
||||
docker buildx build --load \
|
||||
--build-arg "DEPS_ALIASES=run${COVERAGE:+:cov}" \
|
||||
-t vibe-app-integration \
|
||||
-t tbd-app-integration \
|
||||
-f "$root/Dockerfile" "$root"
|
||||
docker buildx build --load -t vibe-integration-test "$root/integration-test"
|
||||
docker buildx build --load -t tbd-integration-test "$root/integration-test"
|
||||
|
||||
# `run` returns the test container's own exit code; `up --abort-on-container-exit` can leak
|
||||
# the app's SIGTERM exit (143) during teardown instead.
|
||||
@@ -69,11 +69,11 @@ if [[ -n "${COVERAGE:-}" ]]; then
|
||||
# SIGTERM is what makes Cloverage write its report, so stop (not kill) the app and pull
|
||||
# the report out of the stopped container before `down` removes it.
|
||||
out_dir=$root/target/coverage
|
||||
echo "[test] stopping vibe-app to flush coverage report"
|
||||
"${compose[@]}" stop -t 120 vibe-app || true
|
||||
echo "[test] stopping tbd-app to flush coverage report"
|
||||
"${compose[@]}" stop -t 120 tbd-app || true
|
||||
rm -rf "$out_dir/integration"
|
||||
mkdir -p "$out_dir"
|
||||
if ! "${compose[@]}" cp vibe-app:/app/target/coverage/integration "$out_dir" \
|
||||
if ! "${compose[@]}" cp tbd-app:/app/target/coverage/integration "$out_dir" \
|
||||
|| [[ ! -f $out_dir/integration/lcov.info ]]; then
|
||||
echo "[test] WARNING: no integration coverage report was produced"
|
||||
fi
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# (opencontainers/runc#5007) that fails RUN steps during image build.
|
||||
|
||||
use_builder() {
|
||||
local builder=vibe-builder
|
||||
local builder=tbd-builder
|
||||
if ! docker buildx inspect "$builder" >/dev/null 2>&1; then
|
||||
docker buildx create --name "$builder" \
|
||||
--driver docker-container \
|
||||
@@ -13,8 +13,8 @@ use_builder() {
|
||||
docker buildx use "$builder"
|
||||
}
|
||||
|
||||
# Builds the app image with the test and coverage deps pre-fetched, tagged vibe-unit.
|
||||
# Builds the app image with the test and coverage deps pre-fetched, tagged tbd-unit.
|
||||
build_unit_image() {
|
||||
use_builder
|
||||
docker buildx build --load --build-arg DEPS_ALIASES=test:cov -t vibe-unit .
|
||||
docker buildx build --load --build-arg DEPS_ALIASES=test:cov -t tbd-unit .
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user