Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/test/sanity/src/main.ts
5240 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import minimist from 'minimist';
7
import os from 'os';
8
import { setup as setupCliTests } from './cli.test.js';
9
import { TestContext } from './context.js';
10
import { setup as setupDesktopTests } from './desktop.test.js';
11
import { setup as setupServerTests } from './server.test.js';
12
import { setup as setupServerWebTests } from './serverWeb.test.js';
13
import { setup as setupWSLTests } from './wsl.test.js';
14
15
const options = minimist(process.argv.slice(2), {
16
string: ['commit', 'quality'],
17
boolean: ['cleanup', 'verbose', 'signing-check', 'headless', 'detection'],
18
alias: { commit: 'c', quality: 'q', verbose: 'v' },
19
default: { cleanup: true, verbose: false, 'signing-check': true, headless: true, 'detection': true },
20
});
21
22
if (!options.commit) {
23
throw new Error('--commit is required');
24
}
25
26
if (!options.quality) {
27
throw new Error('--quality is required');
28
}
29
30
const context = new TestContext({
31
quality: options.quality,
32
commit: options.commit,
33
verbose: options.verbose,
34
cleanup: options.cleanup,
35
checkSigning: options['signing-check'],
36
headlessBrowser: options.headless,
37
downloadOnly: !options['detection'],
38
});
39
40
context.log(`Arguments: ${process.argv.slice(2).join(' ')}`);
41
context.log(`Platform: ${os.platform()}, Architecture: ${os.arch()}`);
42
context.log(`Capabilities: ${Array.from(context.capabilities).join(', ')}`);
43
44
beforeEach(function () {
45
context.consoleOutputs = [];
46
(this.currentTest! as { consoleOutputs?: string[] }).consoleOutputs = context.consoleOutputs;
47
});
48
49
setupCliTests(context);
50
setupDesktopTests(context);
51
setupServerTests(context);
52
setupServerWebTests(context);
53
setupWSLTests(context);
54
55