src.asqi.config

Classes

ContainerConfig

Configuration constants for container execution

ExecutorConfig

Configuration for test executor behavior.

Functions

interpolate_env_vars(→ Any)

Recursively interpolate environment variables in configuration data.

load_config_file(→ Dict[str, Any])

Load and parse a YAML configuration file with environment variable interpolation.

merge_defaults_into_suite(→ Dict[str, Any])

Merge test_suite_default values into each entry of test_suite.

save_results_to_file(→ None)

Save execution results to a JSON file.

Module Contents

src.asqi.config.interpolate_env_vars(data: Any) Any

Recursively interpolate environment variables in configuration data.

Supports the following syntax: - ${VAR} - Direct substitution of VAR - ${VAR:-default} - Use VAR if set and non-empty, otherwise use default - ${VAR-default} - Use VAR if set (including empty), otherwise use default

Args:

data: The data structure to interpolate (dict, list, or primitive)

Returns:

The data structure with environment variables interpolated

class src.asqi.config.ContainerConfig(/, **data: Any)

Bases: pydantic.BaseModel

Configuration constants for container execution

MANIFEST_PATH: ClassVar[str] = '/app/manifest.yaml'
DEFAULT_RUN_PARAMS: ClassVar[Dict[str, Any]]
timeout_seconds: int = None
stream_logs: bool = None
cleanup_on_finish: bool = None
cleanup_force: bool = None
run_params: Dict[str, Any] = None
classmethod load_from_yaml(path: str) ContainerConfig

Create a NEW instance from YAML (MANIFEST_PATH stays constant).

classmethod with_streaming(enabled: bool) ContainerConfig

Create a new config using all default values, but override stream_logs with the given bool.

classmethod from_run_params(*, detach: bool | None = None, remove: bool | None = None, network_mode: str | None = None, mem_limit: str | None = None, cpu_period: int | None = None, cpu_quota: int | None = None, **extra: Any) ContainerConfig

Create a new config with default scalars and default run_params, overriding only the provided run_params arguments. Extra docker kwargs can be passed via **extra.

class src.asqi.config.ExecutorConfig

Configuration for test executor behavior.

DEFAULT_CONCURRENT_TESTS: int = 3
MAX_FAILURES_DISPLAYED: int = 3
PROGRESS_UPDATE_INTERVAL: int = 4
src.asqi.config.load_config_file(file_path: str) Dict[str, Any]

Load and parse a YAML configuration file with environment variable interpolation.

Args:

file_path: Path to YAML file

Returns:

Parsed configuration dictionary with environment variables interpolated

src.asqi.config.merge_defaults_into_suite(config: Dict[str, Any]) Dict[str, Any]

Merge test_suite_default values into each entry of test_suite.

Args:

config: The parsed config dictionary

Returns:

Config with defaults merged into test_suite

src.asqi.config.save_results_to_file(results: Dict[str, Any], output_path: str) None

Save execution results to a JSON file.

Args:

results: Results dictionary to save output_path: Path to output JSON file