Files
wehub-resource-sync d718c5a372
CI / compile_and_lint (push) Failing after 0s
CI / docker_build (linux/amd64, -linux-amd64-duckdb, duckdb) (push) Failing after 0s
CI / docker_build (linux/arm64, -linux-arm64, minimal) (push) Failing after 2s
CI / docker_build (linux/arm64, -linux-arm64-duckdb, duckdb) (push) Failing after 1s
CI / docker_build (linux/amd64, minimal) (push) Failing after 1s
CI / test (, sqlite, sqlite::memory:) (push) Has been skipped
CI / test (mssql, mssql, mssql://root:Password123!@127.0.0.1/sqlpage) (push) Has been skipped
CI / test (mysql, mysql, mysql://root:Password123!@127.0.0.1/sqlpage) (push) Has been skipped
CI / test (oracle, oracle, Driver=Oracle 21 ODBC driver;Dbq=//127.0.0.1:1521/FREEPDB1;Uid=root;Pwd=Password123!) (push) Has been skipped
CI / test (postgres, odbc, Driver=PostgreSQL Unicode;Server=127.0.0.1;Port=5432;Database=sqlpage;UID=root;PWD=Password123!, true) (push) Has been skipped
CI / test (postgres, postgres, postgres://root:Password123!@127.0.0.1/sqlpage) (push) Has been skipped
CI / playwright (push) Has been skipped
CI / docker_build (linux/arm/v7, -linux-arm-v7, minimal) (push) Failing after 0s
CI / hurl_examples (push) Failing after 8s
deploy website / deploy_official_site (push) Failing after 1s
CI / hurl (${{ matrix.example }}) (push) Has been skipped
CI / docker_push (duckdb) (push) Has been cancelled
CI / docker_push (minimal) (push) Has been cancelled
CI / windows_test (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:31:57 +08:00

80 lines
2.4 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
FILTER="${1:-}"
if ! command -v hurl >/dev/null 2>&1; then
echo "hurl is required. See https://hurl.dev/docs/installation.html" >&2
exit 1
fi
current_project=""
current_compose=""
cleanup() {
if [[ -n "$current_project" && -n "$current_compose" ]]; then
docker compose -p "$current_project" -f "$current_compose" down --volumes --remove-orphans >/dev/null 2>&1 || true
fi
}
trap cleanup EXIT
run_index=0
tested=0
while IFS= read -r -d "" test_file; do
dir="$(dirname "$test_file")"
rel_dir="${dir#"$ROOT_DIR/"}"
if [[ -n "$FILTER" ]]; then
if [[ "$FILTER" == */* ]]; then
[[ "$rel_dir" == "$FILTER" ]] || continue
else
[[ "$rel_dir" == *"$FILTER"* ]] || continue
fi
fi
run_index=$((run_index + 1))
tested=$((tested + 1))
current_project="sqlpage_example_${run_index}"
current_compose="$dir/docker-compose.yml"
echo "::group::Testing $rel_dir"
if ! docker compose -p "$current_project" -f "$current_compose" up -d --quiet-pull --build --remove-orphans; then
echo "::error file=$rel_dir/docker-compose.yml,title=Example compose startup failed::$rel_dir failed to start"
echo "::group::docker compose ps for $rel_dir"
docker compose -p "$current_project" -f "$current_compose" ps -a
echo "::endgroup::"
echo "::group::docker compose logs for $rel_dir"
docker compose -p "$current_project" -f "$current_compose" logs
echo "::endgroup::"
echo "::endgroup::"
exit 1
fi
if ! hurl --test \
--retry 60 \
--retry-interval 1s \
--connect-timeout 2s \
--error-format long \
"$test_file"; then
echo "::error file=$rel_dir/test.hurl,title=Hurl example test failed::$rel_dir failed"
echo "::group::docker compose ps for $rel_dir"
docker compose -p "$current_project" -f "$current_compose" ps
echo "::endgroup::"
echo "::group::docker compose logs for $rel_dir"
docker compose -p "$current_project" -f "$current_compose" logs
echo "::endgroup::"
echo "::endgroup::"
exit 1
fi
docker compose -p "$current_project" -f "$current_compose" down --volumes --remove-orphans
echo "::endgroup::"
current_project=""
current_compose=""
done < <(find "$ROOT_DIR/examples" -mindepth 2 -maxdepth 2 -name test.hurl -print0 | sort -z)
if [[ "$tested" -eq 0 ]]; then
echo "No examples matched filter: $FILTER" >&2
exit 1
fi