Skip to content

Commit 08675b7

Browse files
committed
fix: flaky UI in CI
1 parent 385683b commit 08675b7

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

esbuild.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
const { build, context } = require("esbuild");
22

3+
const isProduction =
4+
process.argv.includes("--production") || process.env.NODE_ENV === "production";
5+
36
const baseConfig = {
47
bundle: true,
5-
minify: process.env.NODE_ENV === "production",
6-
sourcemap: process.env.NODE_ENV !== "production",
8+
minify: isProduction,
9+
sourcemap: !isProduction,
710
};
811

912
const extensionConfig = {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@
536536
"scripts": {
537537
"vscode:prepublish": "npm run package",
538538
"compile": "node ./esbuild.js",
539-
"package": "NODE_ENV=production node ./esbuild.js",
539+
"package": "node ./esbuild.js --production",
540540
"watch": "node ./esbuild.js --watch",
541541
"lint": "eslint --ext ts --color -c .eslintrc.cjs src",
542542
"test": "npm run test:unit && npm run test:ext",

test/ui/suite/commands.ui.test.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ async function openSampleFile(): Promise<TextEditor> {
8181
return false;
8282
}
8383
},
84-
10_000,
85-
200,
84+
20_000,
85+
500,
8686
);
8787
return (await editorView.openEditor(SAMPLE_FILE_BASENAME)) as TextEditor;
8888
}
@@ -193,9 +193,17 @@ describe("weAudit Command UI Tests", () => {
193193
let workbench: Workbench;
194194

195195
before(async function () {
196+
this.timeout(120_000);
196197
workbench = new Workbench();
197198
await VSBrowser.instance.openResources(SAMPLE_WORKSPACE);
198199
await VSBrowser.instance.waitForWorkbench(60_000);
200+
201+
// Wait for the workspace to fully load before running tests.
202+
// In CI the explorer may not be ready immediately after waitForWorkbench.
203+
await VSBrowser.instance.driver.sleep(2000);
204+
205+
// Ensure the sample file can be opened before any test begins
206+
await openSampleFile();
199207
});
200208

201209
beforeEach(async function () {

0 commit comments

Comments
 (0)