* perf(ci): 切换现有自托管运行器并复用本机缓存 * perf(ci): 将主要 Linux 任务迁至 Mac ARM64 运行器 * fix(ci): 使用动态端口执行 Windows 安装验收 * test(cpa): 等待异步处理完成后校验 WebSocket 行为 * perf(ci): 并行数据库测试并隔离容器验收端口 * ci: 为数据库合同测试启用内存盘 * test(cpa): 固定断连日志脱敏测试的执行顺序 * fix(ci): 修复自托管验收中断和架构兼容问题 * fix(ci): 原子准备 Windows 安装验收配置
47 lines
1.5 KiB
Bash
Executable File
47 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# 两组互补:增量迁移契约单独运行,其余(包括未来新增测试)自动归入另一组。
|
|
migrations='^TestExternal(AccessKeyPrefix|CustomAccessKey|PriceMultiplier|ModelCooldown|ValidationProtocol)MigrationContract$'
|
|
run='^TestExternal'
|
|
skip='^$'
|
|
case "${1:-all}" in
|
|
all | postgres) ;;
|
|
mysql-migrations) run="${migrations}" ;;
|
|
mysql-rest) skip="${migrations}" ;;
|
|
mysql)
|
|
: "${GPT_LOAD_DATABASE_TEST_DSN:?primary MySQL DSN is required}"
|
|
: "${GPT_LOAD_DATABASE_SECONDARY_DSN:?secondary MySQL DSN is required}"
|
|
logs="$(mktemp -d "${RUNNER_TEMP:-${TMPDIR:-/tmp}}/mysql-contract.XXXXXX")"
|
|
cleanup() {
|
|
for pid in $(jobs -pr); do
|
|
kill "${pid}" 2>/dev/null || true
|
|
done
|
|
wait || true
|
|
rm -rf "${logs}"
|
|
}
|
|
trap cleanup EXIT
|
|
trap 'exit 130' INT
|
|
trap 'exit 143' TERM
|
|
|
|
bash "$0" mysql-migrations >"${logs}/migrations.log" 2>&1 &
|
|
migrations_pid=$!
|
|
GPT_LOAD_DATABASE_TEST_DSN="${GPT_LOAD_DATABASE_SECONDARY_DSN}" \
|
|
bash "$0" mysql-rest >"${logs}/rest.log" 2>&1 &
|
|
rest_pid=$!
|
|
result=0
|
|
wait "${migrations_pid}" || result=1
|
|
wait "${rest_pid}" || result=1
|
|
for shard in migrations rest; do
|
|
echo "::group::MySQL ${shard}"
|
|
cat "${logs}/${shard}.log"
|
|
echo '::endgroup::'
|
|
done
|
|
exit "${result}"
|
|
;;
|
|
*) echo "unknown database test shard: $1" >&2; exit 2 ;;
|
|
esac
|
|
|
|
exec go test -v -count=1 ./internal/storage ./internal/control ./internal/requestlog \
|
|
-run "${run}" -skip "${skip}"
|