Skip to content

Commit e743ef7

Browse files
committed
✅ Dogfood SDK context handoffs
Run broader SDK E2E flows through local TDD context and make the Swift E2E assert the agent handoff before cleanup. Also refresh the Ember test-app lockfile metadata corrected by npm install.
1 parent 9da1847 commit e743ef7

2 files changed

Lines changed: 33 additions & 4 deletions

File tree

clients/ember/test-app/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clients/swift/scripts/run-e2e.js

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { spawn } from 'node:child_process';
1+
import { spawn, spawnSync } from 'node:child_process';
22
import { existsSync, mkdtempSync, rmSync } from 'node:fs';
33
import { tmpdir } from 'node:os';
44
import { dirname, join, resolve } from 'node:path';
@@ -16,6 +16,7 @@ if (!existsSync(distCliPath)) {
1616
}
1717

1818
let tempDir = mkdtempSync(join(tmpdir(), 'vizzly-swift-e2e-'));
19+
let vizzlyHome = join(tempDir, '.vizzly-home');
1920
let swiftTestCommand = [
2021
'cd',
2122
JSON.stringify(swiftPackageDir),
@@ -35,12 +36,40 @@ let child = spawn(
3536
env: {
3637
...process.env,
3738
VIZZLY_E2E: '1',
38-
VIZZLY_HOME: join(tempDir, '.vizzly-home'),
39+
VIZZLY_HOME: vizzlyHome,
3940
},
4041
}
4142
);
4243

4344
child.on('exit', code => {
45+
if (code === 0) {
46+
let contextResult = spawnSync(
47+
process.execPath,
48+
[cliPath, 'context', 'build', 'current', '--source', 'local', '--agent'],
49+
{
50+
cwd: tempDir,
51+
encoding: 'utf8',
52+
env: {
53+
...process.env,
54+
VIZZLY_HOME: vizzlyHome,
55+
},
56+
}
57+
);
58+
59+
if (contextResult.stdout) {
60+
process.stdout.write(contextResult.stdout);
61+
}
62+
63+
if (contextResult.stderr) {
64+
process.stderr.write(contextResult.stderr);
65+
}
66+
67+
if (contextResult.status !== 0) {
68+
rmSync(tempDir, { recursive: true, force: true });
69+
process.exit(contextResult.status ?? 1);
70+
}
71+
}
72+
4473
rmSync(tempDir, { recursive: true, force: true });
4574
process.exit(code ?? 1);
4675
});

0 commit comments

Comments
 (0)