Skip to content

Commit 38e661c

Browse files
committed
Support smoke timeout and configurable base URL
1 parent a47bbf7 commit 38e661c

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

apps/admin/src/app/api/smoke/route.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,22 @@ function getSmokeConfig() {
2323

2424
const ttlValue = process.env['SANDCHEST_SMOKE_TTL_SECONDS']
2525
const ttlSeconds = ttlValue ? Number.parseInt(ttlValue, 10) : undefined
26+
const timeoutValue = process.env['SANDCHEST_SMOKE_TIMEOUT_MS']
27+
const timeoutMs = timeoutValue ? Number.parseInt(timeoutValue, 10) : undefined
28+
const baseUrl =
29+
process.env['SANDCHEST_SMOKE_BASE_URL']?.trim() ||
30+
process.env['API_URL']?.trim() ||
31+
DEFAULT_BASE_URL
2632

2733
return {
2834
apiKey,
29-
baseUrl: DEFAULT_BASE_URL,
35+
baseUrl,
3036
image: process.env['SANDCHEST_SMOKE_IMAGE']?.trim() || undefined,
3137
profile: (process.env['SANDCHEST_SMOKE_PROFILE']?.trim() || undefined) as
3238
| SmokeProfile
3339
| undefined,
3440
ttlSeconds,
41+
timeoutMs,
3542
}
3643
}
3744

apps/admin/src/app/smoke/page.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ export default function SmokePage() {
6262

6363
<div className="card" style={{ display: 'flex', flexDirection: 'column', gap: '0.875rem' }}>
6464
<div style={{ display: 'flex', flexDirection: 'column', gap: '0.375rem' }}>
65-
<div className="card-title">Production Lifecycle Test</div>
65+
<div className="card-title">Sandbox Lifecycle Test</div>
6666
<p className="text-weak" style={{ fontSize: '0.8125rem', lineHeight: 1.6 }}>
67-
Runs the full sandbox lifecycle against <code>https://api.sandchest.com</code> from
68-
the admin server using configured credentials. The flow creates live sandboxes,
69-
exercises exec/session/file/fork paths, and attempts cleanup in all cases.
67+
Runs the full sandbox lifecycle against the API configured on the admin server.
68+
The flow creates live sandboxes, exercises exec/session/file/fork paths, and
69+
attempts cleanup in all cases.
7070
</p>
7171
</div>
7272

@@ -75,7 +75,8 @@ export default function SmokePage() {
7575
{isRunning ? 'Running smoke test...' : 'Run smoke test'}
7676
</button>
7777
<span className="text-weak" style={{ fontSize: '0.75rem' }}>
78-
Uses `SANDCHEST_SMOKE_API_KEY` or `SANDCHEST_API_KEY` on the admin server.
78+
Uses `SANDCHEST_SMOKE_BASE_URL` or `API_URL`, plus `SANDCHEST_SMOKE_API_KEY` or
79+
`SANDCHEST_API_KEY`, and optional `SANDCHEST_SMOKE_TIMEOUT_MS`, on the admin server.
7980
</span>
8081
</div>
8182
</div>

0 commit comments

Comments
 (0)