Skip to content

Remove test-only database methods from production interface and improve test reliability#749

Merged
vfusco merged 1 commit intonext/2.0from
feature/remove-test-repository
Mar 5, 2026
Merged

Remove test-only database methods from production interface and improve test reliability#749
vfusco merged 1 commit intonext/2.0from
feature/remove-test-repository

Conversation

@vfusco
Copy link
Collaborator

@vfusco vfusco commented Mar 5, 2026

No description provided.

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

This PR removes test-only database write methods from the production repository.Repository interface and updates tests to seed data through production write paths (notably CreateEpochsAndInputs and StoreAdvanceResult), improving isolation and realism of repository/jsonrpc tests.

Changes:

  • Dropped TestRepository from internal/repository/repository.go and removed Postgres test-only write helpers.
  • Added/updated repotest helpers/builders to seed outputs/reports via StoreAdvanceResult instead of direct inserts.
  • Refactored JSON-RPC tests to use repotest builders + production repository methods and switched several assertions to require.NoError.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
internal/repository/repotest/repotest.go Adds a StoreAdvanceResult test helper and suite wrapper to seed outputs/reports via production bulk op.
internal/repository/repotest/report_test_cases.go Replaces direct report creation with storeAdvanceResult seeding.
internal/repository/repotest/output_test_cases.go Replaces direct output creation with storeAdvanceResult seeding; adjusts execution-update tests accordingly.
internal/repository/repotest/builders.go Removes OutputBuilder/ReportBuilder; tweaks EpochBuilder.WithIndex; adds InputBuilder.WithEpochApplicationID.
internal/repository/repository.go Removes TestRepository from the public Repository interface.
internal/repository/postgres/util.go Removes unused addressToBytes helper (was only for removed test-only code).
internal/repository/postgres/test_only.go Deletes PostgresRepository test-only insert methods (CreateEpoch/Input/Output/Report).
internal/jsonrpc/util_test.go Adds repotest usage and helper methods to seed epochs/inputs/results through production APIs; uses require.
internal/jsonrpc/jsonrpc_test.go Updates seeding logic to avoid removed test-only repository methods; adopts require.NoError in several places.

💡 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.

renatomaia
renatomaia previously approved these changes Mar 5, 2026
@github-project-automation github-project-automation bot moved this from Todo to Waiting Merge in Rollups SDK Mar 5, 2026
mpolitzer
mpolitzer previously approved these changes Mar 5, 2026
@vfusco vfusco force-pushed the feature/advancer-improvements branch 2 times, most recently from b2733c5 to e69b14d Compare March 5, 2026 21:56
@vfusco vfusco force-pushed the feature/remove-test-repository branch from 0195dfd to 715a58e Compare March 5, 2026 22:03
Base automatically changed from feature/advancer-improvements to next/2.0 March 5, 2026 22:04
@vfusco vfusco dismissed stale reviews from mpolitzer and renatomaia March 5, 2026 22:04

The base branch was changed.

@vfusco vfusco merged commit 715a58e into next/2.0 Mar 5, 2026
6 checks passed
@vfusco vfusco deleted the feature/remove-test-repository branch March 5, 2026 22:24
@github-project-automation github-project-automation bot moved this from Waiting Merge to Done in Rollups SDK Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants