mirror of
https://github.com/girlbossceo/conduwuit.git
synced 2024-11-30 13:43:30 +00:00
d9ea3ffe70
Signed-off-by: strawberry <strawberry@puppygock.gay>
38 lines
894 B
Bash
Executable file
38 lines
894 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
# Path to Complement's source code
|
|
COMPLEMENT_SRC="$1"
|
|
|
|
# A `.jsonl` file to write test logs to
|
|
LOG_FILE="$2"
|
|
|
|
# A `.jsonl` file to write test results to
|
|
RESULTS_FILE="$3"
|
|
|
|
OCI_IMAGE="complement-conduit:dev"
|
|
|
|
env \
|
|
-C "$(git rev-parse --show-toplevel)" \
|
|
docker build \
|
|
--tag "$OCI_IMAGE" \
|
|
--file tests/complement/Dockerfile \
|
|
.
|
|
|
|
# It's okay (likely, even) that `go test` exits nonzero
|
|
set +o pipefail
|
|
env \
|
|
-C "$COMPLEMENT_SRC" \
|
|
COMPLEMENT_BASE_IMAGE="$OCI_IMAGE" \
|
|
go test -vet=all -timeout 30m -json ./tests | tee "$LOG_FILE"
|
|
set -o pipefail
|
|
|
|
# Post-process the results into an easy-to-compare format
|
|
cat "$LOG_FILE" | jq -c '
|
|
select(
|
|
(.Action == "pass" or .Action == "fail" or .Action == "skip")
|
|
and .Test != null
|
|
) | {Action: .Action, Test: .Test}
|
|
' | sort > "$RESULTS_FILE"
|