@@ -28,8 +28,10 @@ import esbuild from "rollup-plugin-esbuild";
28
28
import ts from "typescript" ;
29
29
configDotenv ( ) ;
30
30
const DESTINATION = "out" ;
31
+
31
32
const IS_CI = process . env . CI != null ;
32
33
const IS_WINDOWS = process . platform === "win32" ;
34
+ const IS_MAC = process . platform === "darwin" ;
33
35
34
36
export const ci = parallel ( check , build , lint ) ;
35
37
export const test = series ( clean , testBuild , testRun ) ;
@@ -613,15 +615,13 @@ export async function testRun() {
613
615
const reportCoverage = IS_CI || process . argv . indexOf ( "--coverage" , 2 ) >= 0 ;
614
616
// argv array is something like ['gulp', 'test', '-t', 'something'], we look for the one after -t
615
617
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 (
625
625
"--no-sandbox" ,
626
626
"--profile-temp" ,
627
627
"--skip-release-notes" ,
@@ -631,8 +631,30 @@ export async function testRun() {
631
631
"--disable-updates" ,
632
632
"--disable-workspace-trust" ,
633
633
"--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,
635
656
} ) ;
657
+
636
658
if ( reportCoverage ) {
637
659
let coverageMap = libCoverage . createCoverageMap ( ) ;
638
660
let sourceMapStore = libSourceMaps . createSourceMapStore ( ) ;
0 commit comments