# =============================================================
# Libra L2 / L3 test credentials
# =============================================================
# Copy to .env.test (gitignored) and fill in your values, then run:
#
#   source .env.test && cargo test --all
#
# The `export` prefix on each line is required so that variables
# propagate from the shell into the cargo test child process —
# without it, `source .env.test` only sets local shell variables
# that the cargo subprocess cannot see, and L2/L3 tests skip silently.

# =============================================================
# L2 — Network tests (GitHub)
# =============================================================
# Create a personal access token at https://github.com/settings/tokens
# Required scope: public_repo (only public repos — avoids accidental deletion of private repos)
# The test creates a temporary repo named "libra-test-<random>" under this namespace,
# runs all network tests against it, and deletes it on completion.
export LIBRA_TEST_GITHUB_TOKEN=
export LIBRA_TEST_GITHUB_NAMESPACE=

# =============================================================
# L3 — AI tests
# =============================================================
# Get your key at https://platform.deepseek.com/api_keys
# Tests use the deepseek-v4-flash model; setting this key alone
# activates the L3 AI gate (no separate LIBRA_AI_LIVE_* needed).
export DEEPSEEK_API_KEY=

# Required for Kimi / Moonshot live provider tests.
# Libra's Kimi provider reads MOONSHOT_API_KEY and defaults to
# https://api.moonshot.cn/v1 unless MOONSHOT_BASE_URL is set.
export MOONSHOT_API_KEY=
# export MOONSHOT_BASE_URL=https://api.moonshot.cn/v1

# =============================================================
# L3 — Cloud feature tests (D1 + R2)
# =============================================================
# Used by: cloud sync/restore workflow, D1 CRUD, R2 object storage
# Cloudflare Dashboard → Workers & Pages → Overview → Account ID
export LIBRA_D1_ACCOUNT_ID=
# Cloudflare Dashboard → API Tokens → Create Token
export LIBRA_D1_API_TOKEN=
# Cloudflare Dashboard → Workers & Pages → D1 → your database
export LIBRA_D1_DATABASE_ID=
# Cloudflare Dashboard → R2 → Bucket → Settings → S3 API
export LIBRA_STORAGE_ENDPOINT=
export LIBRA_STORAGE_BUCKET=
export LIBRA_STORAGE_ACCESS_KEY=
export LIBRA_STORAGE_SECRET_KEY=
export LIBRA_STORAGE_REGION=auto

# Optional deploy-smoke portion of:
#   LIBRA_ENABLE_TEST_LIVE_CLOUD=1 cargo test --features test-live-cloud publish_live -- --test-threads=1
# Point this at a deployed publish Worker using the same D1/R2 bindings.
# The live gate creates a fresh slug automatically and derives clone_domain
# from this origin host unless the optional overrides are set.
export LIBRA_PUBLISH_LIVE_WORKER_ORIGIN=
# export LIBRA_PUBLISH_LIVE_CLONE_DOMAIN=
# export LIBRA_PUBLISH_LIVE_SLUG=
# export LIBRA_PUBLISH_LIVE_FILE_PATH=

# =============================================================
# L3 — S3 storage object tests
# =============================================================
# Tests S3 protocol features: PUT/GET/DELETE, multipart upload,
# list with prefix, tiered storage, error handling, etc.
#
# Uses a SEPARATE S3-compatible endpoint (can be different from R2 above).
# Supports: AWS S3, MinIO, or any S3-compatible service.
#
# --- AWS S3 ---
# export LIBRA_TEST_S3_ENDPOINT=https://s3.<region>.amazonaws.com
#
# --- Local MinIO (for offline development) ---
# docker run -p 9000:9000 minio/minio server /data
# export LIBRA_TEST_S3_ENDPOINT=http://127.0.0.1:9000
# export LIBRA_TEST_S3_ALLOW_HTTP=true
#
export LIBRA_TEST_S3_ENDPOINT=
export LIBRA_TEST_S3_BUCKET=
export LIBRA_TEST_S3_ACCESS_KEY=
export LIBRA_TEST_S3_SECRET_KEY=
export LIBRA_TEST_S3_REGION=
# Set to "true" when using HTTP endpoints (e.g. local MinIO)
# export LIBRA_TEST_S3_ALLOW_HTTP=true
