Testing Guide
Test Organization
spuff/
├── src/
│ ├── provider/
│ │ └── digitalocean.rs # Unit tests in #[cfg(test)] mod
│ └── ...
└── tests/
└── integration/ # Integration testsRunning Tests
All Tests
# Run all unit tests
cargo test --all
# Run with output
cargo test --all -- --nocapture
# Run specific test
cargo test test_name
# Run tests for a specific crate
cargo test -p spuffIntegration Tests
Unit Testing
Testing Provider Methods
Testing SSH Functions
Testing Cloud-Init Generation
Testing Configuration
Integration Testing
Full Lifecycle Test
SSH Integration Test
Test Utilities
Fixtures
Test Helpers
Mocking
HTTP Mocking with wiremock
Mocking Time
Test Coverage
Generate Coverage Report
Coverage Goals
Best Practices
Test Naming
Test Structure (Arrange-Act-Assert)
Avoiding Flaky Tests
Test Documentation
CI Integration
Running Specific Test Categories
Last updated
Was this helpful?