Skip to content

Commit 17d2d65

Browse files
committed
try to accommodate darwin agents in CI
1 parent a9f6355 commit 17d2d65

File tree

1 file changed

+32
-10
lines changed

1 file changed

+32
-10
lines changed

Gulpfile.js

+32-10
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ import esbuild from "rollup-plugin-esbuild";
2828
import ts from "typescript";
2929
configDotenv();
3030
const DESTINATION = "out";
31+
3132
const IS_CI = process.env.CI != null;
3233
const IS_WINDOWS = process.platform === "win32";
34+
const IS_MAC = process.platform === "darwin";
3335

3436
export const ci = parallel(check, build, lint);
3537
export const test = series(clean, testBuild, testRun);
@@ -613,15 +615,13 @@ export async function testRun() {
613615
const reportCoverage = IS_CI || process.argv.indexOf("--coverage", 2) >= 0;
614616
// argv array is something like ['gulp', 'test', '-t', 'something'], we look for the one after -t
615617
const testFilter = process.argv.find((v, i, a) => i > 0 && a[i - 1] === "-t");
616-
await runTests({
617-
version: process.env.VSCODE_VERSION,
618-
extensionDevelopmentPath: resolve(DESTINATION),
619-
extensionTestsPath: resolve(DESTINATION + "/src/testing.js"),
620-
extensionTestsEnv: {
621-
// used by https://mochajs.org/api/mocha#fgrep for running isolated tests
622-
FGREP: testFilter,
623-
},
624-
launchArgs: [
618+
619+
// adjust the launch arguments depending on the environment
620+
const launchArgs = [];
621+
if (IS_CI && IS_MAC) {
622+
launchArgs.push("--disable-gpu", "--disable-extensions", "--disable-telemetry");
623+
} else {
624+
launchArgs.push(
625625
"--no-sandbox",
626626
"--profile-temp",
627627
"--skip-release-notes",
@@ -631,8 +631,30 @@ export async function testRun() {
631631
"--disable-updates",
632632
"--disable-workspace-trust",
633633
"--disable-extensions",
634-
],
634+
);
635+
}
636+
637+
await runTests({
638+
version: process.env.VSCODE_VERSION,
639+
extensionDevelopmentPath: resolve(DESTINATION),
640+
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+
},
655+
launchArgs,
635656
});
657+
636658
if (reportCoverage) {
637659
let coverageMap = libCoverage.createCoverageMap();
638660
let sourceMapStore = libSourceMaps.createSourceMapStore();

0 commit comments

Comments
 (0)