This directory contains integration tests for the stellar-router project that run against Stellar testnet.
# Install Stellar CLI
cargo install --locked stellar-cli
# Build WASM contracts
cargo build --target wasm32-unknown-unknown --release# Run all integration tests
cargo test --test integration_tests -- --ignored --test-threads=1 --nocapture
# Run specific test
cargo test --test integration_tests test_full_router_core_flow -- --ignored --nocapture
# Run quick validation tests
cargo test --test integration_tests quick_tests -- --ignored --nocaptureintegration-tests/
├── Cargo.toml # Test package configuration
└── tests/
├── integration_tests.rs # Main test file
├── integration/
│ ├── mod.rs # Module declarations
│ ├── testnet_setup.rs # Testnet utilities and fixtures
│ ├── full_flow_test.rs # Happy path tests
│ └── failure_scenarios.rs # Error handling tests
└── README.md # This file
test_full_router_core_flow- Complete router-core workflowtest_router_registry_flow- Version managementtest_router_access_control- Role-based access controltest_router_middleware_rate_limiting- Rate limitingtest_router_timelock_operations- Delayed executiontest_timelock_guarded_route_update- End-to-end timelock-guarded route update security patterntest_router_multicall_batching- Batch operationstest_admin_transfer- Admin management
test_unauthorized_route_registration- Access control validationtest_duplicate_route_registration- Duplicate preventiontest_resolve_nonexistent_route- Missing route handlingtest_invalid_route_name- Input validationtest_paused_router_operations- Pause state handlingtest_update_nonexistent_route- Update validationtest_remove_nonexistent_route- Remove validationtest_unauthorized_admin_transfer- Admin protectiontest_registry_version_conflict- Version uniquenesstest_access_control_blacklist- Blacklist enforcement
test_stellar_cli_available- Verify CLI installationtest_wasm_contracts_built- Verify WASM files existtest_account_generation_and_funding- Test account setup
Generate and manage test accounts:
let account = TestAccount::generate()?;
account.fund()?; // Fund via FriendbotDeploy and interact with contracts:
let contract = DeployedContract::deploy(
"path/to/contract.wasm",
"contract-name",
&admin_account,
)?;
let result = contract.invoke("method_name", &["--arg", "value"], &admin)?;Complete test environment:
let mut fixture = TestFixture::new()?;
fixture.deploy_all_contracts()?;
fixture.initialize_all_contracts()?;
// Access deployed contracts
let core = fixture.router_core.as_ref().unwrap();- Use
--nocaptureto see test output - Use
--test-threads=1to avoid rate limits - Tests take 10-30 seconds each due to network latency
- Accounts and contracts remain on testnet after tests
See INTEGRATION_TESTS.md for comprehensive documentation.