@devries-cameron20 / composio-1 / commits / d855ba1ac
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.

chore(ts/e2e-tests): mention CLI e2e tests in READMEs

jkomyno committed Feb 18, 2026 at 15:44 UTC d855ba1ac46dd1c71968d03e5e8c45ee0478a789
4 files changed +105 -1
ts/e2e-tests/README.md
+2 -1
@@ -41,7 +41,8 @@ ts/e2e-tests/
41 ├── cf-workers-files/ # Cloudflare Workers file handling tests
42 └── cf-workers-tool-router-ai/ # Cloudflare Workers AI SDK tool router tests
43 └── cli/ # CLI runtime tests (scratch)
44 - └── version/ # composio version command tests
44 + ├── version/ # composio version command tests
45 + └── whoami/ # composio whoami command tests
46 ```
47
48 ## Running Tests
ts/e2e-tests/cli/README.md new
+31
@@ -0,0 +1,31 @@
1 +# CLI E2E Tests
2 +
3 +End-to-end tests for the compiled `composio` CLI binary.
4 +
5 +## How It Works
6 +
7 +Each test suite runs the `composio` binary inside a scratch Debian Docker container built from `Dockerfile.cli`. The binary is compiled via `bun build --compile` during the Docker image build, producing a self-contained executable with no runtime dependencies.
8 +
9 +Tests use `runCmd` to execute shell commands in the container and assert on exit code, stdout, and stderr. When stdout is piped (e.g., `composio version > out.txt`), the CLI suppresses all decoration and writes only machine-readable data — these tests verify that contract.
10 +
11 +## Test Suites
12 +
13 +| Suite | Description | Env Vars |
14 +| --- | --- | --- |
15 +| [version](./version/) | `composio version` output and exit code | None |
16 +| [whoami](./whoami/) | `composio whoami` prints the API key | `COMPOSIO_API_KEY` |
17 +
18 +## Isolation Tool
19 +
20 +**Docker** with the CLI version resolved from the current monorepo build (`cli: ['current']`).
21 +
22 +## Running
23 +
24 +```bash
25 +# All CLI e2e tests
26 +pnpm test:e2e:cli
27 +
28 +# A specific suite
29 +cd ts/e2e-tests/cli/version && pnpm test:e2e:cli
30 +cd ts/e2e-tests/cli/whoami && pnpm test:e2e:cli
31 +```
ts/e2e-tests/cli/version/README.md new
+35
@@ -0,0 +1,35 @@
1 +# CLI `composio version` Test
2 +
3 +Verifies that `composio version` prints the correct version string and respects stdout piping.
4 +
5 +## Why This Exists
6 +
7 +The CLI separates decoration (stderr) from data (stdout). This suite ensures:
8 +
9 +- `composio version` exits with code 0
10 +- stdout contains the version from `packages/cli/package.json`
11 +- stderr is empty (no decoration leaks into piped output)
12 +- Redirecting stdout to a file captures the clean version string
13 +
14 +## What It Tests
15 +
16 +| Test | Description |
17 +| --- | --- |
18 +| Exit code | `composio version` returns 0 |
19 +| stdout | Output matches `package.json` version |
20 +| stderr | Empty when piped |
21 +| File redirect | `composio version > out.txt` captures the version in the file |
22 +
23 +## Requirements
24 +
25 +None. This suite does not require any environment variables.
26 +
27 +## Isolation Tool
28 +
29 +**Docker** with the CLI built from the current monorepo source.
30 +
31 +## Running
32 +
33 +```bash
34 +pnpm test:e2e:cli
35 +```
ts/e2e-tests/cli/whoami/README.md new
+37
@@ -0,0 +1,37 @@
1 +# CLI `composio whoami` Test
2 +
3 +Verifies that `composio whoami` prints the authenticated API key and respects stdout piping.
4 +
5 +## Why This Exists
6 +
7 +The CLI separates decoration (stderr) from data (stdout). This suite ensures:
8 +
9 +- `composio whoami` exits with code 0
10 +- stdout contains the API key passed via `COMPOSIO_API_KEY`
11 +- stderr is empty (no decoration leaks into piped output)
12 +- Redirecting stdout to a file captures the clean API key
13 +
14 +## What It Tests
15 +
16 +| Test | Description |
17 +| --- | --- |
18 +| Exit code | `composio whoami` returns 0 |
19 +| stdout | Output matches `COMPOSIO_API_KEY` |
20 +| stderr | Empty when piped |
21 +| File redirect | `composio whoami > out.txt` captures the API key in the file |
22 +
23 +## Requirements
24 +
25 +- `COMPOSIO_API_KEY` (**required**) — Composio API key passed to the container
26 +
27 +If `COMPOSIO_API_KEY` is not set, the suite fails fast at startup.
28 +
29 +## Isolation Tool
30 +
31 +**Docker** with the CLI built from the current monorepo source.
32 +
33 +## Running
34 +
35 +```bash
36 +pnpm test:e2e:cli
37 +```