Skip to content

LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows

3.5 KB
Raw Blame
[tox]
# Tier-shaped envs. Each env delegates to the rig at tests/rig/cli.py, which
# reads tests/groups.yaml and dispatches per-group pytest invocations.
#
#   tox -e unit                       # all unit groups
#   tox -e integration                # cross-service groups (needs infra)
#   tox -e e2e                        # full platform e2e
#   tox -e groups -- unit-backend e2e-smoke
#   tox -e groups -- --from-file .test-selection --no-coverage
#   tox -e groups -- all              # everything (equivalent to unit,integration,e2e)
#
# Pre-existing service envs (runner, sdk1) remain as thin
# aliases so existing CI commands continue to work during the migration.
env_list = unit, integration, e2e
requires = tox-uv>=0.2.0
isolated_build = True
# tox >=4.64 writes a PEP 832 `.venv` redirect file at the repo root pointing at
# a tox env, so editors can find an interpreter. That root is also a uv
# workspace, and the rig runs `uv run` there (unit-rig, e2e-smoke, and the
# coverage combine). uv reads `.venv` as the project environment and rejects a
# file, so every root-workdir invocation dies with "expected directory but found
# a file". Following the redirect would be worse than rejecting it: it aims at
# .tox/<env> (~97 packages: pytest, testcontainers, coverage), not the ~269
# package workspace env those groups need. Nothing here wants the redirect --
# a local checkout already has a real .venv directory, which tox leaves alone.
venv_redirect = false

[testenv]
# Shared base: install the rig itself + its python deps. Each tier env reuses
# this base so the rig CLI is importable everywhere.
install_command = uv pip install {opts} {packages}
skip_install = true
deps =
    uv
    pyyaml>=6.0
    requests>=2.31.0
    testcontainers[postgres,redis,minio,rabbitmq]>=4.7.0
    pytest>=8.0.1
    pytest-xdist>=3.5.0
    pytest-cov>=4.1.0
    pytest-md-report>=0.6.2
    pytest-timeout>=2.3.1
    coverage[toml]>=7.4.0
allowlist_externals =
    uv
    sh
    pytest
    docker
    hurl
passenv =
    CI
    GITHUB_*
    DOCKER_HOST
    UNSTRACT_*
    # The Agent-KV e2e lane's stack config (engine keys/models, storage prefix,
    # the caps its scenarios override) is read by
    # tests/compose/docker-compose.test.yaml from the caller's environment; tox
    # would otherwise strip it and the lane would silently run misconfigured.
    AGENT_KV_*
    # ComposeRuntime's `docker compose up` resolves ${VERSION} image tags in
    # docker/docker-compose.yaml from the caller's environment.
    VERSION
changedir = {toxinidir}

[testenv:unit]
commands = python -m tests.rig run --tier unit {posargs}

[testenv:integration]
commands = python -m tests.rig run --tier integration {posargs}

[testenv:e2e]
commands = python -m tests.rig run --tier e2e {posargs}

[testenv:groups]
# Catch-all: pass whatever you want to the rig.
#   tox -e groups -- unit-backend e2e-smoke
#   tox -e groups -- --from-file .test-selection --no-coverage
commands = python -m tests.rig run {posargs}

[testenv:rig]
# Utility env: list-groups, expand, validate, etc.
#   tox -e rig -- list-groups
#   tox -e rig -- expand e2e-workflow
commands = python -m tests.rig {posargs:list-groups}

# ── Legacy aliases ─────────────────────────────────────────────────────────────
# These mirror the pre-rig envs so existing scripts / CI snippets keep working
# during the migration. They delegate to the corresponding rig group.

[testenv:sdk1]
commands = python -m tests.rig run unit-sdk1 {posargs}