Przeglądaj źródła

fix: skip flaky Windows test in custom-system-prompt.spec.ts (#8023)

Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
Co-authored-by: Roo Code <[email protected]>
Co-authored-by: Matt Rubens <[email protected]>
roomote[bot] 3 miesięcy temu
rodzic
commit
6d8de53c8f

+ 35 - 31
src/core/prompts/__tests__/custom-system-prompt.spec.ts

@@ -83,38 +83,42 @@ describe("File-Based Custom System Prompt", () => {
 		mockedFs.readFile.mockRejectedValue({ code: "ENOENT" })
 	})
 
-	it("should use default generation when no file-based system prompt is found", async () => {
-		const customModePrompts = {
-			[defaultModeSlug]: {
-				roleDefinition: "Test role definition",
-			},
-		}
-
-		const prompt = await SYSTEM_PROMPT(
-			mockContext,
-			"test/path", // Using a relative path without leading slash
-			false, // supportsComputerUse
-			undefined, // mcpHub
-			undefined, // diffStrategy
-			undefined, // browserViewportSize
-			defaultModeSlug, // mode
-			customModePrompts, // customModePrompts
-			undefined, // customModes
-			undefined, // globalCustomInstructions
-			undefined, // diffEnabled
-			undefined, // experiments
-			true, // enableMcpServerCreation
-			undefined, // language
-			undefined, // rooIgnoreInstructions
-			undefined, // partialReadsEnabled
-		)
+	// Skipped on Windows due to timeout/flake issues
+	it.skipIf(process.platform === "win32")(
+		"should use default generation when no file-based system prompt is found",
+		async () => {
+			const customModePrompts = {
+				[defaultModeSlug]: {
+					roleDefinition: "Test role definition",
+				},
+			}
 
-		// Should contain default sections
-		expect(prompt).toContain("TOOL USE")
-		expect(prompt).toContain("CAPABILITIES")
-		expect(prompt).toContain("MODES")
-		expect(prompt).toContain("Test role definition")
-	})
+			const prompt = await SYSTEM_PROMPT(
+				mockContext,
+				"test/path", // Using a relative path without leading slash
+				false, // supportsComputerUse
+				undefined, // mcpHub
+				undefined, // diffStrategy
+				undefined, // browserViewportSize
+				defaultModeSlug, // mode
+				customModePrompts, // customModePrompts
+				undefined, // customModes
+				undefined, // globalCustomInstructions
+				undefined, // diffEnabled
+				undefined, // experiments
+				true, // enableMcpServerCreation
+				undefined, // language
+				undefined, // rooIgnoreInstructions
+				undefined, // partialReadsEnabled
+			)
+
+			// Should contain default sections
+			expect(prompt).toContain("TOOL USE")
+			expect(prompt).toContain("CAPABILITIES")
+			expect(prompt).toContain("MODES")
+			expect(prompt).toContain("Test role definition")
+		},
+	)
 
 	it("should use file-based custom system prompt when available", async () => {
 		// Mock the readFile to return content from a file