Skip to content

test: add unit tests for source-stripe utilities and transforms#302

Draft
tonyxiao wants to merge 4 commits intov2from
feat/source-stripe-unit-tests
Draft

test: add unit tests for source-stripe utilities and transforms#302
tonyxiao wants to merge 4 commits intov2from
feat/source-stripe-unit-tests

Conversation

@tonyxiao
Copy link
Copy Markdown
Collaborator

Summary

  • Add unit tests for 6 previously untested modules in packages/source-stripe:
    • retry.ts — HTTP error detection and retry logic (getHttpErrorStatus, isRetryableHttpError, withHttpRetry)
    • process-event.ts — Stripe webhook event processing and routing (fromStripeEvent, processStripeEvent)
    • transforms/backfillDependencies.ts — dependency ordering for backfill segments
    • transforms/subscriptionItems.ts — subscription item upsert and sync helpers
    • utils/expandEntity.ts — nested list expansion via paginated API calls
    • utils/hashApiKey.ts — deterministic SHA-256 hashing of API keys
  • Also includes three script improvements (from preceding commits):
    • scripts/pull-and-start-engine.sh: forward PG_* env vars, drop TTY flag, use local pino-pretty
    • Forward proxy env vars and use host network mode
    • Initial script to pull and start engine from Docker Hub

Test plan

  • pnpm test passes (unit tests, no external deps needed)
  • Review test coverage for each new test file

🤖 Generated with Claude Code

tonyxiao and others added 4 commits April 15, 2026 20:12
Pulls stripe/sync-engine:v2 and runs it interactively on port 4020.
Supports --pull-only, --no-pull, and --pretty (pino-pretty) flags.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Committed-By-Agent: claude
…ngine.sh

The Envoy egress proxy binds to 127.0.0.1, which is unreachable from
inside Docker's bridge network. Switch to --network host so the container
shares the host's network stack and can reach the proxy. Also forward
http_proxy/https_proxy env vars so Node's --use-env-proxy picks them up.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Committed-By-Agent: claude
…d-start-engine.sh

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Committed-By-Agent: claude
Covers retry logic, event processing, backfill dependencies,
subscription items, entity expansion, and API key hashing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Committed-By-Agent: claude
@tonyxiao tonyxiao force-pushed the v2 branch 2 times, most recently from 846d4c1 to b1d4c50 Compare April 20, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant