test(upgrade): add comprehensive workflow coverage with deterministic fakes#126
Open
kangeunchan wants to merge 2 commits intoaltuslabsxyz:mainfrom
Open
test(upgrade): add comprehensive workflow coverage with deterministic fakes#126kangeunchan wants to merge 2 commits intoaltuslabsxyz:mainfrom
kangeunchan wants to merge 2 commits intoaltuslabsxyz:mainfrom
Conversation
Signed-off-by: kangeunchan <kangeunchan080310@gmail.com>
Signed-off-by: kangeunchan <kangeunchan080310@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enhancement Description
Add comprehensive upgrade workflow tests to reach 80%+ package coverage and reduce regression risk.
Summary
This PR expands deterministic tests for
internal/application/upgradeacross state transitions, resume paths, and RPC-driven flows.Previously, upgrade coverage was insufficient for high-confidence refactors:
Now the package has broad unit/workflow coverage with reusable fakes.
What Changed
1) Added reusable test scaffolding and fake RPC harness
Added:
internal/application/upgrade/test_helpers_test.gointernal/application/upgrade/eth_rpc_test.go2) Added state and resume behavior suites
Added:
internal/application/upgrade/state_transitioner_test.gointernal/application/upgrade/state_detector_test.gointernal/application/upgrade/resume_test.gointernal/application/upgrade/switch_test.go3) Added execution/workflow coverage
Added:
internal/application/upgrade/propose_vote_test.gointernal/application/upgrade/execute_test.gointernal/application/upgrade/resumable_execute_test.go4) Tests
Coverage target met for package:
internal/application/upgradecoverage:80.3%Why This Is Needed
This is a reliability and testability improvement for a critical workflow.
Higher deterministic coverage reduces refactor risk and improves review confidence.
Behavior Notes / Regression Impact
No intentional runtime behavior change.
Changes are test-only.
Validation Performed
go test ./internal/application/upgrade -count=1go test ./internal/application/upgrade -coverprofile=/tmp/upgrade.cover -count=1go tool cover -func=/tmp/upgrade.covergo test ./...