Skip to main content

tai42-e2e

The cross-repo, real-stack, end-to-end functional test suite for the tai / AgenticOS ecosystem. It boots the REAL deployment topology — a multi-worker uvicorn skeleton server, a separate backend worker process, a separate metrics server process, real Redis, real Postgres — and drives it over HTTP.

Why this suite exists. Every member suite (tai42-contract, tai42-kit, tai42-toolbox, tai42-agents, tai42-skeleton) is single-process, in-memory, and FakeRedis-backed by design, and stays that way. That leaves a whole class of bug invisible: the ones that live in the seam between processes — env-var ordering across a spawn boundary, a registry mutated on one worker and read on another, a socket flipped process-wide, a counter written in one process and scraped from another. tai-e2e is the only suite that can catch them, because it is the only one that runs the real multi-process topology.

Quickstart

docker compose up -d          # core profile: redis:7-alpine + postgres:16
uv python install 3.13
uv sync
uv run --no-sync pytest       # the default variant leg: arq + redis identity + local storage

The suite runs sequentially in one pytest process (no xdist by design — a stack is already 5-8 OS processes). A missing Redis/Postgres fails loudly at session start with the docker compose up -d hint. The shared Redis needs no modules — access control stores its records as plain hashes and counters.

The target: build a stack, or drive a running one

