Skip to content

Add workflows: formatting/linting, unit tests, integration tests #1

Add workflows: formatting/linting, unit tests, integration tests

Add workflows: formatting/linting, unit tests, integration tests #1

name: Integration Tests
on:
push:
branches: [ main ]
paths:
- 'src/**/*.py'
- 'tests/**/*.py'
- 'pyproject.toml'
- '.github/workflows/integration-tests.yml'
pull_request:
branches: [ main ]
paths:
- 'src/**/*.py'
- 'tests/**/*.py'
- 'pyproject.toml'
- '.github/workflows/integration-tests.yml'
jobs:
integration-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.12']
loader: ['postgresql', 'redis', 'delta_lake', 'iceberg', 'lmdb']
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies for ${{ matrix.loader }}
run: |
uv sync --group ${{ matrix.loader }} --group test --group dev
- name: Run ${{ matrix.loader }} integration tests
env:
USE_TESTCONTAINERS: "true"
TESTCONTAINERS_RYUK_DISABLED: "true"
run: |
uv run pytest tests/integration/test_${{ matrix.loader }}_loader.py -v --tb=short -m "integration"
- name: Run ${{ matrix.loader }} integration tests with coverage
env:
USE_TESTCONTAINERS: "true"
TESTCONTAINERS_RYUK_DISABLED: "true"
run: |
uv run pytest tests/integration/test_${{ matrix.loader }}_loader.py -m "integration" \
--cov=src/amp/loaders/implementations/${{ matrix.loader }}_loader \
--cov-report=xml --cov-report=term-missing
- name: Upload coverage reports
uses: codecov/codecov-action@v4
if: always()
with:
file: ./coverage.xml
flags: integration-${{ matrix.loader }}
name: codecov-${{ matrix.loader }}
fail_ci_if_error: false
# Run all integration tests together to check for interactions
integration-tests-all:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.12']
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install all loader dependencies
run: |
uv sync --group all_loaders --group test --group dev
- name: Run all integration tests
env:
USE_TESTCONTAINERS: "true"
TESTCONTAINERS_RYUK_DISABLED: "true"
run: |
uv run pytest tests/integration/ -v --tb=short -m "integration" \
-k "not snowflake" # Skip Snowflake tests as they require paid account
- name: Run integration tests with coverage
env:
USE_TESTCONTAINERS: "true"
TESTCONTAINERS_RYUK_DISABLED: "true"
run: |
uv run pytest tests/integration/ -m "integration" -k "not snowflake" \
--cov=src/amp/loaders --cov-report=xml --cov-report=term-missing
- name: Upload coverage reports
uses: codecov/codecov-action@v4
if: always()
with:
file: ./coverage.xml
flags: integration-all
name: codecov-integration-all
fail_ci_if_error: false