mirror of
https://gitlab.com/famedly/conduit.git
synced 2024-11-16 10:41:05 +01:00
cf8f1f2546
Well, kinda. It crashed on me after 10 minutes because the tests timed out like in <https://github.com/matrix-org/complement/issues/394>. Sounds like this means it's a them problem though. I want to use Nix to build this image instead in the future but this will at least make it work for now and give me a reference for while I'm porting it. I also want to make Conduit natively understand Complement's requirements instead of `sed`ing a bunch of stuff and needing a reverse proxy in the container. Should be more reliable that way. I'm not making this run in CI until the above stuff is addressed and until I can decide on a way to pin the revision of Complement being tested against.
37 lines
866 B
Bash
Executable file
37 lines
866 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 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 -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"
|