Skip to content

Commit 44b69d2

Browse files
willemnealclaude
andcommitted
test(fly-app): add unit, integration, and e2e test coverage
- Pure unit tests for parse_cursor (None, valid, malformed, negative ledger) and serialize_raw (None, valid JSON inline, invalid JSON). - DB-backed HTTP integration tests using actix_web::test::init_service against a real Postgres: wasms list grouping and channel resolution, wasm-by-version, 404s, limit/cursor validation, contracts JOIN across registered+deployed+wasms, and registries ordering. - End-to-end test that loads registry-turbo-v4.yaml, replays each transform_3_* SQL over the real Soroban fixtures in test/fixtures/soroban-events-real/, and asserts the resulting rows surface correctly through /v1/registries, /v1/contracts, and /v1/wasms. Flipping the root contract id in the pipeline YAML makes the sub-registry filter drop to zero rows, failing this suite. DB-gated tests skip silently when TEST_DATABASE_URL is unset; e2e additionally requires the real fixtures directory to be populated. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e04f86f commit 44b69d2

3 files changed

Lines changed: 892 additions & 0 deletions

File tree

fly-app/Cargo.lock

Lines changed: 62 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fly-app/Cargo.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,11 @@ serde_json = "1"
1010
chrono = { version = "0.4", features = ["serde"] }
1111
sqlx = { version = "0.8", features = ["runtime-tokio", "postgres", "tls-rustls", "chrono"] }
1212
tokio = { version = "1", features = ["full"] }
13+
14+
[dev-dependencies]
15+
# Integration tests that touch the shared Postgres test DB use `#[serial]`
16+
# so they don't race each other on TRUNCATE between tests.
17+
serial_test = "3"
18+
# e2e test loads registry-turbo-v4.yaml to pull the pipeline transform SQL
19+
# and replay it against Postgres before hitting the HTTP layer.
20+
serde_yaml_ng = "0.10"

0 commit comments

Comments
 (0)