-
Notifications
You must be signed in to change notification settings - Fork 0
test: fix the #576 test-level P1/P2 items — injectable proxy timeout, stubbed watcher, json-report scaffold assertions, relay-state readiness, polled request log, wire-derived outage fences #584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
698af52
test(proxy): make the client-surface proxy upstream timeout injectabl…
ScriptedAlchemy a67e3c8
test(dev-host-install): stub the coordinator watcher in the Cursor re…
ScriptedAlchemy 60c6463
test(scaffold-matrix): assert the scaffolded pools through Rstest's j…
ScriptedAlchemy 7ac2359
test(mcp-app-real): publish the relay state on the iframe and wait on…
ScriptedAlchemy d0367b7
test(mcp-app-preview-browser): poll the bootstrap request log before …
ScriptedAlchemy dd80b84
test(packed-release): derive the outage-ledger windows from wire entr…
ScriptedAlchemy 32a7c4d
Merge remote-tracking branch 'origin/main' into test/576-p1-test-fixes
ScriptedAlchemy f70574f
changeset: agent-bundle patch for the injectable client-surface proxy…
ScriptedAlchemy 504351f
test(mcp-app-real): settle the scroll before the Close MCP session cl…
ScriptedAlchemy 4357d18
Merge remote-tracking branch 'origin/main' into test/576-p1-test-fixes
ScriptedAlchemy cbdf373
test(packed-release): assert the project/session retry cadence as a m…
ScriptedAlchemy 7d40b22
test(packed-release): open the fresh-B close window at the click, cla…
ScriptedAlchemy bd25a7c
test(packed-release): attribute the recovered Comparisons runs listin…
ScriptedAlchemy d13d8a2
test(packed-release): own navigation aborts by ledger order, not by m…
ScriptedAlchemy 8daaf94
Merge remote-tracking branch 'origin/main' into test/576-p1-test-fixes
ScriptedAlchemy 38cc2b1
Merge remote-tracking branch 'origin/main' into test/576-p1-test-fixes
ScriptedAlchemy 8794114
test(packed-release): accept ERR_SOCKET_NOT_CONNECTED as a dying-serv…
ScriptedAlchemy b9a3408
test(packed-release): reject a fresh-B stream abort that completes af…
ScriptedAlchemy 91a2485
test(scaffold-matrix): require a zero npm exit behind a passing pool …
ScriptedAlchemy ffe5f5a
Merge branch 'main' into test/576-p1-test-fixes
ScriptedAlchemy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "agent-bundle": patch | ||
| --- | ||
|
|
||
| Make the dev runtime client-surface proxy's upstream request timeout configurable: `RuntimeClientSurfaceProxy.open` accepts a trailing `RuntimeClientSurfaceProxyOptions` with `upstreamRequestTimeoutMs` (default `defaultRuntimeClientSurfaceUpstreamRequestTimeoutMs`, 15 000 ms; a value that is not a positive safe integer within the `setTimeout` ceiling is rejected before the proxy opens). The dev server keeps the 15 s default (#584) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
packages/create-agent-bundle/tests/scaffold-fixture.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| import { mkdtemp, rm, writeFile } from 'node:fs/promises'; | ||
| import { tmpdir } from 'node:os'; | ||
| import { join } from 'node:path'; | ||
|
|
||
| import { afterAll, beforeAll, describe, expect, it } from '@rstest/core'; | ||
|
|
||
| import { expectPassedPool } from './support/scaffold-fixture.ts'; | ||
|
|
||
| /** | ||
| * `expectPassedPool` is the release matrix's verdict on a scaffolded pool, so | ||
| * its own fence is pinned here against a stub project whose npm scripts print | ||
| * a Rstest-shaped JSON report and exit as instructed. The scaffolded pools | ||
| * themselves run in scaffold-packed-matrix.e2e.test.ts. | ||
| */ | ||
| const poolScript = ` | ||
| const scenario = process.argv[2]; | ||
| const report = (tests) => JSON.stringify({ | ||
| files: [{ status: tests.some((test) => test.status === 'fail') ? 'fail' : 'pass' }], | ||
| status: tests.some((test) => test.status === 'fail') ? 'fail' : 'pass', | ||
| summary: { failedTests: tests.filter((test) => test.status === 'fail').length }, | ||
| tests, | ||
| }, null, 2); | ||
| console.log('Rstest v0.0.0'); | ||
| switch (scenario) { | ||
| case 'pass': | ||
| console.log(report([{ name: 'greets', status: 'pass' }])); | ||
| break; | ||
| case 'pass-exit-1': | ||
| console.log(report([{ name: 'greets', status: 'pass' }])); | ||
| process.exitCode = 1; | ||
| break; | ||
| case 'fail': | ||
| console.log(report([{ name: 'greets', status: 'fail' }])); | ||
| process.exitCode = 1; | ||
| break; | ||
| case 'no-report': | ||
| console.error('failed to load rstest.config.ts'); | ||
| process.exitCode = 2; | ||
| break; | ||
| default: | ||
| throw new Error('unknown scenario ' + String(scenario)); | ||
| } | ||
| `; | ||
|
|
||
| describe('expectPassedPool', () => { | ||
| let projectRoot = ''; | ||
|
|
||
| beforeAll(async () => { | ||
| projectRoot = await mkdtemp(join(tmpdir(), 'scaffold-fixture-pool-')); | ||
| await writeFile(join(projectRoot, 'pool.mjs'), poolScript); | ||
| await writeFile(join(projectRoot, 'package.json'), JSON.stringify({ | ||
| name: 'pool-fixture', | ||
| private: true, | ||
| scripts: { | ||
| 'pool:fail': 'node pool.mjs fail', | ||
| 'pool:no-report': 'node pool.mjs no-report', | ||
| 'pool:pass': 'node pool.mjs pass', | ||
| 'pool:pass-exit-1': 'node pool.mjs pass-exit-1', | ||
| }, | ||
| version: '0.0.0', | ||
| }, null, 2)); | ||
| }); | ||
|
|
||
| afterAll(async () => { | ||
| await rm(projectRoot, { force: true, recursive: true }); | ||
| }); | ||
|
|
||
| it('accepts a passing report whose script exited 0 and names the expected tests', async () => { | ||
| await expect(expectPassedPool(projectRoot, 'pool:pass', ['greets'])).resolves.toBeUndefined(); | ||
| }); | ||
|
|
||
| it('rejects a passing report whose script exited non-zero', async () => { | ||
| await expect(expectPassedPool(projectRoot, 'pool:pass-exit-1', ['greets'])) | ||
| .rejects.toThrow(/`npm run pool:pass-exit-1` exited 1 although its report says pass/u); | ||
| }); | ||
|
|
||
| it('rejects a passing report that does not name an expected test', async () => { | ||
| await expect(expectPassedPool(projectRoot, 'pool:pass', ['greets', 'lists'])).rejects.toThrow(/lists/u); | ||
| }); | ||
|
|
||
| it('reports the failing test entry before the exit code', async () => { | ||
| await expect(expectPassedPool(projectRoot, 'pool:fail', ['greets'])).rejects.toThrow(/greets[\s\S]*to deeply equal \[\]/u); | ||
| }); | ||
|
|
||
| it('rejects a script that wrote no report, quoting its exit and stderr', async () => { | ||
| await expect(expectPassedPool(projectRoot, 'pool:no-report', ['greets'])) | ||
| .rejects.toThrow(/wrote no Rstest JSON report \(exit 2\)[\s\S]*failed to load rstest\.config\.ts/u); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.