Skip to content

Commit df2cdec

Browse files
authored
test: add optional sandbox storage mount integrations (#1229)
1 parent 00b4032 commit df2cdec

6 files changed

Lines changed: 416 additions & 2 deletions

File tree

.agents/skills/integration-tests/SKILL.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ Run integration tests that require a local npm registry by starting `pnpm local-
2222
Run this exact sequence in the main process and capture the output:
2323

2424
```bash
25-
pnpm i && pnpm build:ci && pnpm local-npm:reset && pnpm local-npm:publish && pnpm test:integration
25+
pnpm i && pnpm build:ci && pnpm local-npm:reset && pnpm local-npm:publish && OPENAI_AGENTS_RUN_STORAGE_MOUNT_INTEGRATION=1 pnpm test:integration
2626
```
2727

2828
- Use `pnpm build:ci` here so the skill validates the same serialized build path that GitHub Actions now uses, while still running the normal `prebuild` and `postbuild` lifecycle steps.
29+
- Run `pnpm test:integration` with `OPENAI_AGENTS_RUN_STORAGE_MOUNT_INTEGRATION=1` so the optional sandbox storage mount coverage runs by default when this skill is used. This enables the local Azurite and MinIO smoke tests without changing the repository's plain `pnpm test:integration` default.
2930

3031
- Return the full success/failure outcome and a concise summary of the results.
3132
- Always capture the stdout/stderr from `pnpm test:integration` and include it in the final response (trim obvious noise if extremely long) inside a fenced code block.

integration-tests/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ It is intentionally not part of the `pnpm` workspace and instead installs the pa
1313
- Run `pnpm exec playwright install` to install playwright
1414
- `pnpm test:integration` will create temporary `integration-tests/cloudflare-workers/worker/.dev.vars` and `integration-tests/vite-react/.env` files from `OPENAI_API_KEY` and restore any pre-existing files during cleanup
1515
- Integration test fixture subprocesses run with `NODE_ENV=development` so real-model SDK examples keep the normal server-runtime tracing behavior even though Vitest itself runs with `NODE_ENV=test`
16+
- Optional sandbox storage mount coverage requires Docker with FUSE support and is skipped unless `OPENAI_AGENTS_RUN_STORAGE_MOUNT_INTEGRATION=1` is set. It starts local Azurite and MinIO containers and removes them after the test.
1617

1718
2. **Local npm registry**
1819

integration-tests/node.test.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,28 @@ describe('Node.js', () => {
7474
);
7575
},
7676
);
77+
78+
test(
79+
'sandbox storage mounts should run against local emulators',
80+
{ timeout: 300_000 },
81+
async (context) => {
82+
if (process.env.OPENAI_AGENTS_RUN_STORAGE_MOUNT_INTEGRATION !== '1') {
83+
context.skip();
84+
}
85+
86+
try {
87+
await execa`docker info`;
88+
} catch {
89+
context.skip();
90+
}
91+
92+
const { stdout } = await execa`npm run start:sandbox:storage-mounts`;
93+
expect(stdout).toContain(
94+
'[STORAGE_MOUNT_RESPONSE]azure:ok[/STORAGE_MOUNT_RESPONSE]',
95+
);
96+
expect(stdout).toContain(
97+
'[STORAGE_MOUNT_RESPONSE]s3:ok[/STORAGE_MOUNT_RESPONSE]',
98+
);
99+
},
100+
);
77101
});

integration-tests/node/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"start:aisdk:cjs": "node aisdk.cjs",
88
"start:codex": "node --no-experimental-require-module codex.mjs",
99
"start:sandbox:unix-local": "node --no-experimental-require-module sandbox-unix-local.mjs",
10-
"start:sandbox:docker": "node --no-experimental-require-module sandbox-docker.mjs"
10+
"start:sandbox:docker": "node --no-experimental-require-module sandbox-docker.mjs",
11+
"start:sandbox:storage-mounts": "node --no-experimental-require-module sandbox-storage-mounts.mjs"
1112
},
1213
"dependencies": {
1314
"@openai/agents": "latest",
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM node:22-bookworm-slim
2+
3+
RUN apt-get update \
4+
&& apt-get install -y --no-install-recommends ca-certificates fuse3 rclone \
5+
&& rm -rf /var/lib/apt/lists/*

0 commit comments

Comments
 (0)