Skip to content

docs: add swapper execution testing requirements#11523

Merged
gomesalexandre merged 3 commits intodevelopfrom
docs/swapper-execution-testing-requirements
Dec 24, 2025
Merged

docs: add swapper execution testing requirements#11523
gomesalexandre merged 3 commits intodevelopfrom
docs/swapper-execution-testing-requirements

Conversation

@NeOMakinG
Copy link
Collaborator

@NeOMakinG NeOMakinG commented Dec 24, 2025

Summary

Adds comprehensive testing requirements for swapper-related PRs to ensure actual swap execution verification before merging to production.

Problem

Previously, swapper integration PRs could be merged without executing actual swaps, relying only on quote fetching verification. This approach missed critical issues that only surface during transaction execution:

  • Fee calculation accuracy
  • Balance update correctness
  • Transaction completion reliability
  • Edge case handling
  • Cross-chain bridge functionality

Solution

This PR establishes clear testing requirements for all swapper-related work:

When Required

Execute actual swaps for PRs involving:

  1. New swapper integrations (Bebop, Portals, Jupiter, etc.)
  2. Swapper behavior changes (fees, quotes, routes)
  3. Chain adapter modifications affecting swaps
  4. Quote aggregation changes

Minimum Testing Scope

  • At least 2 successful swaps per PR
  • Primary + secondary swap directions
  • Comprehensive testing checklist:
    • Quote accuracy verification
    • Balance update confirmation
    • Fee estimation validation
    • Transaction completion
    • Error handling
    • Multi-chain support (if applicable)
    • Price impact accuracy
    • Slippage tolerance

Documentation Template

Provides a standardized template for documenting swap execution test results in PR comments, including:

  • Pre/post-swap balances
  • Quote details and verification
  • Transaction hashes and explorer links
  • Observed issues or limitations

Example Report

References .playwright-mcp/swap-execution-test-report.md as a comprehensive testing example showing:

  • Plasma (XPL) swap via Relay (cross-chain bridge)
  • SUI swap via Cetus (native DEX)

Both swaps executed successfully with accurate rates and balance updates.

Benefits

  1. Production Readiness: Catch execution-specific issues before merging
  2. Quality Assurance: Ensure swaps actually work, not just quote fetching
  3. Documentation: Standardized test reporting for review
  4. Best Practices: Clear guidelines for all swapper integrations

Testing

See the newly added section in docs/testing.md:

  • Comprehensive swapper integration testing requirements
  • Testing checklist and best practices
  • Documentation template
  • Example test reports

Related

  • Complements the swap execution testing performed for release v1.989.0 (see PR chore: release v1.989.0 #11522)
  • Establishes process for future swapper integrations

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added comprehensive testing guidelines for swapper integration, including testing scope, verification checklist, methodology, local development setup instructions, documentation standards, best practices, and example test reports.

✏️ Tip: You can customize this high-level summary in your review settings.

Add comprehensive testing requirements for swapper-related PRs to ensure actual swap execution verification before merging.

Key additions:
- When swap execution testing is required (new integrations, behavior changes, etc.)
- Minimum testing scope (2+ successful swaps)
- Comprehensive testing checklist
- Testing methodology and best practices
- Required test documentation template
- Reference to example test reports

This ensures production readiness for all swapper integrations by requiring real swap execution tests, not just quote fetching.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 24, 2025

📝 Walkthrough

Walkthrough

Documentation update adds comprehensive guidance for swapper integration testing to docs/testing.md. The new section covers when testing is required, scope specifications, verification checklists, methodology, local development procedures, documentation requirements, best practices, and example test reports.

Changes

Cohort / File(s) Summary
Swapper Integration Testing Documentation
docs/testing.md
Added extensive documentation section covering testing requirements, scope (minimum swaps, cross-chain tests), comprehensive testing checklist, methodology, local development steps, test documentation guidelines, best practices, and example test reports

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • gomesalexandre
  • 0xApotheosis

Poem

🐰 Hops of joy, the docs now gleam,
Testing swaps—a thorough dream!
Checklists, steps, and best-practice ways,
Documentation brightens all our days!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs: add swapper execution testing requirements' directly and clearly summarizes the main change—adding documentation about testing requirements for swapper execution.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/swapper-execution-testing-requirements

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between bfcc0df and b627560.

📒 Files selected for processing (1)
  • docs/testing.md
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: CR
Repo: shapeshift/web PR: 0
File: .cursor/rules/error-handling.mdc:0-0
Timestamp: 2025-11-24T21:20:17.804Z
Learning: Applies to **/swapper{s,}/**/*.{ts,tsx} : ALWAYS use `makeSwapErrorRight` for swapper errors with `TradeQuoteError` enum for error codes and provide detailed error information
Learnt from: CR
Repo: shapeshift/web PR: 0
File: .cursor/rules/swapper.mdc:0-0
Timestamp: 2025-11-24T21:20:57.909Z
Learning: Applies to packages/swapper/**/*.test.ts : Write unit tests for swapper methods and API endpoints
Learnt from: CR
Repo: shapeshift/web PR: 0
File: .cursor/rules/swapper.mdc:0-0
Timestamp: 2025-11-24T21:20:57.909Z
Learning: Applies to packages/swapper/src/swappers/*/*.ts : Reuse executeEvmTransaction utility for EVM-based swappers instead of implementing custom transaction execution
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10323
File: src/pages/RFOX/components/Stake/components/StakeSummary.tsx:112-114
Timestamp: 2025-08-22T13:00:44.879Z
Learning: NeOMakinG prefers to keep PR changes minimal and focused on the core objectives, avoiding cosmetic or defensive code improvements that aren't directly related to the PR scope, even when they would improve robustness.
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10128
File: .cursor/rules/error-handling.mdc:266-274
Timestamp: 2025-07-29T10:35:22.059Z
Learning: NeOMakinG prefers less nitpicky suggestions on documentation and best practices files, finding overly detailed suggestions on minor implementation details (like console.error vs logger.error) too granular for cursor rules documentation.
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10380
File: src/pages/Dashboard/components/AccountList/AccountTable.tsx:60-0
Timestamp: 2025-09-02T08:34:08.157Z
Learning: NeOMakinG prefers code review comments to focus only on actual PR changes, not pre-existing code issues, unless there are critical security or correctness concerns directly related to the new functionality.
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10234
File: src/components/MultiHopTrade/hooks/useGetTradeQuotes/hooks/useTrackTradeQuotes.ts:42-86
Timestamp: 2025-08-08T11:41:22.794Z
Learning: NeOMakinG prefers not to include refactors in move-only PRs; such suggestions should be deferred to follow-up issues instead of being applied within the same PR.
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10380
File: src/components/Table/Table.theme.ts:177-180
Timestamp: 2025-09-02T12:38:46.940Z
Learning: NeOMakinG prefers to defer technical debt and CSS correctness issues (like improper hover selectors) to follow-up PRs when the current PR is already large and focused on major feature implementation, even when the issues are valid from a usability/technical perspective.
📚 Learning: 2025-11-24T21:20:57.909Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: .cursor/rules/swapper.mdc:0-0
Timestamp: 2025-11-24T21:20:57.909Z
Learning: Applies to packages/swapper/**/*.test.ts : Write unit tests for swapper methods and API endpoints

Applied to files:

  • docs/testing.md
📚 Learning: 2025-11-24T21:20:57.909Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: .cursor/rules/swapper.mdc:0-0
Timestamp: 2025-11-24T21:20:57.909Z
Learning: Applies to packages/swapper/src/swappers/*/*.ts : Reuse executeEvmTransaction utility for EVM-based swappers instead of implementing custom transaction execution

Applied to files:

  • docs/testing.md
📚 Learning: 2025-11-24T21:20:57.909Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: .cursor/rules/swapper.mdc:0-0
Timestamp: 2025-11-24T21:20:57.909Z
Learning: Applies to packages/swapper/**/*.ts : Use TypeScript with explicit types (e.g., SupportedChainIds) for all code in the Swapper system

Applied to files:

  • docs/testing.md
📚 Learning: 2025-11-24T21:20:57.909Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: .cursor/rules/swapper.mdc:0-0
Timestamp: 2025-11-24T21:20:57.909Z
Learning: Applies to packages/swapper/src/swappers/**/*.ts : Avoid side effects in swap logic; ensure swap methods are deterministic and stateless

Applied to files:

  • docs/testing.md
📚 Learning: 2025-11-24T21:20:57.909Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: .cursor/rules/swapper.mdc:0-0
Timestamp: 2025-11-24T21:20:57.909Z
Learning: Applies to packages/swapper/src/swappers/*/endpoints.ts : Reuse checkEvmSwapStatus utility for checking EVM swap status instead of implementing custom status checks

Applied to files:

  • docs/testing.md
📚 Learning: 2025-11-24T21:20:57.909Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: .cursor/rules/swapper.mdc:0-0
Timestamp: 2025-11-24T21:20:57.909Z
Learning: Applies to packages/swapper/src/swappers/**/*.ts : Validate inputs and log errors for debugging in Swapper system implementations

Applied to files:

  • docs/testing.md
📚 Learning: 2025-11-24T21:20:17.804Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: .cursor/rules/error-handling.mdc:0-0
Timestamp: 2025-11-24T21:20:17.804Z
Learning: Applies to **/swapper{s,}/**/*.{ts,tsx} : ALWAYS use `makeSwapErrorRight` for swapper errors with `TradeQuoteError` enum for error codes and provide detailed error information

Applied to files:

  • docs/testing.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Call / Static
🔇 Additional comments (1)
docs/testing.md (1)

92-225: ✅ Well-structured and comprehensive addition that clearly meets PR objectives.

The new Swapper Integration Testing section provides clear, actionable guidance for developers. The four trigger conditions align precisely with the PR objectives, and the documentation appropriately extends to cover cross-chain testing, transaction history parsing, and cross-chain TX tracking as specified in commit 2.

The structure is practical:

  • When testing is required is unambiguous (lines 96-118)
  • What to test is specified via a comprehensive checklist (lines 138-151)
  • How to test is explained with methodology and template (lines 155-206)
  • Best practices are reasonable without being pedantic (lines 210-214)

The template format aligns with typical PR documentation conventions, and the reference to .playwright-mcp/swap-execution-test-report.md provides concrete examples.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Extends swapper testing requirements to include:
- Cross-chain swap testing for bridge functionality
- Transaction history parsing verification
- TX details drawer validation
- Cross-chain TX tracking for both source and destination

Ensures comprehensive testing for:
- Bridge swaps (e.g., USDC Arbitrum → new chains)
- TX parsing accuracy for new chain integrations
- TX details display correctness
- Multi-chain transaction tracking

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@NeOMakinG NeOMakinG marked this pull request as ready for review December 24, 2025 11:30
@NeOMakinG NeOMakinG requested a review from a team as a code owner December 24, 2025 11:30
Copy link
Contributor

@gomesalexandre gomesalexandre left a comment

Choose a reason for hiding this comment

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

hell yeah

@gomesalexandre gomesalexandre enabled auto-merge (squash) December 24, 2025 14:51
@gomesalexandre gomesalexandre merged commit 5528717 into develop Dec 24, 2025
4 checks passed
@gomesalexandre gomesalexandre deleted the docs/swapper-execution-testing-requirements branch December 24, 2025 15:00
@coderabbitai coderabbitai bot mentioned this pull request Jan 19, 2026
1 task
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