|
|
@@ -5,9 +5,8 @@
|
|
|
* independent commands can overlap and which commands wait for built artifacts.
|
|
|
*/
|
|
|
import { spawn } from 'node:child_process'
|
|
|
-import { readdir, rm } from 'node:fs/promises'
|
|
|
import { availableParallelism } from 'node:os'
|
|
|
-import { join, resolve } from 'node:path'
|
|
|
+import { resolve } from 'node:path'
|
|
|
import { performance } from 'node:perf_hooks'
|
|
|
|
|
|
type Mode =
|
|
|
@@ -210,7 +209,6 @@ function ciPrimaryGates(): Gate[] {
|
|
|
pnpmScript('duplication', 'duplication'),
|
|
|
coverageGate(),
|
|
|
snapshotGate(),
|
|
|
- demoSmokeGate({ needs: ['lint'] }),
|
|
|
...docSyncLeafGates(),
|
|
|
pnpmScript('module-graph', 'verify-module-graph', { label: 'module graph' }),
|
|
|
pnpmScript('knip', 'knip'),
|
|
|
@@ -229,18 +227,12 @@ function ciStaticGates(): Gate[] {
|
|
|
pnpmScript('runtime-closure', 'verify-runtime-closure', { label: 'runtime closure' }),
|
|
|
pnpmScript('constraints', 'constraints'),
|
|
|
pnpmScript('cordis-config', 'verify-cordis-config', { label: 'Cordis config' }),
|
|
|
- ...staticDemoSmokeGates(),
|
|
|
...docSyncLeafGates(),
|
|
|
pnpmScript('module-graph', 'verify-module-graph', { label: 'module graph' }),
|
|
|
pnpmScript('knip', 'knip'),
|
|
|
]
|
|
|
}
|
|
|
|
|
|
-function staticDemoSmokeGates(): Gate[] {
|
|
|
- // Native Windows session persistence is outside the gates-only support scope.
|
|
|
- return process.platform === 'win32' ? [] : [demoSmokeGate()]
|
|
|
-}
|
|
|
-
|
|
|
function ciArtifactGates(): Gate[] {
|
|
|
return [
|
|
|
pnpmScript('build', 'build'),
|
|
|
@@ -353,49 +345,13 @@ function docSyncLeafGates(options: {
|
|
|
]
|
|
|
}
|
|
|
|
|
|
-function demoSmokeGate(options: { needs?: string[] } = {}): Gate {
|
|
|
- const dependencyOptions = options.needs === undefined ? {} : { needs: options.needs }
|
|
|
- return {
|
|
|
- id: 'demo-smoke',
|
|
|
- label: 'demo smoke',
|
|
|
- displayCommand: 'pnpm run demo:echo --output-format stream-json -- "echo ci smoke"',
|
|
|
- ...pnpmInvocation(['run', 'demo:echo', '--output-format', 'stream-json', '--', 'echo ci smoke']),
|
|
|
- ...dependencyOptions,
|
|
|
- verify: async (result) => {
|
|
|
- const output = result.stdout + result.stderr
|
|
|
- const sessionsRoot = join(root, '.sessions')
|
|
|
- try {
|
|
|
- if (!output.includes('"type":"tool/call"') || !output.includes('"name":"echo"')) {
|
|
|
- throw new Error('demo smoke did not show the echo tool call.')
|
|
|
- }
|
|
|
- if (!output.includes('ECHO: CI SMOKE')) {
|
|
|
- throw new Error('demo smoke did not show the echo tool result.')
|
|
|
- }
|
|
|
- const buckets = await readdir(sessionsRoot, { withFileTypes: true })
|
|
|
- let found = false
|
|
|
- for (const bucket of buckets) {
|
|
|
- if (!bucket.isDirectory() || !bucket.name.startsWith('cwd-')) continue
|
|
|
- const entries = await readdir(join(sessionsRoot, bucket.name))
|
|
|
- if (entries.some(entry => /^main-session-.+\.jsonl$/.test(entry))) {
|
|
|
- found = true
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- if (!found) throw new Error('demo smoke did not create a main-session JSONL log in a cwd bucket.')
|
|
|
- } finally {
|
|
|
- await rm(sessionsRoot, { recursive: true, force: true })
|
|
|
- }
|
|
|
- },
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
function builtBinSmokeGate(): Gate {
|
|
|
return pnpmExec('built-bin-smoke', [
|
|
|
'vitest',
|
|
|
'run',
|
|
|
'--config',
|
|
|
'vitest.e2e.config.ts',
|
|
|
- 'examples/echo-agent/tests/echo.e2e.ts',
|
|
|
+ 'examples/headless-agent/tests/keyless-smoke.e2e.ts',
|
|
|
'examples/tui-agent/tests/tui-keyless-smoke.e2e.ts',
|
|
|
'packages/examples/cli-demo/tests/built-bin.e2e.ts',
|
|
|
'packages/examples/acp-demo/tests/built-bin.e2e.ts',
|