test: add E2E lifecycle tests and Robinhood fork tests - #21
Merged
Conversation
Add comprehensive test coverage for mainnet readiness: E2E Integration Tests (test/E2E.t.sol): - Full agent lifecycle: register → stake → attest → epoch → slash → zero-reputation - Slash dispute path with agent reinstatement - Reputation challenge (committee rejection during window) - Unbonding period enforcement - Slash sweeping unbonding queue (dodge prevention) - Multiple epochs of score evolution - Multiple independent agent lifecycles - Terminal slash state enforcement Fork Tests (test/Fork.t.sol): - Validate deployed Robinhood testnet contracts (46630) - Interface verification for Identity/Reputation/Staking - Cross-contract role linkage validation - Read/write path simulation with vm.prank - Graceful skip when FOUNDRY_FORK!=1 (CI stays green) CI/Documentation: - Add optional contracts-fork job requiring ROBINHOOD_RPC_URL secret - Document test tiers in README (unit/E2E/fork) - Include running instructions for each test type Closes testing gaps from readiness review. Co-authored-by: DC <david@runtimeadmin.com>
GitHub Actions rejects workflows that compare secrets.* in job-level if conditions. Fix by always running the contracts-fork job but checking for ROBINHOOD_RPC_URL at step level via env var mapping. Skips gracefully with a notice when the secret is unavailable. Co-authored-by: DC <david@runtimeadmin.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.
Summary
Closes the main testing gaps identified in the readiness review before mainnet:
register → stake → attest → epoch → slash → zero-reputationChanges
E2E Integration Tests (
test/E2E.t.sol)Comprehensive lifecycle tests covering:
Fork Tests (
test/Fork.t.sol)Validation against live Robinhood testnet (
46630) deployment:deployments/46630.jsonvm.prankwithout requiring mainnet keysFOUNDRY_FORK!=1so CI stays green without external RPCCI Updates (
.github/workflows/ci.yml)contracts-forkjob that runs only whenROBINHOOD_RPC_URLsecret is configuredDocumentation (
README.md)New "Testing" section documenting:
forge test)--match-contract E2EIntegrationTest)How to Run
Unit + E2E Tests (no external network required)
Fork Tests (requires Robinhood testnet RPC)
Test Results
All 192 tests pass:
FOUNDRY_FORK=1) ✓