Architecture Overview¶
The TofuSoup project is a modular, CLI-driven framework designed for cross-language conformance testing and development tooling within the OpenTofu ecosystem.
The architecture is segmented into several key domains:
-
Main CLI (
cli.py): The central entry point, built withclick. It uses aLazyGroupto ensure fast startup times by only loading the code for a specific subcommand when it is invoked. -
Core Utilities (
common/): Provides shared services for all other components, including:- Configuration (
config.py): Loads and parses thesoup.tomlfile. - Exceptions (
exceptions.py): Defines custom, project-specific exceptions. - Rich Output (
rich_utils.py): Helpers for creating enhanced terminal output with therichlibrary.
- Configuration (
-
Protocol/Component Tooling: Each core technology (
cty,hcl,rpc,wire) has a dedicated module containing its CLI implementation and business logic. This modular design makes the system easy to extend. -
Harness Management (
harness/): This component is responsible for the lifecycle of external test harnesses, which are primarily Go binaries. It abstracts the details of building, locating, and cleaning these executables, with behavior configurable viasoup.toml. -
Conformance Testing (
testing/,conformance/): This is the core of the suite. Thetesting/module provides thesoup testCLI and logic for invokingpytest. The actual test suites reside inconformance/.