@devries-cameron20 / composio Mirror · read-only
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 04:45 UTC

next
md 39 lines 1.63 KB
Rendered Raw
1 # CLI `composio run` Test
2
3 Verifies that `composio run` forwards the child script's exit status to the caller and that
4 the run log it advertises survives the process.
5
6 ## Why This Exists
7
8 `composio run` never exits by itself: the handler sets `process.exitCode` and returns a
9 successful Effect, and the CLI teardown hands that code to `runMain`, which force-exits only
10 when the code is non-zero. Unit tests run in-process and can only observe `process.exitCode`,
11 so they cannot tell whether the code ever reached the OS. An Effect upgrade or a teardown
12 change could turn every failing script into exit 0 without failing a single unit test.
13
14 The `RUN_LOG_FILE=` path printed on stderr has the same problem: it is only useful if the file
15 outlives the process that printed it, which regressed once when the log lived inside a scoped
16 temp directory.
17
18 ## What It Tests
19
20 | Test | Description |
21 | ------------------ | ---------------------------------------------------------------------- |
22 | Exit forwarding | `composio run 'process.exit(7)'` exits 7 |
23 | Successful run | An inline script exits 0 and its stdout reaches the caller |
24 | Missing script | `composio run` with no code and no `--file` exits non-zero and says so |
25 | Run log durability | The announced `RUN_LOG_FILE` path still exists after the process exits |
26
27 ## Requirements
28
29 None. This suite does not require any environment variables or network access.
30
31 ## Isolation Tool
32
33 **Docker** with the CLI built from the current monorepo source.
34
35 ## Running
36
37 ```bash
38 pnpm test:e2e:cli
39 ```