TAI_E2E_TARGET is the one switch, for the pytest suite and the browser suite in ui/:

  • Unset — the run builds its own stacks and drives them: each pytest stack spawns its tai processes on allocated loopback ports, and Playwright boots the studio stack through its webServer.
  • Set — the run builds nothing and drives that running stack. The value is either a bare origin (https://stack.example.com) or the name of a target file (staging reads targets/staging.yml).
TAI_E2E_TARGET=https://stack.example.com TAI_E2E_KEY=sk-... uv run --no-sync pytest
cd ui && TAI_E2E_TARGET=staging pnpm exec playwright test

A target file is small (see targets/example.yml):

url: https://stack.example.com
key_env: TAI_E2E_KEY   # the NAME of the variable holding the login key, never the key
provides:              # facts the stack cannot report about itself
  - probe-tools
  - mutable

Which kinds and plugins the stack has on is not written in the file: the run reads it once from the stack's GET /api/system/kinds, so a target has to serve that route (a run against one that does not stops at once, saying so). A bare origin is a target with no declared facts and the key in TAI_E2E_KEY. Against a target the run touches no Redis and no Postgres.

What a test needs

Every test declares what it needs from the stack, in one vocabulary shared by pytest and Playwright:

Need Met by Examples
kind:<kind>, kind:<kind>:<name> the stack reports that kind on (and names <name>) kind:storage, kind:channels:web
probe-tools, mutable, package-runners the target file lists it under provides the probe tools are loaded; the test changes stack-wide state; the stack can launch uvx and npx packages
process, store, files, helper, setting, topology, cli, metrics, second-stack, fixture-page, no-stack only a stack the run builds helper:llm, store:redis, setting:ACCESS_CONTROL_ENABLE=false
pytestmark = pytest.mark.needs("kind:storage", "mutable")   # a module

@pytest.mark.needs("process")                               # one test, added to the module's
async def test_restart_keeps_the_record(...): ...
import { needs, test } from './needs';

needs('kind:identity');   // the file, or a test.describe group

When the run builds its own stack, declarations change nothing. Against a target each test either fits the target's facts and runs, or is skipped with the unmet need as the reason — target reports kind sandbox off, needs process (...): only a stack this run builds has it. A test that declares nothing is built-stack only and is skipped too (a spec file that declares nothing is left out of the browser run). A test that needs nothing beyond the API and the key declares no facts: a bare @pytest.mark.needs, or needs() in a spec. An unknown need word fails collection.

In CI the e2e jobs read the target from the e2e_target input of a manual run, else from the TAI_E2E_TARGET repository variable, and the key from the TAI_E2E_KEY secret; with a target set they skip their service containers and every stack-building step.

The JUnit report

Every run writes a JUnit XML report: pytest writes junit.xml where it is invoked (addopts in pyproject.toml; a second invocation in the same directory passes its own --junitxml), and Playwright writes ui/junit.xml. A skipped test carries its reason. CI uploads the reports of each e2e job as an artifact and renders them into the job summary.

Variant legs

Every stack is rendered through a plugin VARIANT triple, selected per pytest process and printed in the run header. An unknown value fails loudly, naming the valid set.

Env var Values Default
TAI_E2E_BACKEND arq | rq | celery arq
TAI_E2E_IDENTITY redis | fixture (PG-backed, from tai42_e2e_fixtures) redis
TAI_E2E_STORAGE local | fixture (own on-disk layout) local
# the rq and celery backend legs — celery needs its broker
docker compose --profile celery up -d
TAI_E2E_BACKEND=rq     uv run --no-sync pytest -m "not backendless"
TAI_E2E_BACKEND=celery uv run --no-sync pytest -m "not backendless"

# the second identity/storage values, on the identity/storage-bearing suites
TAI_E2E_IDENTITY=fixture TAI_E2E_STORAGE=fixture uv run --no-sync pytest tests/redis_semantics tests/storage tests/harness

backendless marks a module whose stack runs no backend worker: it exercises no backend seam, so the non-default backend legs deselect it with -m "not backendless" instead of re-running it three times.

The checkpoint Redis (agents state)

The langgraph redis checkpoint/store provider needs the RediSearch + RedisJSON modules, which redis:7-alpine does not carry. A second, module-capable Redis is compose-gated behind the agents-redis profile and pointed at by TAI_E2E_CHECKPOINT_REDIS_URL (see .env.example); the specs that drive it skip loudly with the compose hint when it is unset, and session start fails loudly if the URL points at an image without the modules.

docker compose --profile agents-redis up -d

Bug classes

Bug class Test dir
Multiproc-metrics writer/reader split across processes tests/metrics/
Import-order / module-freeze of prometheus_client tests/metrics/
Cross-entrypoint lifecycle on the shared mmap dir tests/metrics/
Cross-worker registry divergence (sub-MCP, presets, tool-extensions) tests/crossworker/
Cross-process lost-update on shared config files tests/crossworker/
Cross-worker config-write exclusion (a marker on a key a concurrent profile drops) tests/crossworker/
Real-Redis / real-Postgres semantics (rate limit, AC, interactions, connectors) tests/redis_semantics/, tests/interactions/, tests/connectors/
Cross-repo running-service contract (agents, webhooks, tool-runs, storage, monitoring) tests/agents/, tests/webhooks/, ...
Process-global socket-state bleed (proxy extension) tests/proxy/
Reload / control-plane fan-out divergence tests/reload/
Plugin-switch (backend / identity / storage variants, broker isolation) tests/backend/, tests/storage/
Infra failure injection (worker crash, Redis/Postgres outage) tests/failures/
Scheduling across backends (schedule_task, the scheduler process) tests/scheduling/
Correctness under width (4 uvicorn workers, ≥32 in-flight) tests/scale/
Tool extensions through the stack (cache, chain, monitor, ask_external, output_schema) tests/extensions/
Memory of a long-lived serve under a repeated jq load (compute-pool children held and replaced, serve growth across passes, memory returned once idle) tests/memory/

Layout

  • src/tai42_e2e/ — the harness library (imported by tests, never by the SUT): boot engine (stack.py), process spawning (procs.py), Redis/PG/RabbitMQ admin (redisx.py, pg.py, rabbitx.py), the plugin-variant adapters (variants/), manifest/env profile builders (manifests/), the scripted LLM stub (llmstub.py), the severable TCP relay the outage specs inject with (tcprelay.py), the single waiting primitive (waiting.py), failure diagnostics (diagnostics.py), the per-process resident memory of a stack's serve tree (rss.py), and the memory budget a serve is held to (memory_budget.py).
  • src/tai42_e2e_fixtures/ — SUT-SIDE modules the spawned server imports via its manifest: the probe tools (tools/, the large structured document of the memory suite among them), the managed MCP server the fixture connector descriptors launch (managed_mcp_server.py), and the second value on each pluggable variant — the PG-backed identity provider (identity_provider.py), the storage backend (storage.py), and the monitoring backend (monitor_backend.py). The fixture connector descriptors themselves ride the manifest connectors field (built in tai42_e2e.manifests).
  • tests/ — the suites by bug class, plus tests/harness/ self-tests.
  • docs/adding-a-test.md — the 7-step recipe for a new feature's e2e test.

Metrics-dir isolation (the hard rule)

The harness NEVER sets PROMETHEUS_MULTIPROC_DIR in a child env — stamping it is the entrypoint's own job (activate_multiproc_env) and is exactly what the import-order tests verify. Per-stack (and per-replica) metrics dirs are controlled entirely via TMPDIR: MetricsSettings.prometheus_multiproc_dir defaults to <tempfile.gettempdir()>/tai42_prometheus, so pointing a process's TMPDIR at a per-run-family dir gives that family its own multiproc dir with the env var untouched. stack.py asserts the rule on every child env.

xfail policy

A test for a fix that has not yet landed in the workspace is marked xfail(strict=True) with the observed-behavior reason, so it flips loudly (xpass → failure) the moment the fix lands.

CI

The fleet e2e runs from the monorepo root workflow, .github/workflows/ci.yml, in two jobs gated by the changes filter (any member carrying an e2e trigger, or a change to a shared root, sets run_e2e):

  • e2e — one matrix leg per triggered backend (arq, rq, celery), under TAI_E2E_FLEET=1 with redis identity and local storage. Services: redis:7-alpine (shared), postgres:16-alpine, and redis:8 — the module-capable checkpoint Redis the arq leg points TAI_E2E_CHECKPOINT_REDIS_URL at. The celery leg brings its RabbitMQ up from the compose celery profile; non-arq legs deselect -m "not backendless". The langfuse monitoring profile runs on the arq leg only when the run_monitoring gate is on (a change under plugins/monitoring-langfuse, core, or e2e, or a manual workflow_dispatch). When the private-repo token is present it also runs the marketplace suite (TAI_E2E_MARKETPLACE=1), installing the git-sourced tai42-marketplace and booting it as harness processes.
  • ui-e2e — needs e2e; boots redis + postgres, clones tai-studio, builds the Studio SPA and the reference plugin, and runs the Playwright chromium suite in ui/. When the run_browsers gate is on (a change under e2e/ui, or a manual workflow_dispatch) it also widens the matrix onto firefox + webkit. With the token it also clones the private tai-marketplace monorepo (its web/ workspace is the browse site) and runs the marketplace browser specs under TAI_E2E_MARKETPLACE=1.
  • e2e-memory — the memory suite (TAI_E2E_MEMORY=1, see "Memory area" below): boots a two-worker serve with the chain extension on the jemalloc allocator environment, runs the same 64 jq programs eight times over a ~20 MiB document, with two plain document calls beside every batch so executor threads build it too, samples the serve's process tree idle before the load, between batches and idle after it, and fails when jemalloc is not mapped in the serve or PYTHONMALLOC=malloc is not in its environment, when a compute-pool child reaches 360 MiB, when the idle serve ends above 1.5x its size after the first pass or still holds half or more of what the load grew it above its idle baseline, when the compute-pool children were never replaced, or when a call was lost. It runs on the release-please train branch (the PR tree that gets tagged and published on merge) and on the memory lane of a manual workflow_dispatch, never on other PRs or pushes, and needs the redis:7-alpine and postgres:16-alpine service containers and the libjemalloc2 package, which it installs.

The marketplace legs need the private tai42ai/tai-marketplace repo, so they run only when the RELEASE_PLEASE_TOKEN secret is available — a fork PR has no secrets, so those steps skip with a visible ::warning:: rather than failing. Other external consumers install this harness as the published tai42-e2e package and run their own suites against it. Any consumer booting the studio stack must also install the Studio reference plugin, which the studio profile manifest names but the harness does not carry as a dependency. The browser legs build it from the same tai42ai/tai-studio checkout as the SPA (pnpm --filter @tai42/e2e run build:reference-plugin) and install tai-studio/e2e/reference-plugin into the synced venv with --no-deps, so its bundle always targets that checkout's plugin API version.

Marketplace area (opt-in)

tests/marketplace/ only collects when TAI_E2E_MARKETPLACE=1; unset, it is skipped at collection like tests/monitoring/. When on, the harness installs the tai42-marketplace registry out-of-band from its pinned git source at boot and boots it — as a harness-managed process (the API server) on an isolated Postgres database: no extra compose profile; it rides the core docker compose up -d infra. The suite forges REAL fixture wheels (and one source tarball) from the in-repo fixtures/marketplace_plugins tree (TAI_E2E_MARKETPLACE_FIXTURES overrides it), served over a local package index, seeds them through the registry's real ingest pipeline, which publishes each version synchronously, and the skeleton REALLY pip-builds them into each stack's own TAI_PLUGINS_DIR — in-process plugins into its plugin layer, an mcp-server package into its own environment there — so every lifecycle spec ends with its own uninstall, and a session guard raises loudly if any fixture distribution ever lands in the harness's own venv, which stands in for the image (never auto-cleaning). The ui leg additionally pnpm-builds and serves the public tai-marketplace/web checkout and drives the Studio marketplace page and the public site over a browser.

docker compose up -d
TAI_E2E_MARKETPLACE=1 uv run --no-sync pytest tests/marketplace
# the browser legs (built Studio dist + the tai-marketplace/web checkout):
cd ui && TAI_E2E_MARKETPLACE=1 pnpm exec playwright test tests/marketplace.spec.ts tests/marketplace-web.spec.ts

TAI_E2E_MARKETPLACE_REF (unset by default) pins the registry to a specific tai-marketplace commit instead of the checked-in pin: the value must be a full 40-char lowercase-hex sha, the dedicated registry venv is keyed by it, and the out-of-band install resolves that commit. The fleet-e2e workflow sets it to the source sha under test when a tai-marketplace push drives the run, so the registry boots at the exact commit being validated. Reproduce a dispatched run locally:

TAI_E2E_MARKETPLACE_REF=<40-hex-sha> TAI_E2E_MARKETPLACE=1 uv run --no-sync pytest tests/marketplace

Memory area (opt-in)

tests/memory/ only collects when TAI_E2E_MEMORY=1; unset, it is skipped at collection like tests/monitoring/. It boots one stack, memory_stack: a tai serve --workers 2 with no backend and no metrics process, the chain tool extension over the e2e_document probe, the default two compute-pool children per worker, and COMPUTE_WORKER_MAX_TASKS=128, so every compute-pool child is replaced inside the load. Every process of the stack runs on the allocator environment a deployment sets, LD_PRELOAD=libjemalloc.so.2, MALLOC_CONF=background_thread:true and PYTHONMALLOC=malloc: CPython serves small objects from arenas it maps outside malloc and unmaps only when wholly empty, and PYTHONMALLOC=malloc sends every allocation through jemalloc instead. Before the first sample the suite reads /proc/<serve pid>/maps and fails unless jemalloc is mapped in the serve, and reads /proc/<serve pid>/environ and fails unless PYTHONMALLOC=malloc is in it. The suite therefore runs on Linux with the libjemalloc2 package installed (apt-get install libjemalloc2 on Debian or Ubuntu).

The load runs 64 distinct jq programs, eight times each, as chained e2e_document_chain -> jq -> e2e_record calls through POST /api/run-tool, eight at a time, over a structured document of at least 20 MiB of JSON the serve builds itself. Beside every batch, two plain e2e_document calls go through the same door: it runs a sync tool on an executor thread of the uvicorn worker, so those threads build the document too, while the chained calls build it on the event loop. Before it starts, the suite checks the document's size, then sends rounds of chained probe calls, as many at once as the stack has compute-pool children, until every worker's compute pool is up (a pool starts on its worker's first job), each call checking that jq receives the document as an array; it then takes the idle baseline over that complete tree. An idle wait samples the serve every second for 30 s and its last sample is the reading: jemalloc returns memory in steps with flat stretches of several seconds, so a short run of equal readings does not mark the end. After every batch the suite reads the serve's process tree from one ps snapshot, and logs it with each worker's thread count. After the last pass the same idle wait gives the end.

The budget (tai42_e2e/memory_budget.py): no compute-pool child in any sample at or above 360 MiB; the serve's idle total at the end at most 1.5x its total after the first pass; of what the highest total sampled after the baseline rose above it, the end still holding less than half (a load that never rose above the baseline fails); at least one compute-pool child replaced after the first pass; every program recorded once per pass. The test logs the baseline, first-pass, peak and end totals, the largest child and the elapsed time.

docker compose up -d
TAI_E2E_MEMORY=1 uv run --no-sync pytest tests/memory

Metadata

Release files for tai42-e2e 32.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tai42-e2e 32.1.0
File Size Uploaded Provenance Actions
tai42_e2e-32.1.0.tar.gz 342.4 kB Without provenance Details for tai42_e2e-32.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tai42-e2e 32.1.0
File Interpreter ABI Platform Actions
tai42_e2e-32.1.0-py3-none-any.whl Python 3 none any Details for tai42_e2e-32.1.0-py3-none-any.whl

Total release size: 741.6 kB

Release files / tai42_e2e-32.1.0.tar.gz

Download URL tai42_e2e-32.1.0.tar.gz
Size 342.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a84da9793c7168a095ccf2ce55e236d946467a32418f189b92f357dc7a8107a9
BLAKE2b-256 checksum
How to use checksums
9d757bec37708ee5cf0087b9ed3e9046570135a8c92269886c84c25b7b8f1998
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / tai42_e2e-32.1.0-py3-none-any.whl

Download URL tai42_e2e-32.1.0-py3-none-any.whl
Size 399.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a18b85662a809c9c8ec8c25e3d689be702b19691c1c2d2faa013e2de5e580c78
BLAKE2b-256 checksum
How to use checksums
a4ece4ae8b215e6a2cc6db69e38c787e1a164dd9d5404f53232b7d725918e414
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for tai42-e2e 32.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

32.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page