Skip to content

rpcv2 integration tests: run the rpcv1 suite unchanged against rpcv2, four CI legs #883

Description

@karthikiyer56

Part of #986.

Goal

Run the rpcv1 integration suite, assertions unchanged, against rpcv2. CI runs four legs instead of two.

leg daemon protocol
1 rpcv1 P27
2 rpcv1 P28
3 rpcv2 P27
4 rpcv2 P28
  • The only thing that may differ between the two daemons is how the harness instantiates them.
  • rpcv1's integration-test settings do not change.
  • rpcv2 starts with the stock defaults from cmd/stellar-rpc/rpcv2/rpc-v2-sample-config.toml.
  • Run model stays as today: one Core container per test, captive core as a subprocess, the daemon in-process.

This replaces the earlier in-process paritytest design. rpcv2 now serves every rpcv1 method natively (#908, #960), so the suite itself is the parity test.

Layout

path holds
cmd/stellar-rpc/internal/integrationtest/ the common tests and infrastructure/ (moved up from rpcv1/)
cmd/stellar-rpc/internal/rpcv1/integrationtest/ rpcv1-only tests
cmd/stellar-rpc/internal/rpcv2/integrationtest/ home for rpcv2-only tests (rpcv2 backfill, getEventsV2), empty except doc.go
  • The harness picks the daemon from STELLAR_RPC_INTEGRATION_TESTS_DAEMON (rpcv1 default, rpcv2).
  • Each CI leg runs the common package and its own daemon's package.

Which tests run where

test placement reason
TestGetLedgersFromDatastore, backfill_test.go, migrate_test.go, ingest_loadtest_test.go rpcv1-only mutate rpcv1/config.Config, read SQLite, or run released rpcv1 images
TestArchiveUserAgent rpcv1-only pins rpcv1's User-Agent; rpcv2 has none yet (follow-up below)
TestHealth common, minus one line LedgerRetentionWindow == 17280 moves to a per-daemon test; rpcv2 measures retention in 10 000-ledger chunks
TestUpgradeFrom20To21 common probe changes from GetDaemon().GetDB() to getLatestLedger; assertions unchanged
TestMetrics common after rpcv2 registers the same process metrics (below)
everything else common unchanged

rpcv2 code changes (test-enabling only)

  • Export a minimal options entry point wrapping runDaemonWith: logger and flag overrides. The binary's behaviour does not change.
  • Register soroban_rpc_build_info, the logmetrics log-line counters, and the Go and process collectors on rpcv2's registry, as rpcv1/daemon/metrics.go does.

rpcv2 instantiation in the harness

  • Config: a test-only TOML derived from the sample, [backfill.datastore] removed, admin endpoint on, preflight debug on. Per-test values (data dir, endpoint, ports, captive-core file, archive URL, core binary) go in as flag overrides. A unit test parses it strictly.
  • Ports: RPC, admin, captive core admin HTTP, captive core query, captive core peer, all from getFreeTCPPorts, with a retry on bind collision.
  • Captive core file: the harness appends NETWORK_PASSPHRASE for rpcv2 only. The shared template stays byte-identical.
  • sendTransaction goes through captive core's admin port, rpcv2's stock route. First implementation step is a spike of TestSendTransactionSucceeds under rpcv2.
  • Every wait is sized for four environments booting at once, as in test: run every integration environment in the parallel batch #981.
  • TestGetFeeStats is the first end-to-end check of rpcv2's fee windows against rpcv1's. A mismatch is an rpcv2 bug to fix, not an assertion to change.

CI

  • integration-tests.yml gains a daemon input and runs the common package plus the daemon's package.
  • stellar-rpc.yml replaces the two hand-written jobs with one caller job and strategy.matrix over protocol × daemon. Job names: Integration tests (P27, rpcv1) and so on. The protocol list moves with releases.
  • continue-on-error stays as it is for all four legs.

Activity

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

Metadata

Metadata

Assignees

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions