Files

35 lines
1.1 KiB
Bash
Raw Permalink Normal View History

2026-01-30 20:54:21 -05:00
#!/usr/bin/env bash
#
# Runs the real-API integration tests for polyfill-rs.
#
# These tests hit the live Polymarket API and are `#[ignore]` by default.
# You must provide credentials via environment variables or a local `.env` file.
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT_DIR"
echo "Running ignored integration tests against the live Polymarket API..."
if [[ -z "${POLYMARKET_PRIVATE_KEY:-}" ]]; then
if [[ -f .env ]] && grep -q '^POLYMARKET_PRIVATE_KEY=' .env; then
echo "Using POLYMARKET_PRIVATE_KEY from .env"
else
echo "ERROR: POLYMARKET_PRIVATE_KEY is not set (env or .env)."
echo "Set POLYMARKET_PRIVATE_KEY in your environment or add it to .env."
exit 1
fi
fi
2026-01-30 21:10:15 -05:00
ARGS=(--ignored --test-threads=1)
if [[ "${NO_CAPTURE:-0}" == "1" ]]; then
ARGS+=(--nocapture)
fi
2026-01-30 20:54:21 -05:00
# Run serially to reduce the chance of hitting rate limits.
2026-01-30 21:10:15 -05:00
cargo test --all-features --test integration_tests -- "${ARGS[@]}"
cargo test --all-features --test ws_integration_tests -- "${ARGS[@]}"
2026-01-30 21:10:15 -05:00
cargo test --all-features --test simple_auth_test -- "${ARGS[@]}"
cargo test --all-features --test order_posting_test -- "${ARGS[@]}"