1.5 KiB
1.5 KiB
Testing Instructions for rtx-sklearn-py
Running Tests
Due to PyO3's extension-module feature conflicting with test linking, tests must be run with the feature disabled:
# Run all tests
cargo test -p rtx-sklearn-py --no-default-features --features gpu,async
# Run a specific test
cargo test -p rtx-sklearn-py --no-default-features --features gpu,async test_name
# Compile tests without running
cargo test -p rtx-sklearn-py --no-default-features --features gpu,async --no-run
Why This is Needed
The extension-module feature in PyO3 is required for building Python extension modules (.so files) but prevents linking against Python libraries during testing. By disabling it for tests, we can:
- Compile and run Rust unit tests
- Test internal logic without Python runtime
- Perform integration testing
Python Integration Tests
For full end-to-end testing of the Python API, use pytest:
# Build the extension module first
maturin develop
# Run Python tests
pytest tests/python/
Test Structure
tests/basic_test.rs- Basic compilation teststests/integration_test.rs- Module structure and error handling teststests/tdd_comprehensive_test.rs- Placeholder for future comprehensive teststests/tdd_wrapper_test.rs- Wrapper smoke teststests/test_simple_classifiers.rs- Classifier smoke tests
Note: Many tests are currently stubs or placeholders as the full PyO3 API requires Python runtime for proper testing.