Skip to content

Commit 183211e

Browse files
committed
another attempt
1 parent 17d2d65 commit 183211e

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

Gulpfile.js

+21-18
Original file line numberDiff line numberDiff line change
@@ -616,11 +616,19 @@ export async function testRun() {
616616
// argv array is something like ['gulp', 'test', '-t', 'something'], we look for the one after -t
617617
const testFilter = process.argv.find((v, i, a) => i > 0 && a[i - 1] === "-t");
618618

619-
// adjust the launch arguments depending on the environment
619+
// adjust the launch arguments and env vars depending on the environment
620+
// (darwin CI needs to run in headless mode)
621+
let extensionTestsEnv = {};
620622
const launchArgs = [];
621-
if (IS_CI && IS_MAC) {
622-
launchArgs.push("--disable-gpu", "--disable-extensions", "--disable-telemetry");
623-
} else {
623+
if (!(IS_CI && IS_MAC)) {
624+
extensionTestsEnv = {
625+
ELECTRON_ENABLE_LOGGING: "true",
626+
ELECTRON_ENABLE_STACK_DUMPING: "true",
627+
ELECTRON_NO_ATTACH_CONSOLE: "true",
628+
ELECTRON_NO_SANDBOX: "1",
629+
VSCODE_CLI: "1",
630+
ELECTRON_RUN_AS_NODE: "1",
631+
};
624632
launchArgs.push(
625633
"--no-sandbox",
626634
"--profile-temp",
@@ -632,26 +640,21 @@ export async function testRun() {
632640
"--disable-workspace-trust",
633641
"--disable-extensions",
634642
);
643+
} else {
644+
extensionTestsEnv = {
645+
// used by https://mochajs.org/api/mocha#fgrep for running isolated tests
646+
FGREP: testFilter,
647+
};
635648
}
649+
console.log(`Running tests for ${process.platform}-${process.arch}`);
650+
console.log(`Launch args: ${launchArgs.join(" ")}`);
651+
console.log(`Env vars: ${JSON.stringify(extensionTestsEnv)}`);
636652

637653
await runTests({
638654
version: process.env.VSCODE_VERSION,
639655
extensionDevelopmentPath: resolve(DESTINATION),
640656
extensionTestsPath: resolve(DESTINATION + "/src/testing.js"),
641-
extensionTestsEnv: {
642-
// used by https://mochajs.org/api/mocha#fgrep for running isolated tests
643-
FGREP: testFilter,
644-
// additional environment variables for macOS in CI for headless mode
645-
...(IS_CI &&
646-
IS_MAC && {
647-
ELECTRON_ENABLE_LOGGING: "true",
648-
ELECTRON_ENABLE_STACK_DUMPING: "true",
649-
ELECTRON_NO_ATTACH_CONSOLE: "true",
650-
ELECTRON_NO_SANDBOX: "1",
651-
VSCODE_CLI: "1",
652-
ELECTRON_RUN_AS_NODE: "1",
653-
}),
654-
},
657+
extensionTestsEnv,
655658
launchArgs,
656659
});
657660

0 commit comments

Comments
 (0)