-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix: skip flaky Windows test in custom-system-prompt.spec.ts #8023
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
947027d
2275ab9
ac2cca4
b5439c5
dad992e
1880e6e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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", | ||||||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of completely skipping this test on Windows, have we considered using a longer timeout specifically for Windows? This would maintain test coverage while accommodating the platform-specific performance issue:
Suggested change
Then we could add |
||||||||||
| 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 | ||||||||||
|
|
||||||||||
Uh oh!
There was an error while loading. Please reload this page.