Skip to content

Commit

Permalink
Add test fixtures documentation and directory structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Cerebrovinny committed Feb 5, 2025
1 parent c05cfea commit aee2abd
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions tests/fixtures/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Atmos Test Fixtures

This directory contains test fixtures for Atmos CLI testing. The structure is organized to maximize component reuse and reduce duplication through Atmos's inheritance and vendoring capabilities.

## Directory Structure

```
fixtures/
├── atmos.yaml # Base configuration file
├── components/ # Shared reusable components
│ └── terraform/ # Terraform modules used across tests
├── scenarios/ # Test scenarios
│ ├── mock-terraform/ # Mock Terraform testing
│ ├── vendor/ # Vendored components
│ └── ... # Other test scenarios
└── schemas/ # JSON schemas for validation
```

## Component Reuse

Components are managed in two ways:
1. **Direct Reference**: Using `base_path` to point to the shared components directory
2. **Vendoring**: Using Atmos's vendor capability to vendor components into specific test scenarios

## Configuration Inheritance

Test scenarios inherit from the base `atmos.yaml` and override only necessary settings. This reduces duplication and makes test maintenance easier.

## Usage

1. For new test scenarios, create a new directory under `scenarios/`
2. Inherit from the base configuration using:
```yaml
inherits:
- ../../atmos.yaml
```
3. Override only the necessary settings for your test case
## Best Practices
- Use vendoring for scenarios that need isolated components
- Leverage inheritance to reduce configuration duplication
- Keep shared components in the central `components/` directory
- Document scenario-specific requirements in a README within each scenario directory

0 comments on commit aee2abd

Please sign in to comment.