A standardized test suite for rhosocial-activerecord backends, providing contracts for features, real-world scenarios, and benchmarks.
Project description
RhoSocial ActiveRecord Test Suite
⚠️ Development Stage Notice: This project is currently under development. Features may be added or removed at any time, and there may be defects or inconsistencies with actual implementations. Therefore, the documentation content is subject to change at any time and is for reference only.
Overview
This package contains the standardized test suite for the RhoSocial ActiveRecord library. Its primary purpose is to provide a consistent set of test contracts that all official and third-party database backends must implement to ensure compatibility and reliability.
By separating the test definitions from the backend implementations, we can guarantee that all backends adhere to the same core functionalities and behaviors expected by the ActiveRecord interface.
Testing Philosophy
Our testing strategy is built on three core pillars:
- Feature Tests: Validate individual functionality points (e.g.,
wherequeries,savemethods,BelongsTorelationships). - Real-world Scenarios: Simulate actual business scenarios to verify complex interactions and data integrity.
- Performance Benchmarks: Measure and compare backend performance under standardized loads.
Structure
The test suite is organized into the following main categories, located in src/rhosocial/activerecord/testsuite/:
/feature: Core feature tests./realworld: Complex, real-world application scenarios./benchmark: Performance and load tests.
Capability-based Testing
The test suite includes an integrated pytest plugin that automatically checks if the current backend supports required capabilities. Tests using the @requires_capability decorator will be automatically skipped if the backend doesn't support the required features.
The plugin is registered automatically and available when the package is installed.
Usage for Backend Developers
If you are developing a database backend for RhoSocial ActiveRecord, you should include this test suite as a development dependency. Your backend's test runner will execute these tests against your implementation, using your provided database schema fixtures.
A typical workflow involves:
- Adding
rhosocial-activerecord-testsuiteto yourpyproject.toml. - Creating database schema fixtures that match the structure required by the tests.
- Running the test suite against your backend to identify and fix compatibility issues.
- Generating a compatibility report to document your backend's compliance level.
For detailed instructions, please refer to the main project's testing documentation.
Contributing
Contributions are welcome! Please refer to the main repository's contribution guidelines.
License
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters