Commit d2603dd
authored
test: End-to-end Stripe Connect integration test (#918)
* test: End-to-end Stripe Connect integration test
Add E2E tests exercising the full Stripe payment flow from billing
trigger through webhook processing to ledger posting:
- Happy path: payment order -> saga -> Stripe webhook (succeeded) ->
ledger entries -> lien execution
- Failure path: payment decline -> dunning escalation (Redis ZSET)
- Webhook idempotency: replay same Stripe event ID -> no duplicate
processing (verified via Redis and call counts)
- Multiple distinct webhooks on same payment order
- Successful payment does not trigger dunning
Uses CockroachDB testcontainer + miniredis for persistence parity.
Extends E2E test infra with sagaOrchestrationEnabled option and
saga_executions schema.
* fix: resolve ineffassign lint issues in stripe e2e test
Move lien call count recording after the await settle to avoid
redundant assignment, and discard the intentional timeout error
with blank identifier.
* fix: address CodeRabbit review comments on PR #918
1. Assert saga_executions DDL succeeds instead of silently discarding
errors (e2e_test.go:430).
2. TestStripeE2E_SagaExecutionPersisted now queries the saga_executions
table directly in CockroachDB and verifies records exist with correct
saga_name, status, and payment_order_id. Also auto-wire
SagaExecutionRepository into the service when saga orchestration is
enabled.
* fix: remove unused withSagaExecutionLogger option function
Auto-wire SagaExecutionRepository directly when saga orchestration
is enabled, eliminating the need for an explicit option.
---------
Co-authored-by: Ben Coombs <bjcoombs@users.noreply.github.com>1 parent 150d4d4 commit d2603dd
2 files changed
Lines changed: 705 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
136 | 142 | | |
137 | 143 | | |
138 | 144 | | |
| |||
143 | 149 | | |
144 | 150 | | |
145 | 151 | | |
| 152 | + | |
| 153 | + | |
146 | 154 | | |
147 | 155 | | |
148 | 156 | | |
| |||
161 | 169 | | |
162 | 170 | | |
163 | 171 | | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
169 | 178 | | |
170 | 179 | | |
171 | 180 | | |
| |||
195 | 204 | | |
196 | 205 | | |
197 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
198 | 213 | | |
199 | 214 | | |
200 | 215 | | |
| |||
416 | 431 | | |
417 | 432 | | |
418 | 433 | | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
419 | 454 | | |
420 | 455 | | |
421 | 456 | | |
| |||
0 commit comments