Skip to content

Commit fb6c607

Browse files
committed
fix(tui-tests): address PR review feedback
- Drop waitFor timeout for menu filter from 3s to 1.5s to catch performance regressions (filter echo should be near-instant) - Fail hard in CI when TUI harness is unavailable instead of silently skipping, preventing false-green CI runs - Bump create wizard completion timeout from 30s to 60s (CDK scaffolding regularly takes >30s under load)
1 parent beb406d commit fb6c607

3 files changed

Lines changed: 15 additions & 8 deletions

File tree

integ-tests/tui/add-flow.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe.skipIf(!isAvailable)('TUI add-resource flow', () => {
4444

4545
// Type 'add' to filter the command list, then press Enter to select it.
4646
await session.sendKeys('add');
47-
await session.waitFor('add', 3000);
47+
await session.waitFor('add', 1500);
4848
await session.sendSpecialKey('enter');
4949

5050
// Confirm the Add Resource screen has rendered.
@@ -73,7 +73,7 @@ describe.skipIf(!isAvailable)('TUI add-resource flow', () => {
7373

7474
// Navigate to Add Resource screen.
7575
await session.sendKeys('add');
76-
await session.waitFor('add', 3000);
76+
await session.waitFor('add', 1500);
7777
await session.sendSpecialKey('enter');
7878
await session.waitFor('Add Resource', 10000);
7979

@@ -106,7 +106,7 @@ describe.skipIf(!isAvailable)('TUI add-resource flow', () => {
106106

107107
// Navigate: HelpScreen -> Add Resource -> Add Agent
108108
await session.sendKeys('add');
109-
await session.waitFor('add', 3000);
109+
await session.waitFor('add', 1500);
110110
await session.sendSpecialKey('enter');
111111
await session.waitFor('Add Resource', 10000);
112112
await session.sendSpecialKey('enter');
@@ -137,7 +137,7 @@ describe.skipIf(!isAvailable)('TUI add-resource flow', () => {
137137

138138
// Navigate to Add Resource screen.
139139
await session.sendKeys('add');
140-
await session.waitFor('add', 3000);
140+
await session.waitFor('add', 1500);
141141
await session.sendSpecialKey('enter');
142142
await session.waitFor('Add Resource', 10000);
143143

integ-tests/tui/create-flow.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,9 @@ describe.skipIf(!isAvailable)('create wizard TUI flow', () => {
132132
await session.waitFor('Review Configuration', 10000);
133133
await session.sendSpecialKey('enter');
134134

135-
// Step 21: Wait for project creation to complete (generous timeout)
136-
const successScreen = await session.waitFor('Project created successfully', 30000);
135+
// Step 21: Wait for project creation to complete (generous timeout —
136+
// CDK scaffolding + git init can take >30s under load)
137+
const successScreen = await session.waitFor('Project created successfully', 60000);
137138

138139
const successText = successScreen.lines.join('\n');
139140
expect(successText).toContain('Project created successfully');
@@ -174,7 +175,7 @@ describe.skipIf(!isAvailable)('create wizard TUI flow', () => {
174175
await session.sendSpecialKey('enter');
175176

176177
// Wait for project creation to complete
177-
const successScreen = await session.waitFor('Project created successfully', 30000);
178+
const successScreen = await session.waitFor('Project created successfully', 60000);
178179

179180
const successText = successScreen.lines.join('\n');
180181
expect(successText).toContain('Project created successfully');

integ-tests/tui/setup.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,15 @@ beforeAll(async () => {
77
try {
88
const { isAvailable, unavailableReason } = await import('../../src/tui-harness/lib/availability.js');
99
if (!isAvailable) {
10+
if (process.env.CI) {
11+
throw new Error(`TUI harness unavailable in CI: ${unavailableReason}. Failing to prevent silent skip.`);
12+
}
1013
console.warn(`TUI harness unavailable: ${unavailableReason}. Skipping all TUI tests.`);
1114
}
12-
} catch {
15+
} catch (err) {
16+
if (err instanceof Error && err.message.startsWith('TUI harness unavailable in CI')) {
17+
throw err;
18+
}
1319
// Harness not yet built
1420
}
1521
});

0 commit comments

Comments
 (0)