Skip to content

End-to-end integration tests against the live contract (post -> index -> query) #1042

Description

@BigBen-7

GistPin — GrantFox bounty issue. Reviewed against the acceptance criteria below. Read contracts/README.md first — it has the full ABI, event schema, and error codes for the deployed contract.

Context

The backend has unit tests (mocked) and a DB-integration suite
(*.integration-spec.ts, needs Postgres). Neither exercises the real,
live Soroban path
end-to-end — everything Soroban-related is currently
tested against mocks only.

Problem

This is the last mile of Wave 2: proving the whole pipeline actually works
together against the real, deployed contract — post via the API, indexed by
the poller, queryable via the API, filtered correctly by expiry/hidden state.

Scope

In scope:

  • A new integration spec (follow the *.integration-spec.ts naming
    convention so it's excluded from the fast unit run) that, against the live
    testnet contract (CCOVX5S3SYHVKUKM3NUXLH6COIYLV5BL3XD6HPFLLR4VLQEQGINJMDRV) and a real Postgres:
    1. POST /v1/gists (anonymous) → confirm a real tx lands
    2. Wait for/trigger an indexer poll → confirm the row appears via
      GET /v1/gists
    3. Report the gist → confirm the count updates
    4. (If merged) have the moderator hide it directly via the contract CLI →
      confirm it disappears from GET /v1/gists after the next poll
  • Document how to run it (npm run test:integration plus whatever env vars
    are needed) in Backend/README.md.

Acceptance Criteria

  • The full post → index → query round-trip is covered against the real
    contract, not mocks
  • Expiry and hidden-state filtering are covered against real on-chain
    data
  • The suite is clearly documented as requiring live network access +
    Postgres, and is not part of the fast CI unit run
  • Test run is reproducible from a clean checkout following your
    documented steps

How to verify your own work

Follow the setup steps you write in Backend/README.md from a clean
checkout, top to bottom, and confirm they actually work.

Depends on: the ABI-update, exit-mock-mode, and event-persistence issues
— this is the capstone test that proves they all work together. Coordinate
timing with whoever picks those up, or expect to wait on them.
Estimated effort: Medium-Large (2-3 days). Best suited to a contributor
who has already worked on (or closely read) the issues it depends on.

Activity

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

Metadata

Metadata

Assignees

Labels

BackendBackend issuesGrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third CampaigntestingTesting

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions