mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Increase suite-level e2e test timeout (#4975)
This commit is contained in:
parent
00ad4256d1
commit
bccf11f2eb
14 changed files with 57 additions and 40 deletions
|
|
@ -1,7 +1,11 @@
|
|||
import * as assert from "assert"
|
||||
import * as vscode from "vscode"
|
||||
|
||||
suite("Roo Code Extension", () => {
|
||||
import { setDefaultSuiteTimeout } from "./test-utils"
|
||||
|
||||
suite("Roo Code Extension", function () {
|
||||
setDefaultSuiteTimeout(this)
|
||||
|
||||
test("Commands should be registered", async () => {
|
||||
const expectedCommands = [
|
||||
"SidebarProvider.open",
|
||||
|
|
|
|||
|
|
@ -27,13 +27,11 @@ export async function run() {
|
|||
|
||||
globalThis.api = api
|
||||
|
||||
// Configure Mocha with grep pattern if provided
|
||||
const mochaOptions: Mocha.MochaOptions = {
|
||||
ui: "tdd",
|
||||
timeout: 300_000,
|
||||
timeout: 20 * 60 * 1_000, // 20m
|
||||
}
|
||||
|
||||
// Apply grep filter if TEST_GREP is set
|
||||
if (process.env.TEST_GREP) {
|
||||
mochaOptions.grep = process.env.TEST_GREP
|
||||
console.log(`Running tests matching pattern: ${process.env.TEST_GREP}`)
|
||||
|
|
@ -42,17 +40,16 @@ export async function run() {
|
|||
const mocha = new Mocha(mochaOptions)
|
||||
const cwd = path.resolve(__dirname, "..")
|
||||
|
||||
// Get test files based on filter
|
||||
let testFiles: string[]
|
||||
|
||||
if (process.env.TEST_FILE) {
|
||||
// Run specific test file
|
||||
const specificFile = process.env.TEST_FILE.endsWith(".js")
|
||||
? process.env.TEST_FILE
|
||||
: `${process.env.TEST_FILE}.js`
|
||||
|
||||
testFiles = await glob(`**/${specificFile}`, { cwd })
|
||||
console.log(`Running specific test file: ${specificFile}`)
|
||||
} else {
|
||||
// Run all test files
|
||||
testFiles = await glob("**/**.test.js", { cwd })
|
||||
}
|
||||
|
||||
|
|
@ -62,7 +59,6 @@ export async function run() {
|
|||
|
||||
testFiles.forEach((testFile) => mocha.addFile(path.resolve(cwd, testFile)))
|
||||
|
||||
// Let's go!
|
||||
return new Promise<void>((resolve, reject) =>
|
||||
mocha.run((failures) => (failures === 0 ? resolve() : reject(new Error(`${failures} tests failed.`)))),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
import * as assert from "assert"
|
||||
|
||||
import { waitUntilCompleted } from "./utils"
|
||||
import { setDefaultSuiteTimeout } from "./test-utils"
|
||||
|
||||
suite("Roo Code Modes", function () {
|
||||
setDefaultSuiteTimeout(this)
|
||||
|
||||
suite("Roo Code Modes", () => {
|
||||
test("Should handle switching modes correctly", async () => {
|
||||
const modes: string[] = []
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,11 @@ import * as assert from "assert"
|
|||
import type { ClineMessage } from "@roo-code/types"
|
||||
|
||||
import { waitUntilCompleted } from "./utils"
|
||||
import { setDefaultSuiteTimeout } from "./test-utils"
|
||||
|
||||
suite("Roo Code Task", function () {
|
||||
setDefaultSuiteTimeout(this)
|
||||
|
||||
suite("Roo Code Task", () => {
|
||||
test("Should handle prompt and response correctly", async () => {
|
||||
const api = globalThis.api
|
||||
|
||||
|
|
|
|||
5
apps/vscode-e2e/src/suite/test-utils.ts
Normal file
5
apps/vscode-e2e/src/suite/test-utils.ts
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
export const DEFAULT_SUITE_TIMEOUT = 120_000
|
||||
|
||||
export function setDefaultSuiteTimeout(context: Mocha.Suite) {
|
||||
context.timeout(DEFAULT_SUITE_TIMEOUT)
|
||||
}
|
||||
|
|
@ -6,8 +6,11 @@ import * as vscode from "vscode"
|
|||
import type { ClineMessage } from "@roo-code/types"
|
||||
|
||||
import { waitFor, sleep } from "../utils"
|
||||
import { setDefaultSuiteTimeout } from "../test-utils"
|
||||
|
||||
suite("Roo Code apply_diff Tool", function () {
|
||||
setDefaultSuiteTimeout(this)
|
||||
|
||||
suite("Roo Code apply_diff Tool", () => {
|
||||
let workspaceDir: string
|
||||
|
||||
// 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.`,
|
|||
})
|
||||
|
||||
test("Should handle apply_diff errors gracefully", async function () {
|
||||
// Increase timeout for this specific test
|
||||
this.timeout(90_000)
|
||||
|
||||
const api = globalThis.api
|
||||
const messages: ClineMessage[] = []
|
||||
const testFile = testFiles.errorHandling
|
||||
|
|
@ -605,9 +605,6 @@ Assume the file exists and you can modify it directly.`,
|
|||
})
|
||||
|
||||
test("Should apply multiple search/replace blocks to edit two separate functions", async function () {
|
||||
// Increase timeout for this specific test
|
||||
this.timeout(60_000)
|
||||
|
||||
const api = globalThis.api
|
||||
const messages: ClineMessage[] = []
|
||||
const testFile = testFiles.multiSearchReplace
|
||||
|
|
|
|||
|
|
@ -6,8 +6,11 @@ import * as vscode from "vscode"
|
|||
import type { ClineMessage } from "@roo-code/types"
|
||||
|
||||
import { waitFor, sleep, waitUntilCompleted } from "../utils"
|
||||
import { setDefaultSuiteTimeout } from "../test-utils"
|
||||
|
||||
suite("Roo Code execute_command Tool", function () {
|
||||
setDefaultSuiteTimeout(this)
|
||||
|
||||
suite("Roo Code execute_command Tool", () => {
|
||||
let workspaceDir: string
|
||||
|
||||
// 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`,
|
|||
})
|
||||
|
||||
test("Should execute multiple commands sequentially", async function () {
|
||||
// Increase timeout for this test
|
||||
this.timeout(90_000)
|
||||
|
||||
const api = globalThis.api
|
||||
const testFile = testFiles.multiCommand
|
||||
let taskStarted = false
|
||||
|
|
@ -447,9 +447,6 @@ After both commands are executed, use the attempt_completion tool to complete th
|
|||
})
|
||||
|
||||
test("Should handle long-running commands", async function () {
|
||||
// Increase timeout for this test
|
||||
this.timeout(60_000)
|
||||
|
||||
const api = globalThis.api
|
||||
let taskStarted = false
|
||||
let _taskCompleted = false
|
||||
|
|
|
|||
|
|
@ -6,8 +6,11 @@ import * as vscode from "vscode"
|
|||
import type { ClineMessage } from "@roo-code/types"
|
||||
|
||||
import { waitFor, sleep } from "../utils"
|
||||
import { setDefaultSuiteTimeout } from "../test-utils"
|
||||
|
||||
suite("Roo Code insert_content Tool", function () {
|
||||
setDefaultSuiteTimeout(this)
|
||||
|
||||
suite("Roo Code insert_content Tool", () => {
|
||||
let workspaceDir: string
|
||||
|
||||
// Pre-created test files that will be used across tests
|
||||
|
|
|
|||
|
|
@ -6,8 +6,11 @@ import * as vscode from "vscode"
|
|||
import type { ClineMessage } from "@roo-code/types"
|
||||
|
||||
import { waitFor, sleep } from "../utils"
|
||||
import { setDefaultSuiteTimeout } from "../test-utils"
|
||||
|
||||
suite("Roo Code list_files Tool", function () {
|
||||
setDefaultSuiteTimeout(this)
|
||||
|
||||
suite("Roo Code list_files Tool", () => {
|
||||
let workspaceDir: string
|
||||
let testFiles: {
|
||||
rootFile1: string
|
||||
|
|
|
|||
|
|
@ -7,8 +7,11 @@ import * as vscode from "vscode"
|
|||
import type { ClineMessage } from "@roo-code/types"
|
||||
|
||||
import { waitFor, sleep } from "../utils"
|
||||
import { setDefaultSuiteTimeout } from "../test-utils"
|
||||
|
||||
suite("Roo Code read_file Tool", function () {
|
||||
setDefaultSuiteTimeout(this)
|
||||
|
||||
suite("Roo Code read_file Tool", () => {
|
||||
let tempDir: string
|
||||
let testFiles: {
|
||||
simple: string
|
||||
|
|
@ -118,7 +121,6 @@ suite("Roo Code read_file Tool", () => {
|
|||
})
|
||||
|
||||
test("Should read a simple text file", async function () {
|
||||
this.timeout(90_000) // Increase timeout for this test
|
||||
const api = globalThis.api
|
||||
const messages: ClineMessage[] = []
|
||||
let taskStarted = false
|
||||
|
|
@ -264,7 +266,6 @@ suite("Roo Code read_file Tool", () => {
|
|||
})
|
||||
|
||||
test("Should read a multiline file", async function () {
|
||||
this.timeout(90_000) // Increase timeout
|
||||
const api = globalThis.api
|
||||
const messages: ClineMessage[] = []
|
||||
let taskCompleted = false
|
||||
|
|
@ -376,7 +377,6 @@ suite("Roo Code read_file Tool", () => {
|
|||
})
|
||||
|
||||
test("Should read file with line range", async function () {
|
||||
this.timeout(90_000) // Increase timeout
|
||||
const api = globalThis.api
|
||||
const messages: ClineMessage[] = []
|
||||
let taskCompleted = false
|
||||
|
|
@ -562,7 +562,6 @@ suite("Roo Code read_file Tool", () => {
|
|||
})
|
||||
|
||||
test("Should read XML content file", async function () {
|
||||
this.timeout(90_000) // Increase timeout
|
||||
const api = globalThis.api
|
||||
const messages: ClineMessage[] = []
|
||||
let taskCompleted = false
|
||||
|
|
@ -634,7 +633,6 @@ suite("Roo Code read_file Tool", () => {
|
|||
})
|
||||
|
||||
test("Should read multiple files in sequence", async function () {
|
||||
this.timeout(90_000) // Increase timeout
|
||||
const api = globalThis.api
|
||||
const messages: ClineMessage[] = []
|
||||
let taskCompleted = false
|
||||
|
|
@ -708,7 +706,6 @@ Assume both files exist and you can read them directly. Read each file and tell
|
|||
})
|
||||
|
||||
test("Should read large file efficiently", async function () {
|
||||
this.timeout(90_000) // Increase timeout
|
||||
const api = globalThis.api
|
||||
const messages: ClineMessage[] = []
|
||||
let taskCompleted = false
|
||||
|
|
|
|||
|
|
@ -6,8 +6,11 @@ import * as vscode from "vscode"
|
|||
import type { ClineMessage } from "@roo-code/types"
|
||||
|
||||
import { waitFor, sleep } from "../utils"
|
||||
import { setDefaultSuiteTimeout } from "../test-utils"
|
||||
|
||||
suite("Roo Code search_and_replace Tool", function () {
|
||||
setDefaultSuiteTimeout(this)
|
||||
|
||||
suite("Roo Code search_and_replace Tool", () => {
|
||||
let workspaceDir: string
|
||||
|
||||
// Pre-created test files that will be used across tests
|
||||
|
|
@ -253,9 +256,6 @@ Assume the file exists and you can modify it directly.`,
|
|||
})
|
||||
|
||||
test("Should perform regex pattern replacement", async function () {
|
||||
// Increase timeout for this test
|
||||
this.timeout(90_000)
|
||||
|
||||
const api = globalThis.api
|
||||
const messages: ClineMessage[] = []
|
||||
const testFile = testFiles.regexReplace
|
||||
|
|
|
|||
|
|
@ -6,8 +6,11 @@ import * as vscode from "vscode"
|
|||
import type { ClineMessage } from "@roo-code/types"
|
||||
|
||||
import { waitFor, sleep } from "../utils"
|
||||
import { setDefaultSuiteTimeout } from "../test-utils"
|
||||
|
||||
suite("Roo Code search_files Tool", function () {
|
||||
setDefaultSuiteTimeout(this)
|
||||
|
||||
suite("Roo Code search_files Tool", () => {
|
||||
let workspaceDir: string
|
||||
let testFiles: {
|
||||
jsFile: string
|
||||
|
|
|
|||
|
|
@ -7,8 +7,11 @@ import * as vscode from "vscode"
|
|||
import type { ClineMessage } from "@roo-code/types"
|
||||
|
||||
import { waitFor, sleep } from "../utils"
|
||||
import { setDefaultSuiteTimeout } from "../test-utils"
|
||||
|
||||
suite("Roo Code use_mcp_tool Tool", function () {
|
||||
setDefaultSuiteTimeout(this)
|
||||
|
||||
suite("Roo Code use_mcp_tool Tool", () => {
|
||||
let tempDir: string
|
||||
let testFiles: {
|
||||
simple: string
|
||||
|
|
|
|||
|
|
@ -6,8 +6,11 @@ import * as os from "os"
|
|||
import type { ClineMessage } from "@roo-code/types"
|
||||
|
||||
import { waitFor, sleep } from "../utils"
|
||||
import { setDefaultSuiteTimeout } from "../test-utils"
|
||||
|
||||
suite("Roo Code write_to_file Tool", function () {
|
||||
setDefaultSuiteTimeout(this)
|
||||
|
||||
suite("Roo Code write_to_file Tool", () => {
|
||||
let tempDir: string
|
||||
let testFilePath: string
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue