Skip to content

Move Hasura/GraphQL e2e tests to dedicated e2e suite - #1523

Merged
DZakh merged 1 commit into
mainfrom
claude/mockindexer-parallel-tests-j5s7z9
Jul 31, 2026
Merged

Move Hasura/GraphQL e2e tests to dedicated e2e suite#1523
DZakh merged 1 commit into
mainfrom
claude/mockindexer-parallel-tests-j5s7z9

Conversation

@DZakh

@DZakh DZakh commented Jul 31, 2026

Copy link
Copy Markdown
Member

Consolidates Hasura and GraphQL integration testing into the dedicated e2e test suite (packages/e2e-tests), removing it from the scenario tests that now run without Hasura.

Summary

The scenario tests (scenarios/test_codegen) previously required both Postgres and Hasura to run. This change moves Hasura-specific tests to the e2e suite where they belong alongside ClickHouse integration, and removes the Hasura dependency from the scenario test CI job. The scenario tests now run faster (~1.9s per indexer) by not initializing Hasura tracking.

Key Changes

  • e2e test suite (packages/e2e-tests):

    • Added Docker availability check that skips the entire suite locally if Docker is unavailable, but fails loudly in CI (where services are provisioned)
    • Added test for numeric array precision: verifies NUMERIC[] columns are served as strings by Hasura to preserve precision on large values
    • Added test for _meta and chain_metadata views: verifies events_processed is returned as a number (float4 cast) with expected precision loss
  • Scenario tests (scenarios/test_codegen):

    • Removed ~enableHasura parameter from MockIndexer.Indexer.make() — now always disables Hasura
    • Removed graphql method from mock indexer (no longer needed without Hasura)
    • Removed two Hasura-specific tests that are now in the e2e suite
    • Removed Async.itSkipInClaudeCloud helper (no longer used)
  • CI workflow (build_and_verify.yml):

    • Removed Hasura service from scenarios-test job
    • Removed Hasura health check step
    • Updated job comment to clarify GraphQL/Hasura coverage is in the e2e-test job
  • Test scenario (scenarios/e2e_test):

    • Added NumericArrays entity to schema with BigInt and BigDecimal array fields
    • Added handler logic to populate test data with values beyond float64 precision
    • Updated smoke test expectations to include the new entity

Implementation Details

The Docker availability check uses execFile("docker", ["info"]) with a 15-second timeout. In CI environments (detected via process.env.CI), an unavailable Docker daemon throws an error rather than skipping, ensuring broken infrastructure is caught immediately. Locally, tests skip gracefully, keeping pnpm test usable on machines without Docker.

Test data for numeric arrays uses values specifically chosen to exceed float64 precision (e.g., 9007199254740993n, 1000000000000000000000000000n) so any regression that allows Hasura to serve these as numbers would change the actual digits, not just the type.

https://claude.ai/code/session_01Pp1W67qx9M3BbgPzsEG3H2

Summary by CodeRabbit

  • New Features

    • Added PostgreSQL support for numeric arrays containing large integers and high-precision decimals.
    • Numeric array values now preserve their expected types and precision when written and queried.
    • Event metadata counts are returned accurately as numbers, including for large event totals.
  • Bug Fixes

    • Improved end-to-end validation for numeric data and event-count responses.
    • Local end-to-end checks now skip cleanly when Docker is unavailable, while CI reports setup failures explicitly.

The two MockIndexer tests that queried GraphQL asserted how Hasura serves
the generated DDL, not indexer behaviour, and forced a Hasura service into
the scenarios-test CI job for their sake alone. Both move to the e2e suite,
which already runs a real indexer behind Hasura:

- numeric arrays: NUMERIC[] columns are created as TEXT[] so Hasura serves
  the elements as strings. The e2e_test scenario gains a NumericArrays
  entity whose values sit beyond float64 precision, so a regression changes
  the digits rather than only the type.
- _meta / chain_metadata: events_processed is cast to float4 in both views
  so Hasura returns a number instead of stringifying it.

The e2e suite now skips when Docker is unavailable, keeping a local run
usable, and hard-fails instead of skipping when CI is set.

MockIndexer loses its enableHasura/graphql plumbing and always initialises
storage without Hasura, and the scenarios-test job drops the Hasura service.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 99843699-bdf9-4a08-8631-3b2ff213583f

📥 Commits

Reviewing files that changed from the base of the PR and between 93e772f and 37c7c04.

📒 Files selected for processing (9)
  • .github/workflows/build_and_verify.yml
  • packages/e2e-tests/src/e2e/e2e.test.ts
  • packages/envio/src/bindings/Vitest.res
  • scenarios/e2e_test/schema.graphql
  • scenarios/e2e_test/src/handlers/ERC20.ts
  • scenarios/e2e_test/src/indexer.test.ts
  • scenarios/test_codegen/test/E2E_test.res
  • scenarios/test_codegen/test/WriteRead_test.res
  • scenarios/test_codegen/test/helpers/MockIndexer.res
💤 Files with no reviewable changes (2)
  • scenarios/test_codegen/test/E2E_test.res
  • packages/envio/src/bindings/Vitest.res

📝 Walkthrough

Walkthrough

The changes move numeric precision and metadata coverage to the E2E suite. Scenario tests no longer configure Hasura. The scenarios CI job now requires PostgreSQL only, while Docker availability controls local E2E execution.

Changes

Numeric E2E coverage

Layer / File(s) Summary
Numeric entity fixture
scenarios/e2e_test/schema.graphql, scenarios/e2e_test/src/handlers/ERC20.ts, scenarios/e2e_test/src/indexer.test.ts
Adds the Postgres-backed NumericArrays entity, writes large bigint and high-precision decimal arrays, and updates the smoke-test snapshot.
E2E numeric validation
packages/e2e-tests/src/e2e/e2e.test.ts
Checks Docker availability, verifies numeric arrays remain strings, and validates large _meta and chain_metadata event counts.
Scenario test Hasura removal
scenarios/test_codegen/test/helpers/MockIndexer.res, scenarios/test_codegen/test/WriteRead_test.res, scenarios/test_codegen/test/E2E_test.res, packages/envio/src/bindings/Vitest.res
Removes Hasura configuration and GraphQL assertions from scenario tests and removes the Claude Cloud skip helper.
PostgreSQL-only scenario job
.github/workflows/build_and_verify.yml
Removes the Hasura service and readiness check from the scenarios CI job and updates its description.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: moving Hasura and GraphQL tests to the dedicated E2E suite.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@DZakh
DZakh merged commit d216f3c into main Jul 31, 2026
8 checks passed
@DZakh
DZakh deleted the claude/mockindexer-parallel-tests-j5s7z9 branch July 31, 2026 12:02
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.

2 participants