Skip to content

Commit 367fc5f

Browse files
authored
exp - introduce and use flag to disable experiments (microsoft#254057)
* exp - introduce and use flag to disable experiments * fix
1 parent 93858ca commit 367fc5f

File tree

18 files changed

+28
-9
lines changed

18 files changed

+28
-9
lines changed

.vscode-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const extensions = [
8484

8585

8686
const defaultLaunchArgs = process.env.API_TESTS_EXTRA_ARGS?.split(' ') || [
87-
'--disable-telemetry', '--skip-welcome', '--skip-release-notes', `--crash-reporter-directory=${__dirname}/.build/crashes`, `--logsPath=${__dirname}/.build/logs/integration-tests`, '--no-cached-data', '--disable-updates', '--use-inmemory-secretstorage', '--disable-extensions', '--disable-workspace-trust'
87+
'--disable-telemetry', '--disable-experiments', '--skip-welcome', '--skip-release-notes', `--crash-reporter-directory=${__dirname}/.build/crashes`, `--logsPath=${__dirname}/.build/logs/integration-tests`, '--no-cached-data', '--disable-updates', '--use-inmemory-secretstorage', '--disable-extensions', '--disable-workspace-trust'
8888
];
8989

9090
const config = defineConfig(extensions.map(extension => {

extensions/vscode-test-resolver/src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export function activate(context: vscode.ExtensionContext) {
142142
}
143143

144144
const { updateUrl, commit, quality, serverDataFolderName, serverApplicationName, dataFolderName } = getProductConfiguration();
145-
const commandArgs = ['--host=127.0.0.1', '--port=0', '--disable-telemetry', '--use-host-proxy', '--accept-server-license-terms'];
145+
const commandArgs = ['--host=127.0.0.1', '--port=0', '--disable-telemetry', '--disable-experiments', '--use-host-proxy', '--accept-server-license-terms'];
146146
const env = getNewEnv();
147147
const remoteDataDir = process.env['TESTRESOLVER_DATA_FOLDER'] || path.join(os.homedir(), `${serverDataFolderName || dataFolderName}-testresolver`);
148148
const logsDir = process.env['TESTRESOLVER_LOGS_FOLDER'];

scripts/test-integration.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ if %errorlevel% neq 0 exit /b %errorlevel%
3535

3636
:: Tests in the extension host
3737

38-
set API_TESTS_EXTRA_ARGS=--disable-telemetry --skip-welcome --skip-release-notes --crash-reporter-directory=%VSCODECRASHDIR% --logsPath=%VSCODELOGSDIR% --no-cached-data --disable-updates --use-inmemory-secretstorage --disable-extensions --disable-workspace-trust --user-data-dir=%VSCODEUSERDATADIR%
38+
set API_TESTS_EXTRA_ARGS=--disable-telemetry --disable-experiments --skip-welcome --skip-release-notes --crash-reporter-directory=%VSCODECRASHDIR% --logsPath=%VSCODELOGSDIR% --no-cached-data --disable-updates --use-inmemory-secretstorage --disable-extensions --disable-workspace-trust --user-data-dir=%VSCODEUSERDATADIR%
3939

4040
echo.
4141
echo ### API tests (folder)

scripts/test-integration.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ echo
4141

4242
# Tests in the extension host
4343

44-
API_TESTS_EXTRA_ARGS="--disable-telemetry --skip-welcome --skip-release-notes --crash-reporter-directory=$VSCODECRASHDIR --logsPath=$VSCODELOGSDIR --no-cached-data --disable-updates --use-inmemory-secretstorage --disable-extensions --disable-workspace-trust --user-data-dir=$VSCODEUSERDATADIR"
44+
API_TESTS_EXTRA_ARGS="--disable-telemetry --disable-experiments --skip-welcome --skip-release-notes --crash-reporter-directory=$VSCODECRASHDIR --logsPath=$VSCODELOGSDIR --no-cached-data --disable-updates --use-inmemory-secretstorage --disable-extensions --disable-workspace-trust --user-data-dir=$VSCODEUSERDATADIR"
4545

4646
if [ -z "$INTEGRATION_TEST_APP_NAME" ]; then
4747
kill_app() { true; }

scripts/test-remote-integration.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ echo Storing log files into '%VSCODELOGSDIR%'
5555

5656
:: Tests in the extension host
5757

58-
set API_TESTS_EXTRA_ARGS=--disable-telemetry --skip-welcome --skip-release-notes --crash-reporter-directory=%VSCODECRASHDIR% --logsPath=%VSCODELOGSDIR% --no-cached-data --disable-updates --use-inmemory-secretstorage --disable-inspect --disable-workspace-trust --user-data-dir=%VSCODEUSERDATADIR%
58+
set API_TESTS_EXTRA_ARGS=--disable-telemetry --disable-experiments --skip-welcome --skip-release-notes --crash-reporter-directory=%VSCODECRASHDIR% --logsPath=%VSCODELOGSDIR% --no-cached-data --disable-updates --use-inmemory-secretstorage --disable-inspect --disable-workspace-trust --user-data-dir=%VSCODEUSERDATADIR%
5959

6060
echo.
6161
echo ### API tests (folder)

scripts/test-remote-integration.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ else
6565
kill_app() { killall $INTEGRATION_TEST_APP_NAME || true; }
6666
fi
6767

68-
API_TESTS_EXTRA_ARGS="--disable-telemetry --skip-welcome --skip-release-notes --crash-reporter-directory=$VSCODECRASHDIR --logsPath=$VSCODELOGSDIR --no-cached-data --disable-updates --use-inmemory-secretstorage --disable-workspace-trust --user-data-dir=$VSCODEUSERDATADIR"
68+
API_TESTS_EXTRA_ARGS="--disable-telemetry --disable-experiments --skip-welcome --skip-release-notes --crash-reporter-directory=$VSCODECRASHDIR --logsPath=$VSCODELOGSDIR --no-cached-data --disable-updates --use-inmemory-secretstorage --disable-workspace-trust --user-data-dir=$VSCODEUSERDATADIR"
6969

7070
echo "Storing crash reports into '$VSCODECRASHDIR'."
7171
echo "Storing log files into '$VSCODELOGSDIR'."

src/vs/editor/standalone/browser/standaloneServices.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ class StandaloneEnvironmentService implements IEnvironmentService {
229229
readonly debugExtensionHost: IExtensionHostDebugParams = { port: null, break: false };
230230
readonly isExtensionDevelopment: boolean = false;
231231
readonly disableExtensions: boolean | string[] = false;
232+
readonly disableExperiments: boolean = false;
232233
readonly enableExtensions?: readonly string[] | undefined = undefined;
233234
readonly extensionDevelopmentLocationURI?: URI[] | undefined = undefined;
234235
readonly extensionDevelopmentKind?: ExtensionKind[] | undefined = undefined;

src/vs/platform/environment/common/argv.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ export interface NativeParsedArgs {
139139
'enable-rdp-display-tracking'?: boolean;
140140
'disable-layout-restore'?: boolean;
141141
'startup-experiment-group'?: string;
142+
'disable-experiments'?: boolean;
142143

143144
// chromium command line args: https://electronjs.org/docs/all#supported-chrome-command-line-switches
144145
'no-proxy-server'?: boolean;

src/vs/platform/environment/common/environment.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ export interface IEnvironmentService {
8383
verbose: boolean;
8484
isBuilt: boolean;
8585

86-
// --- telemetry
86+
// --- telemetry/exp
8787
disableTelemetry: boolean;
88+
disableExperiments: boolean;
8889
serviceMachineIdResource: URI;
8990

9091
// --- Policy

src/vs/platform/environment/common/environmentService.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,9 @@ export abstract class AbstractNativeEnvironmentService implements INativeEnviron
230230
@memoize
231231
get disableTelemetry(): boolean { return !!this.args['disable-telemetry']; }
232232

233+
@memoize
234+
get disableExperiments(): boolean { return !!this.args['disable-experiments']; }
235+
233236
@memoize
234237
get disableWorkspaceTrust(): boolean { return !!this.args['disable-workspace-trust']; }
235238

0 commit comments

Comments
 (0)