Skip to content

fix(test): make the integration suite actually integrate - #265

Merged
RaceeyXo merged 1 commit into
RaceeyXo:devfrom
itzabdoull:fix/integration-tests
Sep 2, 2026
Merged

fix(test): make the integration suite actually integrate#265
RaceeyXo merged 1 commit into
RaceeyXo:devfrom
itzabdoull:fix/integration-tests

Conversation

@itzabdoull

Copy link
Copy Markdown

Overview

This PR resolves the issues with the integration test suite, allowing it to run against the live Stellar Testnet without using mocked SDK elements. It also updates the CI workflow to run nightly on a schedule, fixes the setup sequence, and adds filter validations to prevent empty-match passes in the future.

Related Issue

Closes #229

Changes

🧪 Integration Tests

  • [NEW] packages/core/jest.integration.config.js
    • Added dedicated Jest configuration for integration tests (Node environment, no module mocks).
  • [MODIFY] packages/core/package.json
    • Updated test:integration script to target the new jest.integration.config.js.
  • [MODIFY] packages/core/src/__tests__/integration/balance.test.ts
    • Added unmocking verification check.
    • Added fundWithFriendbot helper with retry backoff and error body reporting.
    • Corrected balance assertion to check for positive native balance (> 0) instead of hardcoding 10,000 XLM.
  • [MODIFY] packages/core/src/__tests__/integration/payment.test.ts
    • Added unmocking verification check.
    • Added fundWithFriendbot helper for both accounts.
    • Asserted testnet passphrase (Networks.TESTNET) before transaction submission.

⚙️ CI/CD Workflows

  • [MODIFY] .github/workflows/integration.yml
    • Reordered setup steps so that pnpm/action-setup runs before actions/setup-node.
    • Corrected pnpm filter to use-stellar.
    • Added verification step with --fail-if-no-match to fail loudly if no projects match.
    • Added nightly schedule (0 0 * * *) alongside manual trigger, and removed pull_request triggers to protect Friendbot limits.

Verification Results

Local Verification

pnpm --filter use-stellar test:integration
PASS src/__tests__/integration/payment.test.ts (25.049 s)
PASS src/__tests__/integration/balance.test.ts (11.049 s)

Test Suites: 2 passed, 2 total
Tests:       4 passed, 4 total
Snapshots:   0 total
Time:        36.464 s
Ran all test suites.

All build, lint, and typecheck commands run successfully:

  • pnpm lint -> Passed
  • pnpm typecheck -> Passed
  • pnpm build -> Passed
Acceptance Criteria Status
The integration suite resolves the real @stellar/stellar-sdk ✅ Verified via unmocking assertion check
A test asserts two Keypair.random() calls differ ✅ Verified in both integration test suites
balance.test.ts passes against live testnet ✅ Passed locally
payment.test.ts passes against live testnet ✅ Passed locally
Funding-amount assertion does not hardcode 10,000 XLM ✅ Changed to toBeGreaterThan(0)
Friendbot failures surface response body and retry ✅ Verified via retry helper
pnpm --filter matches use-stellar and fails on no-match ✅ Added --fail-if-no-match
pnpm/action-setup runs before actions/setup-node ✅ Corrected in integration.yml
Workflow runs on nightly schedule and manual dispatch ✅ Configured
Workflow not attached to pull_request ✅ Configured
pnpm test (unit tests) still excludes integration and passes ✅ Passed locally
Every test uses testnet only ✅ Configured and asserted

@RaceeyXo
RaceeyXo merged commit ff3d10b into RaceeyXo:dev Sep 2, 2026
2 of 3 checks passed
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.

fix(test): make the integration suite actually integrate

3 participants