Skip to content

Add initial integration tests #751

Open
vfusco wants to merge 5 commits intonext/2.0from
feature/ci-improvements
Open

Add initial integration tests #751
vfusco wants to merge 5 commits intonext/2.0from
feature/ci-improvements

Conversation

@vfusco
Copy link
Collaborator

@vfusco vfusco commented Mar 9, 2026

No description provided.

vfusco added 3 commits March 7, 2026 18:10
Restructure the JSON-RPC layer into focused packages:
- Extract decode, params, and response types from internal/jsonrpc/
  into internal/jsonrpc/api/ with generics (ListResponse[T],
  SingleResponse[T]) to eliminate duplicated anonymous structs
- Add MarshalJSON/UnmarshalJSON to model types (Epoch, Input, Output,
  Report, Tournament, Commitment) with hex-encoded uint64 fields and
  roundtrip tests
- Add --json flag to CLI send, execute, and validate commands, backed
  by new shared output types in internal/cli/
- Introduce DecodedData flat union type for type-safe output decoding
  across server and client boundaries
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an initial end-to-end (integration) test suite that exercises application lifecycles (Authority + PRT), plus supporting CLI/JSON-RPC API refactors and CI/docker plumbing to run the suite in GitHub Actions.

Changes:

  • Introduces endtoendtests-tagged Go integration tests (echo, reject/exception, PRT, multi-app isolation) and helper utilities.
  • Refactors JSON-RPC request/response envelopes and decoded input/output types into internal/jsonrpc/api, and extends CLI commands with --json outputs needed by tests.
  • Adds Docker Compose + CI workflow updates to build/pull “tester/devnet” images and run integration tests in CI.

Reviewed changes

Copilot reviewed 45 out of 47 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/integration/reject_exception_test.go Adds Authority-mode reject/exception lifecycle tests.
test/integration/reject_exception_prt_test.go Adds PRT-mode reject/exception lifecycle tests with tournament settlement hook.
test/integration/polling_helpers_test.go Adds polling + timing helpers for integration tests.
test/integration/multi_app_test.go Adds multi-application isolation end-to-end test.
test/integration/main_test.go Forces sequential execution for integration tests.
test/integration/lifecycle_test.go Adds shared lifecycle runners and claim/execution verification logic.
test/integration/echo_prt_test.go Adds echo-dapp lifecycle test for PRT consensus.
test/integration/echo_authority_test.go Adds echo-dapp lifecycle test for Authority consensus.
test/integration/cli_helpers_test.go Adds CLI wrappers for deploy/send/read/execute/validate used by tests.
test/integration/anvil_helpers_test.go Adds Anvil JSON-RPC helpers + PRT tournament settlement helpers.
test/compose/compose.integration.yaml Adds docker-compose stack to run node + integration tests in containers.
scripts/run-integration-tests.sh Adds integration-test container entrypoint script.
pkg/service/service.go Improves shutdown handling (SIGTERM support, telemetry shutdown timeout, returns Stop errors).
pkg/machine/implementation.go Tracks forked server PID and softens shutdown errors when child already exits.
internal/model/models_json_test.go Adds JSON roundtrip tests for model types.
internal/model/models.go Adds UnmarshalJSON for Output/Report/Tournament/Commitment and improves error wrapping.
internal/manager/instance.go Comment formatting adjustment for concurrency protocol docs.
internal/jsonrpc/types.go Removes API parameter/result/decoding types from server package (keeps server-only helpers).
internal/jsonrpc/jsonrpc_test.go Updates JSON-RPC tests to use new decoded output type.
internal/jsonrpc/jsonrpc.go Switches handlers to internal/jsonrpc/api param/response/decode types.
internal/jsonrpc/api/response.go Introduces shared JSON-RPC response envelope types.
internal/jsonrpc/api/params.go Introduces shared JSON-RPC parameter structs.
internal/jsonrpc/api/decode.go Introduces shared ABI decode helpers and decoded input/output structures.
internal/cli/types.go Introduces CLI JSON output structs (send/execute/validate).
internal/advancer/service.go Makes advancer Stop idempotent via sync.Once.
internal/advancer/advancer_test.go Minor formatting adjustment in mock struct fields.
cmd/cartesi-rollups-cli/root/validate/validate.go Adds --json output mode for validate command.
cmd/cartesi-rollups-cli/root/send/send.go Adds --json output mode for send command.
cmd/cartesi-rollups-cli/root/read/tournaments/tournaments.go Switches read params types to internal/jsonrpc/api.
cmd/cartesi-rollups-cli/root/read/service/types.go Updates ReadService interface to use internal/jsonrpc/api params types.
cmd/cartesi-rollups-cli/root/read/service/repository.go Updates repository read service to use api decode/types and error decoded_data representation.
cmd/cartesi-rollups-cli/root/read/service/jsonrpc.go Updates JSON-RPC read service to use internal/jsonrpc/api params types.
cmd/cartesi-rollups-cli/root/read/reports/reports.go Switches read params types to internal/jsonrpc/api.
cmd/cartesi-rollups-cli/root/read/outputs/outputs.go Switches read params types to internal/jsonrpc/api.
cmd/cartesi-rollups-cli/root/read/matches/matches.go Switches read params types to internal/jsonrpc/api.
cmd/cartesi-rollups-cli/root/read/matchadvances/matchadvances.go Switches read params types to internal/jsonrpc/api.
cmd/cartesi-rollups-cli/root/read/inputs/inputs.go Switches read params types to internal/jsonrpc/api.
cmd/cartesi-rollups-cli/root/read/epochs/epochs.go Switches read params types to internal/jsonrpc/api.
cmd/cartesi-rollups-cli/root/read/commitments/commitments.go Switches read params types to internal/jsonrpc/api.
cmd/cartesi-rollups-cli/root/execute/execute.go Adds --json output mode for execute command.
cmd/cartesi-rollups-cli/root/deploy/deploy.go Renames deploy flag var to asJSONParam for consistency.
cmd/cartesi-rollups-cli/root/deploy/authority.go Uses asJSONParam naming consistently.
cmd/cartesi-rollups-cli/root/deploy/application.go Uses asJSONParam naming consistently.
Makefile Adds integration-test targets, fmt-check, docker-based linting, and CI/local integration helpers.
Dockerfile Adds tester stage and switches healthcheck endpoint to /readyz.
.github/workflows/clean-up-images.yml Updates GHCR cleanup strategy and image list.
.github/workflows/build.yml Pushes CI-tagged images to GHCR and adds separate integration-test job.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@vfusco vfusco force-pushed the feature/ci-improvements branch from ab84ea2 to 7b9ec91 Compare March 9, 2026 17:22
@vfusco vfusco force-pushed the feature/ci-improvements branch from 7b9ec91 to 97f306a Compare March 9, 2026 17:38
@vfusco vfusco marked this pull request as ready for review March 9, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants