You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: token contract handling and test validation (#33)
* feat(tests): add randomization for cron test variance
Add --sample, --random-lifecycle, and --random-token flags to support
randomized test runs. This provides variance across cron executions
while ensuring full endpoint coverage over the course of a day.
- Add shuffle(), sampleArray(), pickRandom() helpers
- Update test runner to support sampling flags
- Update cron script to use randomization (3 stateless + 2 lifecycle)
- For mainnet: randomly select STX/sBTC/USDCx each run
- Document new flags in CLAUDE.md
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: correct testnet USDCx contract address
- Testnet USDCx: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.usdcx
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(tests): validate asset against expected contract ID not token symbol
The test runner was comparing requirements.asset (full contract ID like
SM3VDXK3...sbtc-token) against tokenType (symbol like "sBTC"). This worked
for STX but failed for sBTC and USDCx.
- Add EXPECTED_ASSETS mapping matching TOKEN_CONTRACTS in middleware
- Add getExpectedAsset() helper to resolve token type to contract ID
- Update validation to compare against expected asset string
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(tests): add input validation to sampling helpers
Address Copilot review feedback:
- sampleArray: validate n for NaN/negative/non-integer values
- pickRandom: throw on empty array instead of returning undefined
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(tests): validate CLI args and fix random token display
Address additional Copilot review feedback:
- Validate --sample and --random-lifecycle args for NaN/invalid values
- Clear randomToken flag when tokens are explicitly specified to avoid
misleading "(random)" suffix in output
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
0 commit comments