Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions docs/profile-recovery-acceptance-map.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions scripts/integration-shards.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ export const INTEGRATION_SHARDS = [
package: '.',
files: ['./tests/memory-process-loss.integration.test.mjs'],
},
{
package: '.',
files: ['./tests/profile-recovery-postgres-restore.integration.test.mjs'],
},
{
package: 'apps/hosted-control-plane',
files: [
Expand Down
3 changes: 3 additions & 0 deletions scripts/run-bun-test-group.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ const repositoryGroups = {
'tests/m11-security-probes.test.mjs',
'tests/m11-sqlite-benchmark.test.mjs',
'tests/neon-workflow.test.mjs',
'tests/profile-recovery-crash-restore.test.mjs',
'tests/profile-recovery-fenced-rollback.test.mjs',
'tests/profile-recovery-rebind-fencing.test.mjs',
'tests/skill-library.test.mjs',
'tests/m11-recovery-rpo-rto.test.mjs',
'tests/m11-retention-apply-cli.test.mjs',
Expand Down
17 changes: 17 additions & 0 deletions scripts/run-integration-tests.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,22 @@ try {
run('bun', ['x', 'turbo', 'run', 'test:integration', '--concurrency=1', '--log-order=stream'], {
environment: integrationEnvironment,
})
// The test:integration task builds only each package's dependencies (^build),
// so a package that is consumed by root-level files but has no dependent
// integration task has no dist/ output. Package exports resolve to dist/,
// so build the consumed package explicitly before those root-level files run.
run(
'bun',
[
'x',
'turbo',
'run',
'build',
'--filter=@control-plane/profile-portability',
'--concurrency=1',
],
{ environment: integrationEnvironment }
)
// Repository-owned scenarios span composition roots without importing
// repository fixtures from inside an application package.
run(
Expand All @@ -179,6 +195,7 @@ try {
remoteDatabase ? '120000' : '30000',
'./tests/memory-process-loss.integration.test.mjs',
'./tests/langgraph-retirement-inventory-pg.integration.test.mjs',
'./tests/profile-recovery-postgres-restore.integration.test.mjs',
],
{
environment: integrationEnvironment,
Expand Down
18 changes: 17 additions & 1 deletion tests/integration-runner-lifecycle.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ describe('integration runner resource ownership', () => {
const result = executeRunner(remoteTarget)
expect(result.status).toBe(0)
expect(result.calls.filter(({ program }) => program === 'docker')).toEqual([])
expect(result.calls.filter(({ program }) => program === 'bun')).toHaveLength(3)
// turbo integration, the consumed-package build, root-level files, and the cloud drill.
expect(result.calls.filter(({ program }) => program === 'bun')).toHaveLength(4)
})

test('remote configuration rejection does not contact Docker', () => {
Expand Down Expand Up @@ -187,6 +188,21 @@ describe('integration runner resource ownership', () => {
expect(startedProject(first)).not.toBe(startedProject(second))
})

test('root-level integration files run only after their consumed workspace package is built', () => {
const result = executeRunner()
expect(result.status).toBe(0)
const bunCalls = result.calls.filter(({ program }) => program === 'bun')
const build = bunCalls.findIndex(
({ args }) =>
args.includes('build') && args.includes('--filter=@control-plane/profile-portability')
)
const rootFile = bunCalls.findIndex(({ args }) =>
args.includes('./tests/profile-recovery-postgres-restore.integration.test.mjs')
)
expect(build).toBeGreaterThanOrEqual(0)
expect(rootFile).toBeGreaterThan(build)
})

for (const [label, overrides] of [
['partial startup failure', { FAKE_DOCKER_FAIL_ON: 'up' }],
['integration failure', { FAKE_BUN_FAIL: 'true' }],
Expand Down
6 changes: 5 additions & 1 deletion tests/j1-unfinished-child-process.fixture.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,11 @@ export async function createUnfinishedChildProcessHarness(options = {}) {
}
async function evidence() {
try {
return (await readFile(join(directory, 'process-evidence.jsonl'), 'utf8'))
// Children append rows while this poll reads. Only newline-terminated rows are
// complete; a trailing fragment is left for the next poll, as stdout rows are.
const text = await readFile(join(directory, 'process-evidence.jsonl'), 'utf8')
return text
.slice(0, text.lastIndexOf('\n') + 1)
.split('\n')
.filter(Boolean)
.map(JSON.parse)
Expand Down
Loading
Loading