tai42-e2e 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. tai42_e2e-0.3.0/LICENSE +202 -0
  2. tai42_e2e-0.3.0/NOTICE +9 -0
  3. tai42_e2e-0.3.0/PKG-INFO +234 -0
  4. tai42_e2e-0.3.0/README.md +177 -0
  5. tai42_e2e-0.3.0/pyproject.toml +247 -0
  6. tai42_e2e-0.3.0/setup.cfg +4 -0
  7. tai42_e2e-0.3.0/src/tai42_e2e/__init__.py +19 -0
  8. tai42_e2e-0.3.0/src/tai42_e2e/_threaded.py +44 -0
  9. tai42_e2e-0.3.0/src/tai42_e2e/booting.py +73 -0
  10. tai42_e2e-0.3.0/src/tai42_e2e/diagnostics.py +67 -0
  11. tai42_e2e-0.3.0/src/tai42_e2e/harness.py +466 -0
  12. tai42_e2e-0.3.0/src/tai42_e2e/httpapi.py +151 -0
  13. tai42_e2e-0.3.0/src/tai42_e2e/llmstub.py +278 -0
  14. tai42_e2e-0.3.0/src/tai42_e2e/manifests.py +1583 -0
  15. tai42_e2e-0.3.0/src/tai42_e2e/marketplace.py +535 -0
  16. tai42_e2e-0.3.0/src/tai42_e2e/mcp.py +89 -0
  17. tai42_e2e-0.3.0/src/tai42_e2e/metrics.py +45 -0
  18. tai42_e2e-0.3.0/src/tai42_e2e/netfixtures.py +1101 -0
  19. tai42_e2e-0.3.0/src/tai42_e2e/pg.py +107 -0
  20. tai42_e2e-0.3.0/src/tai42_e2e/pkgsource.py +379 -0
  21. tai42_e2e-0.3.0/src/tai42_e2e/ports.py +58 -0
  22. tai42_e2e-0.3.0/src/tai42_e2e/procs.py +162 -0
  23. tai42_e2e-0.3.0/src/tai42_e2e/py.typed +0 -0
  24. tai42_e2e-0.3.0/src/tai42_e2e/pytest_plugin.py +156 -0
  25. tai42_e2e-0.3.0/src/tai42_e2e/rabbitx.py +87 -0
  26. tai42_e2e-0.3.0/src/tai42_e2e/redisx.py +103 -0
  27. tai42_e2e-0.3.0/src/tai42_e2e/settings.py +90 -0
  28. tai42_e2e-0.3.0/src/tai42_e2e/stack.py +951 -0
  29. tai42_e2e-0.3.0/src/tai42_e2e/studio_runner.py +516 -0
  30. tai42_e2e-0.3.0/src/tai42_e2e/tcprelay.py +265 -0
  31. tai42_e2e-0.3.0/src/tai42_e2e/variants.py +468 -0
  32. tai42_e2e-0.3.0/src/tai42_e2e/waiting.py +78 -0
  33. tai42_e2e-0.3.0/src/tai42_e2e.egg-info/PKG-INFO +234 -0
  34. tai42_e2e-0.3.0/src/tai42_e2e.egg-info/SOURCES.txt +46 -0
  35. tai42_e2e-0.3.0/src/tai42_e2e.egg-info/dependency_links.txt +1 -0
  36. tai42_e2e-0.3.0/src/tai42_e2e.egg-info/entry_points.txt +5 -0
  37. tai42_e2e-0.3.0/src/tai42_e2e.egg-info/requires.txt +37 -0
  38. tai42_e2e-0.3.0/src/tai42_e2e.egg-info/top_level.txt +2 -0
  39. tai42_e2e-0.3.0/src/tai42_e2e_fixtures/__init__.py +4 -0
  40. tai42_e2e-0.3.0/src/tai42_e2e_fixtures/connector_provider.py +161 -0
  41. tai42_e2e-0.3.0/src/tai42_e2e_fixtures/embed_main.py +57 -0
  42. tai42_e2e-0.3.0/src/tai42_e2e_fixtures/identity_provider.py +176 -0
  43. tai42_e2e-0.3.0/src/tai42_e2e_fixtures/managed_mcp_server.py +55 -0
  44. tai42_e2e-0.3.0/src/tai42_e2e_fixtures/monitor_backend.py +71 -0
  45. tai42_e2e-0.3.0/src/tai42_e2e_fixtures/py.typed +0 -0
  46. tai42_e2e-0.3.0/src/tai42_e2e_fixtures/storage.py +129 -0
  47. tai42_e2e-0.3.0/src/tai42_e2e_fixtures/stub_channel.py +35 -0
  48. tai42_e2e-0.3.0/src/tai42_e2e_fixtures/tools.py +176 -0
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
tai42_e2e-0.3.0/NOTICE ADDED
@@ -0,0 +1,9 @@
1
+ tai42
2
+ Copyright 2026 tai42
3
+
4
+ This product includes software developed at tai42 (https://tai42.ai).
5
+ Licensed under the Apache License, Version 2.0.
6
+
7
+ This repository packages the tai42 core libraries (tai42-contract, tai42-kit,
8
+ tai42-skeleton), the tai42 plugins, and the tai42-e2e harness. Each distributed
9
+ package carries the same attribution above.
@@ -0,0 +1,234 @@
1
+ Metadata-Version: 2.4
2
+ Name: tai42-e2e
3
+ Version: 0.3.0
4
+ Summary: Cross-repo end-to-end functional test suite for the tai / AgenticOS ecosystem: boots the real multi-process deployment topology (multi-worker skeleton server, backend worker, metrics server, real Redis, real Postgres) and exercises it over HTTP.
5
+ Author-email: tai42 <oss@tai42.ai>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://tai42.ai
8
+ Keywords: mcp,e2e,integration-tests,cross-process,tai
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.13
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Typing :: Typed
15
+ Requires-Python: >=3.13
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ License-File: NOTICE
19
+ Requires-Dist: tai42-contract<0.4,>=0.3
20
+ Requires-Dist: tai42-kit[curl,jq,llm,postgres,redis,uvicorn]<0.3,>=0.2
21
+ Requires-Dist: tai42-skeleton[files,toolbox]<0.5,>=0.4
22
+ Requires-Dist: tai42-toolbox[chain,http,prometheus,proxy]<0.4,>=0.3
23
+ Requires-Dist: tai42-tools-stripe<0.4,>=0.3
24
+ Requires-Dist: tai42-agents<0.4,>=0.3
25
+ Requires-Dist: tai42-identity-redis<0.3,>=0.2
26
+ Requires-Dist: tai42-accounts-postgres<0.4,>=0.3
27
+ Requires-Dist: tai42-accounts-oidc<0.3,>=0.2
28
+ Requires-Dist: tai42-identity-oidc<0.3,>=0.2
29
+ Requires-Dist: tai42-backend-arq<0.4,>=0.3
30
+ Requires-Dist: tai42-backend-celery<0.4,>=0.3
31
+ Requires-Dist: tai42-backend-rq<0.4,>=0.3
32
+ Requires-Dist: tai42-storage-local<0.3,>=0.2
33
+ Requires-Dist: tai42-webhook-verifier-github<0.3,>=0.2
34
+ Requires-Dist: tai42-webhook-verifier-stripe<0.3,>=0.2
35
+ Requires-Dist: tai42-channel-telegram<0.3,>=0.2
36
+ Requires-Dist: tai42-channel-slack<0.3,>=0.2
37
+ Requires-Dist: tai42-channel-twilio<0.3,>=0.2
38
+ Requires-Dist: tai42-channel-whatsapp<0.3,>=0.2
39
+ Requires-Dist: tai42-monitoring-langfuse<0.3,>=0.2
40
+ Requires-Dist: pytest>=8
41
+ Requires-Dist: pytest-asyncio>=0.25
42
+ Requires-Dist: pytest-timeout>=2.3
43
+ Requires-Dist: httpx>=0.28
44
+ Requires-Dist: fastmcp<4,>=3.2
45
+ Requires-Dist: redis>=5
46
+ Requires-Dist: psycopg[binary]>=3.2
47
+ Requires-Dist: prometheus-client>=0.24
48
+ Requires-Dist: joserfc<2,>=1.7
49
+ Requires-Dist: fastapi>=0.135
50
+ Requires-Dist: uvicorn>=0.43
51
+ Requires-Dist: pydantic>=2.12
52
+ Requires-Dist: pydantic-settings>=2.13
53
+ Requires-Dist: PyYAML>=6.0
54
+ Requires-Dist: celery<6,>=5.6
55
+ Requires-Dist: celery-pydantic<2,>=1.0
56
+ Dynamic: license-file
57
+
58
+ # tai42-e2e
59
+
60
+ The cross-repo, real-stack, end-to-end functional test suite for the tai /
61
+ AgenticOS ecosystem. It boots the REAL deployment topology — a multi-worker
62
+ uvicorn skeleton server, a separate backend worker process, a separate metrics
63
+ server process, real Redis, real Postgres — and drives it over HTTP.
64
+
65
+ **Why this suite exists.** Every member suite (tai42-contract, tai42-kit,
66
+ tai42-toolbox, tai42-agents, tai42-skeleton) is single-process, in-memory, and
67
+ FakeRedis-backed by design, and stays that way. That leaves a whole class of
68
+ bug invisible: the ones that live in the seam between processes — env-var
69
+ ordering across a spawn boundary, a registry mutated on one worker and read on
70
+ another, a socket flipped process-wide, a counter written in one process and
71
+ scraped from another. `tai-e2e` is the only suite that can catch them, because
72
+ it is the only one that runs the real multi-process topology.
73
+
74
+ ## Quickstart
75
+
76
+ ```bash
77
+ docker compose up -d # core profile: redis:7-alpine + postgres:16
78
+ uv python install 3.13
79
+ uv sync
80
+ uv run pytest # the default variant leg: arq + redis identity + local storage
81
+ ```
82
+
83
+ The suite runs sequentially in one pytest process (no xdist by design — a stack
84
+ is already 5-8 OS processes). A missing Redis/Postgres fails loudly at session
85
+ start with the `docker compose up -d` hint. The shared Redis needs no modules —
86
+ access control stores its records as plain hashes and counters.
87
+
88
+ ### Variant legs
89
+
90
+ Every stack is rendered through a plugin VARIANT triple, selected per pytest
91
+ process and printed in the run header. An unknown value fails loudly, naming the
92
+ valid set.
93
+
94
+ | Env var | Values | Default |
95
+ |---------|--------|---------|
96
+ | `TAI_E2E_BACKEND` | `arq` \| `rq` \| `celery` | `arq` |
97
+ | `TAI_E2E_IDENTITY` | `redis` \| `fixture` (PG-backed, from `tai42_e2e_fixtures`) | `redis` |
98
+ | `TAI_E2E_STORAGE` | `local` \| `fixture` (own on-disk layout) | `local` |
99
+
100
+ ```bash
101
+ # the rq and celery backend legs — celery needs its broker
102
+ docker compose --profile celery up -d
103
+ TAI_E2E_BACKEND=rq uv run pytest -m "not backendless"
104
+ TAI_E2E_BACKEND=celery uv run pytest -m "not backendless"
105
+
106
+ # the second identity/storage values, on the identity/storage-bearing suites
107
+ TAI_E2E_IDENTITY=fixture TAI_E2E_STORAGE=fixture uv run pytest tests/redis_semantics tests/storage tests/harness
108
+ ```
109
+
110
+ `backendless` marks a module whose stack runs no backend worker: it exercises no
111
+ backend seam, so the non-default backend legs deselect it with
112
+ `-m "not backendless"` instead of re-running it three times.
113
+
114
+ ### The checkpoint Redis (agents state)
115
+
116
+ The langgraph `redis` checkpoint/store provider needs the RediSearch + RedisJSON
117
+ modules, which `redis:7-alpine` does not carry. A second, module-capable Redis is
118
+ compose-gated behind the `agents-redis` profile and pointed at by
119
+ `TAI_E2E_CHECKPOINT_REDIS_URL` (see `.env.example`); the specs that drive it skip
120
+ loudly with the compose hint when it is unset, and session start fails loudly if
121
+ the URL points at an image without the modules.
122
+
123
+ ```bash
124
+ docker compose --profile agents-redis up -d
125
+ ```
126
+
127
+ ## Seam classes
128
+
129
+ | # | Bug class | Test dir |
130
+ |---|-----------|----------|
131
+ | C1 | Multiproc-metrics writer/reader split across processes | `tests/metrics/` |
132
+ | C2 | Import-order / module-freeze of `prometheus_client` | `tests/metrics/` |
133
+ | C3 | Cross-entrypoint lifecycle on the shared mmap dir | `tests/metrics/` |
134
+ | C4 | Cross-worker registry divergence (sub-MCP, presets, tool-extensions) | `tests/crossworker/` |
135
+ | C5 | Cross-process lost-update on shared config files | `tests/crossworker/` |
136
+ | C6 | Real-Redis / real-Postgres semantics (rate limit, AC, interactions, connectors) | `tests/redis_semantics/`, `tests/interactions/`, `tests/connectors/` |
137
+ | C7 | Cross-repo running-service contract (agents, webhooks, tool-runs, storage, monitoring) | `tests/agents/`, `tests/webhooks/`, ... |
138
+ | C8 | Process-global socket-state bleed (proxy extension) | `tests/proxy/` |
139
+ | C9 | Reload / control-plane fan-out divergence | `tests/reload/` |
140
+ | P1 | Plugin-seam switch (backend / identity / storage variants, broker isolation) | `tests/backend/`, `tests/storage/` |
141
+ | P2 | Infra failure injection (worker crash, Redis/Postgres outage) | `tests/failures/` |
142
+ | P3 | Scheduling across backends (`schedule_task`, the scheduler process) | `tests/scheduling/` |
143
+ | P4 | Correctness under width (4 uvicorn workers, ≥32 in-flight) | `tests/scale/` |
144
+ | P5 | Tool extensions through the stack (cache, chain, monitor, ask_external, output_schema) | `tests/extensions/` |
145
+
146
+ ## Layout
147
+
148
+ - `src/tai42_e2e/` — the harness library (imported by tests, never by the SUT):
149
+ boot engine (`stack.py`), process spawning (`procs.py`), Redis/PG/RabbitMQ admin
150
+ (`redisx.py`, `pg.py`, `rabbitx.py`), the plugin-variant adapters (`variants.py`),
151
+ manifest/env profile builders (`manifests.py`), the scripted LLM stub
152
+ (`llmstub.py`), the net fixtures (`netfixtures.py`), the severable TCP relay the
153
+ outage specs inject with (`tcprelay.py`), the single waiting primitive
154
+ (`waiting.py`), and failure diagnostics (`diagnostics.py`).
155
+ - `src/tai42_e2e_fixtures/` — SUT-SIDE modules the spawned server imports via its
156
+ manifest: the probe tools (`tools.py`), the fixture OAuth connector provider
157
+ (`connector_provider.py`), and the second value on each pluggable axis — the
158
+ PG-backed identity provider (`identity_provider.py`), the storage backend
159
+ (`storage.py`), and the monitoring backend (`monitor_backend.py`).
160
+ - `tests/` — the suites by seam class, plus `tests/harness/` self-tests.
161
+ - `docs/adding-a-test.md` — the 6-step recipe for a new feature's e2e test.
162
+
163
+ ## Metrics-dir isolation (the C2 hard rule)
164
+
165
+ The harness NEVER sets `PROMETHEUS_MULTIPROC_DIR` in a child env — stamping it
166
+ is the entrypoint's own job (`activate_multiproc_env`) and is exactly what the
167
+ C2 import-order tests verify. Per-stack (and per-replica) metrics dirs are
168
+ controlled entirely via `TMPDIR`: `MetricsSettings.prometheus_multiproc_dir`
169
+ defaults to `<tempfile.gettempdir()>/tai42_prometheus`, so pointing a process's
170
+ `TMPDIR` at a per-run-family dir gives that family its own multiproc dir with
171
+ the env var untouched. `stack.py` asserts the rule on every child env.
172
+
173
+ ## xfail policy
174
+
175
+ A test for a fix that has not yet landed in the workspace is marked
176
+ `xfail(strict=True)` with the observed-behavior reason, so it flips loudly
177
+ (xpass → failure) the moment the fix lands.
178
+
179
+ ## CI
180
+
181
+ The fleet e2e runs from the monorepo root workflow, `.github/workflows/ci.yml`,
182
+ in two jobs gated by the `changes` filter (any member carrying an e2e trigger, or
183
+ a change to a shared root, sets `run_e2e`):
184
+
185
+ - `e2e` — one matrix leg per triggered backend (`arq`, `rq`, `celery`), under
186
+ `TAI_E2E_FLEET=1` with `redis` identity and `local` storage. Services:
187
+ `redis:7-alpine` (shared), `postgres:16-alpine`, and `redis:8` — the
188
+ module-capable checkpoint Redis the arq leg points
189
+ `TAI_E2E_CHECKPOINT_REDIS_URL` at. The celery leg brings its RabbitMQ up from
190
+ the compose `celery` profile; non-arq legs deselect `-m "not backendless"`. The
191
+ langfuse monitoring profile runs on the arq leg only when the `run_monitoring`
192
+ gate is on (a change under `plugins/monitoring-langfuse`, `core`, or `e2e`, or a
193
+ manual `workflow_dispatch`). When the private-repo token is present it also runs
194
+ the marketplace suite (`TAI_E2E_MARKETPLACE=1`), installing the git-sourced
195
+ `tai42-marketplace` and booting it as harness processes.
196
+ - `ui-e2e` — needs `e2e`; boots redis + postgres, clones `tai-studio`, builds the
197
+ Studio SPA, and runs the Playwright chromium suite in `ui/`. When the `run_browsers`
198
+ gate is on (a change under `e2e/ui`, or a manual `workflow_dispatch`) it also
199
+ widens the matrix onto firefox + webkit. With the token it also clones the private
200
+ `tai-marketplace-web` and runs the marketplace browser specs under
201
+ `TAI_E2E_MARKETPLACE=1`.
202
+
203
+ The marketplace legs need the private `tai42ai/tai-marketplace` and
204
+ `tai42ai/tai-marketplace-web` repos, so they run only when the `RELEASE_PLEASE_TOKEN`
205
+ secret is available — a fork PR has no secrets, so those steps skip with a visible
206
+ `::warning::` rather than failing. Other external consumers install this harness as
207
+ the published `tai42-e2e` package and run their own suites against it. Any consumer
208
+ booting the studio stack must also install the Studio reference plugin from the
209
+ `tai42ai/tai-studio` repo (`e2e/reference-plugin`), which the studio profile manifest
210
+ names but the harness does not carry as a runtime dependency.
211
+
212
+ ## Marketplace area (opt-in)
213
+
214
+ `tests/marketplace/` only collects when `TAI_E2E_MARKETPLACE=1`; unset, it is
215
+ skipped at collection like `tests/monitoring/`. When on, the harness boots the
216
+ `tai42-marketplace` registry — installed from its git source via the `marketplace`
217
+ dependency group — as a harness-managed process (the API server) on an isolated
218
+ Postgres database: **no extra compose profile**; it rides the core
219
+ `docker compose up -d` infra. The suite forges REAL fixture wheels (and one source
220
+ tarball) from the in-repo `fixtures/marketplace_plugins` tree
221
+ (`TAI_E2E_MARKETPLACE_FIXTURES` overrides it), served over a local package index,
222
+ seeds them through the registry's real ingest pipeline, which publishes each version
223
+ synchronously, and the skeleton REALLY pip-installs them into the one shared venv —
224
+ so every lifecycle spec ends with its own uninstall and a session guard raises loudly
225
+ on any leftover distribution (never auto-cleaning). The ui leg additionally
226
+ pnpm-builds and serves the public `tai-marketplace-web` checkout and drives the Studio
227
+ marketplace page and the public site over a browser.
228
+
229
+ ```bash
230
+ docker compose up -d
231
+ TAI_E2E_MARKETPLACE=1 uv run pytest tests/marketplace
232
+ # the browser legs (built Studio dist + the tai-marketplace-web checkout):
233
+ cd ui && TAI_E2E_MARKETPLACE=1 pnpm exec playwright test tests/marketplace.spec.ts tests/marketplace-web.spec.ts
234
+ ```
@@ -0,0 +1,177 @@
1
+ # tai42-e2e
2
+
3
+ The cross-repo, real-stack, end-to-end functional test suite for the tai /
4
+ AgenticOS ecosystem. It boots the REAL deployment topology — a multi-worker
5
+ uvicorn skeleton server, a separate backend worker process, a separate metrics
6
+ server process, real Redis, real Postgres — and drives it over HTTP.
7
+
8
+ **Why this suite exists.** Every member suite (tai42-contract, tai42-kit,
9
+ tai42-toolbox, tai42-agents, tai42-skeleton) is single-process, in-memory, and
10
+ FakeRedis-backed by design, and stays that way. That leaves a whole class of
11
+ bug invisible: the ones that live in the seam between processes — env-var
12
+ ordering across a spawn boundary, a registry mutated on one worker and read on
13
+ another, a socket flipped process-wide, a counter written in one process and
14
+ scraped from another. `tai-e2e` is the only suite that can catch them, because
15
+ it is the only one that runs the real multi-process topology.
16
+
17
+ ## Quickstart
18
+
19
+ ```bash
20
+ docker compose up -d # core profile: redis:7-alpine + postgres:16
21
+ uv python install 3.13
22
+ uv sync
23
+ uv run pytest # the default variant leg: arq + redis identity + local storage
24
+ ```
25
+
26
+ The suite runs sequentially in one pytest process (no xdist by design — a stack
27
+ is already 5-8 OS processes). A missing Redis/Postgres fails loudly at session
28
+ start with the `docker compose up -d` hint. The shared Redis needs no modules —
29
+ access control stores its records as plain hashes and counters.
30
+
31
+ ### Variant legs
32
+
33
+ Every stack is rendered through a plugin VARIANT triple, selected per pytest
34
+ process and printed in the run header. An unknown value fails loudly, naming the
35
+ valid set.
36
+
37
+ | Env var | Values | Default |
38
+ |---------|--------|---------|
39
+ | `TAI_E2E_BACKEND` | `arq` \| `rq` \| `celery` | `arq` |
40
+ | `TAI_E2E_IDENTITY` | `redis` \| `fixture` (PG-backed, from `tai42_e2e_fixtures`) | `redis` |
41
+ | `TAI_E2E_STORAGE` | `local` \| `fixture` (own on-disk layout) | `local` |
42
+
43
+ ```bash
44
+ # the rq and celery backend legs — celery needs its broker
45
+ docker compose --profile celery up -d
46
+ TAI_E2E_BACKEND=rq uv run pytest -m "not backendless"
47
+ TAI_E2E_BACKEND=celery uv run pytest -m "not backendless"
48
+
49
+ # the second identity/storage values, on the identity/storage-bearing suites
50
+ TAI_E2E_IDENTITY=fixture TAI_E2E_STORAGE=fixture uv run pytest tests/redis_semantics tests/storage tests/harness
51
+ ```
52
+
53
+ `backendless` marks a module whose stack runs no backend worker: it exercises no
54
+ backend seam, so the non-default backend legs deselect it with
55
+ `-m "not backendless"` instead of re-running it three times.
56
+
57
+ ### The checkpoint Redis (agents state)
58
+
59
+ The langgraph `redis` checkpoint/store provider needs the RediSearch + RedisJSON
60
+ modules, which `redis:7-alpine` does not carry. A second, module-capable Redis is
61
+ compose-gated behind the `agents-redis` profile and pointed at by
62
+ `TAI_E2E_CHECKPOINT_REDIS_URL` (see `.env.example`); the specs that drive it skip
63
+ loudly with the compose hint when it is unset, and session start fails loudly if
64
+ the URL points at an image without the modules.
65
+
66
+ ```bash
67
+ docker compose --profile agents-redis up -d
68
+ ```
69
+
70
+ ## Seam classes
71
+
72
+ | # | Bug class | Test dir |
73
+ |---|-----------|----------|
74
+ | C1 | Multiproc-metrics writer/reader split across processes | `tests/metrics/` |
75
+ | C2 | Import-order / module-freeze of `prometheus_client` | `tests/metrics/` |
76
+ | C3 | Cross-entrypoint lifecycle on the shared mmap dir | `tests/metrics/` |
77
+ | C4 | Cross-worker registry divergence (sub-MCP, presets, tool-extensions) | `tests/crossworker/` |
78
+ | C5 | Cross-process lost-update on shared config files | `tests/crossworker/` |
79
+ | C6 | Real-Redis / real-Postgres semantics (rate limit, AC, interactions, connectors) | `tests/redis_semantics/`, `tests/interactions/`, `tests/connectors/` |
80
+ | C7 | Cross-repo running-service contract (agents, webhooks, tool-runs, storage, monitoring) | `tests/agents/`, `tests/webhooks/`, ... |
81
+ | C8 | Process-global socket-state bleed (proxy extension) | `tests/proxy/` |
82
+ | C9 | Reload / control-plane fan-out divergence | `tests/reload/` |
83
+ | P1 | Plugin-seam switch (backend / identity / storage variants, broker isolation) | `tests/backend/`, `tests/storage/` |
84
+ | P2 | Infra failure injection (worker crash, Redis/Postgres outage) | `tests/failures/` |
85
+ | P3 | Scheduling across backends (`schedule_task`, the scheduler process) | `tests/scheduling/` |
86
+ | P4 | Correctness under width (4 uvicorn workers, ≥32 in-flight) | `tests/scale/` |
87
+ | P5 | Tool extensions through the stack (cache, chain, monitor, ask_external, output_schema) | `tests/extensions/` |
88
+
89
+ ## Layout
90
+
91
+ - `src/tai42_e2e/` — the harness library (imported by tests, never by the SUT):
92
+ boot engine (`stack.py`), process spawning (`procs.py`), Redis/PG/RabbitMQ admin
93
+ (`redisx.py`, `pg.py`, `rabbitx.py`), the plugin-variant adapters (`variants.py`),
94
+ manifest/env profile builders (`manifests.py`), the scripted LLM stub
95
+ (`llmstub.py`), the net fixtures (`netfixtures.py`), the severable TCP relay the
96
+ outage specs inject with (`tcprelay.py`), the single waiting primitive
97
+ (`waiting.py`), and failure diagnostics (`diagnostics.py`).
98
+ - `src/tai42_e2e_fixtures/` — SUT-SIDE modules the spawned server imports via its
99
+ manifest: the probe tools (`tools.py`), the fixture OAuth connector provider
100
+ (`connector_provider.py`), and the second value on each pluggable axis — the
101
+ PG-backed identity provider (`identity_provider.py`), the storage backend
102
+ (`storage.py`), and the monitoring backend (`monitor_backend.py`).
103
+ - `tests/` — the suites by seam class, plus `tests/harness/` self-tests.
104
+ - `docs/adding-a-test.md` — the 6-step recipe for a new feature's e2e test.
105
+
106
+ ## Metrics-dir isolation (the C2 hard rule)
107
+
108
+ The harness NEVER sets `PROMETHEUS_MULTIPROC_DIR` in a child env — stamping it
109
+ is the entrypoint's own job (`activate_multiproc_env`) and is exactly what the
110
+ C2 import-order tests verify. Per-stack (and per-replica) metrics dirs are
111
+ controlled entirely via `TMPDIR`: `MetricsSettings.prometheus_multiproc_dir`
112
+ defaults to `<tempfile.gettempdir()>/tai42_prometheus`, so pointing a process's
113
+ `TMPDIR` at a per-run-family dir gives that family its own multiproc dir with
114
+ the env var untouched. `stack.py` asserts the rule on every child env.
115
+
116
+ ## xfail policy
117
+
118
+ A test for a fix that has not yet landed in the workspace is marked
119
+ `xfail(strict=True)` with the observed-behavior reason, so it flips loudly
120
+ (xpass → failure) the moment the fix lands.
121
+
122
+ ## CI
123
+
124
+ The fleet e2e runs from the monorepo root workflow, `.github/workflows/ci.yml`,
125
+ in two jobs gated by the `changes` filter (any member carrying an e2e trigger, or
126
+ a change to a shared root, sets `run_e2e`):
127
+
128
+ - `e2e` — one matrix leg per triggered backend (`arq`, `rq`, `celery`), under
129
+ `TAI_E2E_FLEET=1` with `redis` identity and `local` storage. Services:
130
+ `redis:7-alpine` (shared), `postgres:16-alpine`, and `redis:8` — the
131
+ module-capable checkpoint Redis the arq leg points
132
+ `TAI_E2E_CHECKPOINT_REDIS_URL` at. The celery leg brings its RabbitMQ up from
133
+ the compose `celery` profile; non-arq legs deselect `-m "not backendless"`. The
134
+ langfuse monitoring profile runs on the arq leg only when the `run_monitoring`
135
+ gate is on (a change under `plugins/monitoring-langfuse`, `core`, or `e2e`, or a
136
+ manual `workflow_dispatch`). When the private-repo token is present it also runs
137
+ the marketplace suite (`TAI_E2E_MARKETPLACE=1`), installing the git-sourced
138
+ `tai42-marketplace` and booting it as harness processes.
139
+ - `ui-e2e` — needs `e2e`; boots redis + postgres, clones `tai-studio`, builds the
140
+ Studio SPA, and runs the Playwright chromium suite in `ui/`. When the `run_browsers`
141
+ gate is on (a change under `e2e/ui`, or a manual `workflow_dispatch`) it also
142
+ widens the matrix onto firefox + webkit. With the token it also clones the private
143
+ `tai-marketplace-web` and runs the marketplace browser specs under
144
+ `TAI_E2E_MARKETPLACE=1`.
145
+
146
+ The marketplace legs need the private `tai42ai/tai-marketplace` and
147
+ `tai42ai/tai-marketplace-web` repos, so they run only when the `RELEASE_PLEASE_TOKEN`
148
+ secret is available — a fork PR has no secrets, so those steps skip with a visible
149
+ `::warning::` rather than failing. Other external consumers install this harness as
150
+ the published `tai42-e2e` package and run their own suites against it. Any consumer
151
+ booting the studio stack must also install the Studio reference plugin from the
152
+ `tai42ai/tai-studio` repo (`e2e/reference-plugin`), which the studio profile manifest
153
+ names but the harness does not carry as a runtime dependency.
154
+
155
+ ## Marketplace area (opt-in)
156
+
157
+ `tests/marketplace/` only collects when `TAI_E2E_MARKETPLACE=1`; unset, it is
158
+ skipped at collection like `tests/monitoring/`. When on, the harness boots the
159
+ `tai42-marketplace` registry — installed from its git source via the `marketplace`
160
+ dependency group — as a harness-managed process (the API server) on an isolated
161
+ Postgres database: **no extra compose profile**; it rides the core
162
+ `docker compose up -d` infra. The suite forges REAL fixture wheels (and one source
163
+ tarball) from the in-repo `fixtures/marketplace_plugins` tree
164
+ (`TAI_E2E_MARKETPLACE_FIXTURES` overrides it), served over a local package index,
165
+ seeds them through the registry's real ingest pipeline, which publishes each version
166
+ synchronously, and the skeleton REALLY pip-installs them into the one shared venv —
167
+ so every lifecycle spec ends with its own uninstall and a session guard raises loudly
168
+ on any leftover distribution (never auto-cleaning). The ui leg additionally
169
+ pnpm-builds and serves the public `tai-marketplace-web` checkout and drives the Studio
170
+ marketplace page and the public site over a browser.
171
+
172
+ ```bash
173
+ docker compose up -d
174
+ TAI_E2E_MARKETPLACE=1 uv run pytest tests/marketplace
175
+ # the browser legs (built Studio dist + the tai-marketplace-web checkout):
176
+ cd ui && TAI_E2E_MARKETPLACE=1 pnpm exec playwright test tests/marketplace.spec.ts tests/marketplace-web.spec.ts
177
+ ```