Conformance Testing Strategy¶
This document outlines the architecture for the TofuSoup conformance testing suite.
π€ AI-Generated Content
This documentation was generated with AI assistance and is still being audited. Some, or potentially a lot, of this information may be inaccurate. Learn more.
Testing Philosophy: souptest vs. pytest¶
A core distinction in this project is the separation of concerns in testing:
- Conformance Tests (souptest_*.py): These tests, located in tofusoup/conformance/, are for verifying cross-language compatibility. They compare the behavior of Python implementations against the canonical Go harnesses. They are run via the soup test command.
- Internal Tests (test_*.py): These are standard unit and integration tests for the tofusoup tool itself. They are located in tofusoup/tests/ and are run using pytest directly.
Architectural Design¶
The conformance suite is organized into a hierarchical and purpose-driven structure to ensure clarity, prevent duplication, and provide a scalable foundation for comprehensive testing.
Design Principles¶
- Hierarchical Organization: Reflect test complexity and dependencies.
- Cross-Cutting Separation: Create dedicated areas for security, performance, and integration.
- Single Source of Truth: Eliminate duplication in test scenarios and fixtures.
- Clear Purpose: Each directory has an explicit, non-overlapping responsibility.
Directory Structure¶
conformance/
βββ README.md # Testing strategy and execution guide
βββ conftest.py # Global fixtures and matrix configurations
β
βββ unit/ # Individual protocol conformance
β βββ souptest_cty_conformance.py
β βββ souptest_wire_conformance.py
β βββ souptest_rpc_conformance.py
β
βββ integration/ # Cross-protocol integration testing
β βββ souptest_full_stack_matrix.py # Complete CTYβWireβRPC flow
β βββ souptest_provider_lifecycle.py # Full Terraform provider scenarios
β
βββ security/ # Security-focused conformance
β βββ souptest_crypto_matrix.py # All cipher/curve combinations
β
βββ scenarios/ # End-to-end BDD-style scenario testing
β βββ terraform_equivalence/
β β βββ basic_operations.feature
β β βββ step_definitions/
β βββ souptest_scenario_runner.py
β
βββ fixtures/ # Shared test data and configuration
βββ cty_data/
βββ certificates/
This architecture provides a robust framework for implementing matrix-based testing and ensuring systematic validation of TofuSoup components against their canonical Go counterparts.