Skip to content

Commit bccf11f

Browse files
authored
Increase suite-level e2e test timeout (#4975)
1 parent 00ad425 commit bccf11f

14 files changed

+57
-40
lines changed

apps/vscode-e2e/src/suite/extension.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import * as assert from "assert"
22
import * as vscode from "vscode"
33

4-
suite("Roo Code Extension", () => {
4+
import { setDefaultSuiteTimeout } from "./test-utils"
5+
6+
suite("Roo Code Extension", function () {
7+
setDefaultSuiteTimeout(this)
8+
59
test("Commands should be registered", async () => {
610
const expectedCommands = [
711
"SidebarProvider.open",

apps/vscode-e2e/src/suite/index.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,11 @@ export async function run() {
2727

2828
globalThis.api = api
2929

30-
// Configure Mocha with grep pattern if provided
3130
const mochaOptions: Mocha.MochaOptions = {
3231
ui: "tdd",
33-
timeout: 300_000,
32+
timeout: 20 * 60 * 1_000, // 20m
3433
}
3534

36-
// Apply grep filter if TEST_GREP is set
3735
if (process.env.TEST_GREP) {
3836
mochaOptions.grep = process.env.TEST_GREP
3937
console.log(`Running tests matching pattern: ${process.env.TEST_GREP}`)
@@ -42,17 +40,16 @@ export async function run() {
4240
const mocha = new Mocha(mochaOptions)
4341
const cwd = path.resolve(__dirname, "..")
4442

45-
// Get test files based on filter
4643
let testFiles: string[]
44+
4745
if (process.env.TEST_FILE) {
48-
// Run specific test file
4946
const specificFile = process.env.TEST_FILE.endsWith(".js")
5047
? process.env.TEST_FILE
5148
: `${process.env.TEST_FILE}.js`
49+
5250
testFiles = await glob(`**/${specificFile}`, { cwd })
5351
console.log(`Running specific test file: ${specificFile}`)
5452
} else {
55-
// Run all test files
5653
testFiles = await glob("**/**.test.js", { cwd })
5754
}
5855

@@ -62,7 +59,6 @@ export async function run() {
6259

6360
testFiles.forEach((testFile) => mocha.addFile(path.resolve(cwd, testFile)))
6461

65-
// Let's go!
6662
return new Promise<void>((resolve, reject) =>
6763
mocha.run((failures) => (failures === 0 ? resolve() : reject(new Error(`${failures} tests failed.`)))),
6864
)

apps/vscode-e2e/src/suite/modes.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import * as assert from "assert"
22

33
import { waitUntilCompleted } from "./utils"
4+
import { setDefaultSuiteTimeout } from "./test-utils"
5+
6+
suite("Roo Code Modes", function () {
7+
setDefaultSuiteTimeout(this)
48

5-
suite("Roo Code Modes", () => {
69
test("Should handle switching modes correctly", async () => {
710
const modes: string[] = []
811

apps/vscode-e2e/src/suite/task.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ import * as assert from "assert"
33
import type { ClineMessage } from "@roo-code/types"
44

55
import { waitUntilCompleted } from "./utils"
6+
import { setDefaultSuiteTimeout } from "./test-utils"
7+
8+
suite("Roo Code Task", function () {
9+
setDefaultSuiteTimeout(this)
610

7-
suite("Roo Code Task", () => {
811
test("Should handle prompt and response correctly", async () => {
912
const api = globalThis.api
1013

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export const DEFAULT_SUITE_TIMEOUT = 120_000
2+
3+
export function setDefaultSuiteTimeout(context: Mocha.Suite) {
4+
context.timeout(DEFAULT_SUITE_TIMEOUT)
5+
}

apps/vscode-e2e/src/suite/tools/apply-diff.test.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ import * as vscode from "vscode"
66
import type { ClineMessage } from "@roo-code/types"
77

88
import { waitFor, sleep } from "../utils"
9+
import { setDefaultSuiteTimeout } from "../test-utils"
10+
11+
suite("Roo Code apply_diff Tool", function () {
12+
setDefaultSuiteTimeout(this)
913

10-
suite("Roo Code apply_diff Tool", () => {
1114
let workspaceDir: string
1215

1316
// Pre-created test files that will be used across tests
@@ -491,9 +494,6 @@ ${testFile.content}\nAssume the file exists and you can modify it directly.`,
491494
})
492495

493496
test("Should handle apply_diff errors gracefully", async function () {
494-
// Increase timeout for this specific test
495-
this.timeout(90_000)
496-
497497
const api = globalThis.api
498498
const messages: ClineMessage[] = []
499499
const testFile = testFiles.errorHandling
@@ -605,9 +605,6 @@ Assume the file exists and you can modify it directly.`,
605605
})
606606

607607
test("Should apply multiple search/replace blocks to edit two separate functions", async function () {
608-
// Increase timeout for this specific test
609-
this.timeout(60_000)
610-
611608
const api = globalThis.api
612609
const messages: ClineMessage[] = []
613610
const testFile = testFiles.multiSearchReplace

apps/vscode-e2e/src/suite/tools/execute-command.test.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ import * as vscode from "vscode"
66
import type { ClineMessage } from "@roo-code/types"
77

88
import { waitFor, sleep, waitUntilCompleted } from "../utils"
9+
import { setDefaultSuiteTimeout } from "../test-utils"
10+
11+
suite("Roo Code execute_command Tool", function () {
12+
setDefaultSuiteTimeout(this)
913

10-
suite("Roo Code execute_command Tool", () => {
1114
let workspaceDir: string
1215

1316
// Pre-created test files that will be used across tests
@@ -331,9 +334,6 @@ Avoid at all costs suggesting a command when using the attempt_completion tool`,
331334
})
332335

333336
test("Should execute multiple commands sequentially", async function () {
334-
// Increase timeout for this test
335-
this.timeout(90_000)
336-
337337
const api = globalThis.api
338338
const testFile = testFiles.multiCommand
339339
let taskStarted = false
@@ -447,9 +447,6 @@ After both commands are executed, use the attempt_completion tool to complete th
447447
})
448448

449449
test("Should handle long-running commands", async function () {
450-
// Increase timeout for this test
451-
this.timeout(60_000)
452-
453450
const api = globalThis.api
454451
let taskStarted = false
455452
let _taskCompleted = false

apps/vscode-e2e/src/suite/tools/insert-content.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ import * as vscode from "vscode"
66
import type { ClineMessage } from "@roo-code/types"
77

88
import { waitFor, sleep } from "../utils"
9+
import { setDefaultSuiteTimeout } from "../test-utils"
10+
11+
suite("Roo Code insert_content Tool", function () {
12+
setDefaultSuiteTimeout(this)
913

10-
suite("Roo Code insert_content Tool", () => {
1114
let workspaceDir: string
1215

1316
// Pre-created test files that will be used across tests

apps/vscode-e2e/src/suite/tools/list-files.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ import * as vscode from "vscode"
66
import type { ClineMessage } from "@roo-code/types"
77

88
import { waitFor, sleep } from "../utils"
9+
import { setDefaultSuiteTimeout } from "../test-utils"
10+
11+
suite("Roo Code list_files Tool", function () {
12+
setDefaultSuiteTimeout(this)
913

10-
suite("Roo Code list_files Tool", () => {
1114
let workspaceDir: string
1215
let testFiles: {
1316
rootFile1: string

apps/vscode-e2e/src/suite/tools/read-file.test.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ import * as vscode from "vscode"
77
import type { ClineMessage } from "@roo-code/types"
88

99
import { waitFor, sleep } from "../utils"
10+
import { setDefaultSuiteTimeout } from "../test-utils"
11+
12+
suite("Roo Code read_file Tool", function () {
13+
setDefaultSuiteTimeout(this)
1014

11-
suite("Roo Code read_file Tool", () => {
1215
let tempDir: string
1316
let testFiles: {
1417
simple: string
@@ -118,7 +121,6 @@ suite("Roo Code read_file Tool", () => {
118121
})
119122

120123
test("Should read a simple text file", async function () {
121-
this.timeout(90_000) // Increase timeout for this test
122124
const api = globalThis.api
123125
const messages: ClineMessage[] = []
124126
let taskStarted = false
@@ -264,7 +266,6 @@ suite("Roo Code read_file Tool", () => {
264266
})
265267

266268
test("Should read a multiline file", async function () {
267-
this.timeout(90_000) // Increase timeout
268269
const api = globalThis.api
269270
const messages: ClineMessage[] = []
270271
let taskCompleted = false
@@ -376,7 +377,6 @@ suite("Roo Code read_file Tool", () => {
376377
})
377378

378379
test("Should read file with line range", async function () {
379-
this.timeout(90_000) // Increase timeout
380380
const api = globalThis.api
381381
const messages: ClineMessage[] = []
382382
let taskCompleted = false
@@ -562,7 +562,6 @@ suite("Roo Code read_file Tool", () => {
562562
})
563563

564564
test("Should read XML content file", async function () {
565-
this.timeout(90_000) // Increase timeout
566565
const api = globalThis.api
567566
const messages: ClineMessage[] = []
568567
let taskCompleted = false
@@ -634,7 +633,6 @@ suite("Roo Code read_file Tool", () => {
634633
})
635634

636635
test("Should read multiple files in sequence", async function () {
637-
this.timeout(90_000) // Increase timeout
638636
const api = globalThis.api
639637
const messages: ClineMessage[] = []
640638
let taskCompleted = false
@@ -708,7 +706,6 @@ Assume both files exist and you can read them directly. Read each file and tell
708706
})
709707

710708
test("Should read large file efficiently", async function () {
711-
this.timeout(90_000) // Increase timeout
712709
const api = globalThis.api
713710
const messages: ClineMessage[] = []
714711
let taskCompleted = false

0 commit comments

Comments
 (0)