Skip to content
Open
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
16 changes: 15 additions & 1 deletion .github/workflows/e2e-tests-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ jobs:
matrix:
cdk-source: [npm, main]
shard: ['1/6', '2/6', '3/6', '4/6', '5/6', '6/6']
env:
# Scheduled runs cover 6 priority suites spanning CodeZip, Container, Auth,
# Evals, Import, and local Dev paths. Manual workflow_dispatch runs the
# full e2e directory to exercise every framework/model-provider combo.
SCHEDULED_TESTS: >-
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whats the advantage of scheduled tests if we run them on every commit?

e2e-tests/strands-bedrock.test.ts e2e-tests/container-strands-bedrock.test.ts e2e-tests/byo-custom-jwt.test.ts
e2e-tests/evals-lifecycle.test.ts e2e-tests/import-resources.test.ts e2e-tests/dev-lifecycle.test.ts
steps:
- uses: actions/checkout@v6
with:
Expand Down Expand Up @@ -79,7 +86,14 @@ jobs:
OPENAI_API_KEY: ${{ env.E2E_OPENAI_API_KEY }}
GEMINI_API_KEY: ${{ env.E2E_GEMINI_API_KEY }}
CDK_TARBALL: ${{ env.CDK_TARBALL }}
run: npx vitest run --project e2e --shard=${{ matrix.shard }}
run: |
if [[ "${{ github.event_name }}" == "schedule" ]]; then
echo "Scheduled run: executing priority e2e suites"
npx vitest run --project e2e --shard=${{ matrix.shard }} $SCHEDULED_TESTS
else
echo "Manual/push run: executing full e2e suite"
npx vitest run --project e2e --shard=${{ matrix.shard }}
fi
browser-tests:
runs-on: ubuntu-latest
environment: e2e-testing
Expand Down
46 changes: 35 additions & 11 deletions integ-tests/dev-server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,43 @@ describe('integration: dev server', () => {
}
}, 120000);

afterEach(() => {
// Kill dev server if running
if (devProcess) {
devProcess.kill('SIGTERM');
devProcess = null;
async function terminateDevProcess(timeoutMs = 5000): Promise<void> {
if (!devProcess) return;
const proc = devProcess;
devProcess = null;

if (proc.pid) {
try {
process.kill(-proc.pid, 'SIGTERM');
} catch {
// Process group already exited
}
}

await new Promise<void>(resolve => {
const timer = setTimeout(() => {
if (proc.pid) {
try {
process.kill(-proc.pid, 'SIGKILL');
} catch {
// Already dead
}
}
resolve();
}, timeoutMs);
proc.on('exit', () => {
clearTimeout(timer);
resolve();
});
});
}

afterEach(async () => {
await terminateDevProcess();
});

afterAll(async () => {
if (devProcess) {
devProcess.kill('SIGKILL');
}
await terminateDevProcess();
await rm(testDir, { recursive: true, force: true });
});

Expand All @@ -95,15 +120,14 @@ describe('integration: dev server', () => {
devProcess = spawn('node', [cliPath, 'dev', '--port', String(port), '--logs'], {
cwd: projectPath,
stdio: 'pipe',
detached: true,
env: { ...process.env, INIT_CWD: undefined },
});

const serverReady = await waitForServer(port, 20000);
expect(serverReady, 'Dev server should respond to ping within 20s').toBeTruthy();

// Clean shutdown
devProcess.kill('SIGTERM');
devProcess = null;
await terminateDevProcess();
},
30000
);
Expand Down
Loading