adjust complement script to allow using your own hs OCI image without nix
Signed-off-by: strawberry <june@girlboss.ceo>
This commit is contained in:
parent
90fee4f50e
commit
5a3264980a
1 changed files with 27 additions and 7 deletions
|
@ -15,7 +15,7 @@ LOG_FILE="${2:-complement_test_logs.jsonl}"
|
||||||
# A `.jsonl` file to write test results to
|
# A `.jsonl` file to write test results to
|
||||||
RESULTS_FILE="${3:-complement_test_results.jsonl}"
|
RESULTS_FILE="${3:-complement_test_results.jsonl}"
|
||||||
|
|
||||||
OCI_IMAGE="complement-conduwuit:main"
|
COMPLEMENT_OCI_IMAGE="${COMPLEMENT_OCI_IMAGE:-complement-conduwuit:main}"
|
||||||
|
|
||||||
# Complement tests that are skipped due to flakiness/reliability issues or we don't implement such features and won't for a long time
|
# Complement tests that are skipped due to flakiness/reliability issues or we don't implement such features and won't for a long time
|
||||||
#SKIPPED_COMPLEMENT_TESTS='-skip=TestPartialStateJoin.*'
|
#SKIPPED_COMPLEMENT_TESTS='-skip=TestPartialStateJoin.*'
|
||||||
|
@ -34,18 +34,38 @@ toplevel="$(git rev-parse --show-toplevel)"
|
||||||
|
|
||||||
pushd "$toplevel" > /dev/null
|
pushd "$toplevel" > /dev/null
|
||||||
|
|
||||||
# if using macOS, use linux-complement
|
if [ ! -f "complement_oci_image.tar.gz" ]; then
|
||||||
#bin/nix-build-and-cache just .#linux-complement
|
echo "building complement conduwuit image"
|
||||||
bin/nix-build-and-cache just .#complement
|
|
||||||
|
|
||||||
docker load < result
|
# if using macOS, use linux-complement
|
||||||
popd > /dev/null
|
#bin/nix-build-and-cache just .#linux-complement
|
||||||
|
bin/nix-build-and-cache just .#complement
|
||||||
|
|
||||||
|
echo "complement conduwuit image tar.gz built at \"result\""
|
||||||
|
|
||||||
|
echo "loading into docker"
|
||||||
|
docker load < result
|
||||||
|
popd > /dev/null
|
||||||
|
else
|
||||||
|
echo "skipping building a complement conduwuit image as complement_oci_image.tar.gz was already found, loading this"
|
||||||
|
|
||||||
|
docker load < complement_oci_image.tar.gz
|
||||||
|
popd > /dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "running go test with:"
|
||||||
|
echo "\$COMPLEMENT_SRC: $COMPLEMENT_SRC"
|
||||||
|
echo "\$COMPLEMENT_BASE_IMAGE: $COMPLEMENT_BASE_IMAGE"
|
||||||
|
echo "\$RESULTS_FILE: $RESULTS_FILE"
|
||||||
|
echo "\$LOG_FILE: $LOG_FILE"
|
||||||
|
echo ""
|
||||||
|
|
||||||
# It's okay (likely, even) that `go test` exits nonzero
|
# It's okay (likely, even) that `go test` exits nonzero
|
||||||
set +o pipefail
|
set +o pipefail
|
||||||
env \
|
env \
|
||||||
-C "$COMPLEMENT_SRC" \
|
-C "$COMPLEMENT_SRC" \
|
||||||
COMPLEMENT_BASE_IMAGE="$OCI_IMAGE" \
|
COMPLEMENT_BASE_IMAGE="$COMPLEMENT_OCI_IMAGE" \
|
||||||
COMPLEMENT_ENABLE_DIRTY_RUNS=1 \ # reuses the same complement container for faster complement, at the possible expense of test environment pollution
|
COMPLEMENT_ENABLE_DIRTY_RUNS=1 \ # reuses the same complement container for faster complement, at the possible expense of test environment pollution
|
||||||
go test -tags="conduwuit_blacklist" -v -timeout 1h -json ./tests/... | tee "$LOG_FILE"
|
go test -tags="conduwuit_blacklist" -v -timeout 1h -json ./tests/... | tee "$LOG_FILE"
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue