Skip to content

Add integration tests for under-tested soroban modules #32

Description

@Meshmulla

Background

The Soroban workspace has grown to roughly 33 modules under soroban/src/, but the soroban/tests/ directory contains dedicated integration tests for only a handful of them — asset locking, operator rotation, source trust, threshold window, and version migration. That leaves a number of important modules — for example governance, circuit_breaker, and submission_pausewithout dedicated end-to-end coverage of their public behavior.

For on-chain code, "it compiles and the unit assertions pass" is not the same as "its entrypoints behave correctly, enforce the right authorization, honor their guards, and emit the right events." Those properties are what integration tests against the contract's public interface actually verify, and for several modules they currently go unverified.

Why this matters

Contracts are hard to change after deployment and unforgiving when wrong, so the behavioral contract of each module — who may call what, what happens when paused or when a breaker is tripped, and which events observers depend on — deserves explicit tests. Beyond catching regressions, these tests serve as executable documentation of each module's intended behavior, which is invaluable as more contributors touch the code.

What needs to be done

  • Pick a focused subset to start with (suggested: governance, circuit_breaker, submission_pause) so the PR stays reviewable.
  • For each chosen module, add integration tests under soroban/tests/, mirroring the style of the existing suites (e.g. operator_rotation.test.rs, version_migration_tests.rs), that exercise its public entrypoints across:
    • the happy path (valid calls produce the expected state),
    • authorization enforcement (admin/owner gates reject unauthorized callers),
    • guard/pause behavior (operations are correctly blocked when paused or when a breaker is open),
    • emitted events (the right events fire with the right data).
  • Reuse the shared setup helpers the existing suites already use, rather than duplicating harness code.
  • Keep the tests fully deterministic so they run in the standard cargo test CI job with no special setup.

Where to look

  • soroban/src/ — the target modules (governance.rs, circuit_breaker.rs, submission_pause.rs, and the rest of the ~33)
  • soroban/tests/ — existing suites to model the style and setup on
  • docs/API_REFERENCE.md, docs/EVENTS.md, docs/ERRORS.md — the documented behavior to assert against

Acceptance criteria

  • Dedicated integration tests added for at least the three suggested modules, covering happy path, authorization, guards/pause, and events
  • Tests reuse the shared setup helpers and run in the standard cargo test CI job
  • No existing tests regress, and clippy/fmt stay clean
  • CI checks must be green before the PR can be merged

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third CampaignenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions