Skip to content

doc: Add comprehensive testing documentation - #16

Merged
phertyameen merged 5 commits into
bridgelet-org:mainfrom
Jagadeeshftw:testing-doc
Jan 22, 2026
Merged

phertyameen merged 5 commits into
bridgelet-org:mainfrom
Jagadeeshftw:testing-doc

Conversation

@Jagadeeshftw

Copy link
Copy Markdown
Contributor

This PR adds a complete testing guide (docs/testing.md) that documents how to run tests, write new tests, and understand the testing strategy for Bridgelet Core smart contracts.

What's Included

📚 Documentation Sections

  1. Quick Start - Immediate commands to run tests
  2. Running Tests - Detailed instructions for:
    • Unit tests (individual contract functions)
    • Integration tests (cross-contract interactions)
    • Test coverage tools
  3. Testing Strategy - Coverage goals, test categories, and structure
  4. Writing Tests - Comprehensive examples including:
    • Unit test examples from actual codebase
    • Error condition testing
    • Authorization mocking
    • Integration test patterns
    • Ledger time manipulation
    • Best practices
  5. Local Sandbox Testing - Complete guide for:
    • Sandbox setup and prerequisites
    • Deploying contracts locally
    • Interacting with deployed contracts
    • Using test scripts
  6. Troubleshooting Guide - Solutions for common issues:
    • Contract not found errors
    • Integration test import errors
    • Authorization errors
    • Error code debugging
    • Ledger sequence issues
    • WASM build errors
    • Test compilation errors
    • Sandbox connection issues
    • Test timeouts

Key Features

✅ Clear and Reproducible Instructions - All commands are tested and verified
✅ Working Examples - Code examples based on actual test files in the codebase
✅ Complete Coverage - Covers all testing scenarios (unit, integration, sandbox)
✅ Helpful Troubleshooting - Comprehensive solutions for common problems
✅ Best Practices - Guidelines for writing maintainable tests

Files Changed

  • docs/testing.md - New comprehensive testing documentation (527 lines)

Testing

The documentation includes examples that match the existing test structure:

  • Unit tests: contracts/ephemeral_account/src/test.rs
  • Integration tests: contracts/sweep_controller/tests/integration.rs

All commands and examples have been verified against the current codebase structure.

Acceptance Criteria Met

  • ✅ docs/testing.md file exists
  • ✅ Instructions are clear and reproducible
  • ✅ Examples are working and tested
  • ✅ Covers all testing scenarios
  • ✅ Troubleshooting section is helpful

Related

Addresses the need for comprehensive testing documentation as referenced in the main README.md.

Closes #11

@Jagadeeshftw

Copy link
Copy Markdown
Contributor Author

@phertyameen Please review

Comment thread .gitignore Resolved
Comment thread scripts/test.sh Resolved
@Jagadeeshftw

Copy link
Copy Markdown
Contributor Author

@phertyameen Updated!

@phertyameen
phertyameen merged commit 419b56e into bridgelet-org:main Jan 22, 2026
1 check passed
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.

Create Testing Guide Documentation

2 participants