Skip to content

Commit c97fa27

Browse files
committed
conversion CRLF -> LF
1 parent c493ca8 commit c97fa27

File tree

4 files changed

+619
-619
lines changed

4 files changed

+619
-619
lines changed
Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
# Proxy setup
2-
3-
In case of network behind the proxy, the following variables must be set:
4-
5-
- `http_proxy` - URL to proxy, incl. protocol and port, e.g. http://acme.com:80
6-
- `no_proxy` - URL patterns that must not use proxy. In particular, corporate/internal NPM module repositories must be enumerated in no_proxy env var.
7-
8-
Internally (in package.json), the globalAgent/bootstrap is used with `GLOBAL_AGENT_{HTTP,NO}_PROXY`
9-
set to the appropriate env variable. The environment variables `http_proxy` and `no_proxy` are read by npm package manager.
10-
11-
12-
# Prepare for testing
13-
14-
Ensure that all necessary npm modules are installed. Run
15-
- `npm install`
16-
to update the local node_modules module cache, if any changes were pulled for `package.json`.
17-
18-
You need to compile the VisualVM extension itself, and the test code before launching the tests.
19-
- `npm run compile`
20-
- `npm run pretest`
21-
22-
23-
# Run the tests from the CLI
24-
1+
# Proxy setup
2+
3+
In case of network behind the proxy, the following variables must be set:
4+
5+
- `http_proxy` - URL to proxy, incl. protocol and port, e.g. http://acme.com:80
6+
- `no_proxy` - URL patterns that must not use proxy. In particular, corporate/internal NPM module repositories must be enumerated in no_proxy env var.
7+
8+
Internally (in package.json), the globalAgent/bootstrap is used with `GLOBAL_AGENT_{HTTP,NO}_PROXY`
9+
set to the appropriate env variable. The environment variables `http_proxy` and `no_proxy` are read by npm package manager.
10+
11+
12+
# Prepare for testing
13+
14+
Ensure that all necessary npm modules are installed. Run
15+
- `npm install`
16+
to update the local node_modules module cache, if any changes were pulled for `package.json`.
17+
18+
You need to compile the VisualVM extension itself, and the test code before launching the tests.
19+
- `npm run compile`
20+
- `npm run pretest`
21+
22+
23+
# Run the tests from the CLI
24+
2525
Tests can be executed by `npm run test`. The test bootstrap will download a separate installation of vscode into `.vscode-test` directory and then duplicated into `output/a vscode-test` to test the space in path of vscode installation. The testing environment will use a **separate** extensions dir (`.vscode-test/extensions`) and user dir (`.vscode-test/user-data`). The tested vscode installation is completely separated from the development one.
Lines changed: 105 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,106 @@
1-
/*
2-
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
3-
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4-
*
5-
* This code is free software; you can redistribute it and/or modify it
6-
* under the terms of the GNU General Public License version 2 only, as
7-
* published by the Free Software Foundation. Oracle designates this
8-
* particular file as subject to the "Classpath" exception as provided
9-
* by Oracle in the LICENSE file that accompanied this code.
10-
*
11-
* This code is distributed in the hope that it will be useful, but WITHOUT
12-
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13-
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14-
* version 2 for more details (a copy is included in the LICENSE file that
15-
* accompanied this code).
16-
*
17-
* You should have received a copy of the GNU General Public License version
18-
* 2 along with this work; if not, write to the Free Software Foundation,
19-
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20-
*
21-
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22-
* or visit www.oracle.com if you need additional information or have any
23-
* questions.
24-
*/
25-
26-
import { downloadAndUnzipVSCode,
27-
runTests
28-
} from '@vscode/test-electron';
29-
import * as path from 'path';
30-
import * as fs from 'fs';
31-
32-
33-
34-
35-
async function main() {
36-
try {
37-
// The folder containing the Extension Manifest package.json
38-
// Passed to `--extensionDevelopmentPath`
39-
const extensionDevelopmentPath = path.resolve(__dirname, '../../');
40-
41-
// The path to the extension test runner script
42-
// Passed to --extensionTestsPath
43-
const extensionTestsPath = path.resolve(__dirname, './suite/index');
44-
45-
// The path to the test project
46-
const testWorkspace = path.resolve(__dirname, '../../fixtures/test projects/demo');
47-
48-
// Manually download latest stable VS Code release for testing.
49-
const vscodeExecutablePath = await downloadAndUnzipVSCode('1.89.0');
50-
51-
const outputFolder = path.resolve(__dirname, '../../output');
52-
53-
if (!fs.existsSync(outputFolder)) {
54-
fs.mkdirSync(outputFolder);
55-
}
56-
57-
const noSpacePath = path.resolve(__dirname, '../../.vscode-test');
58-
const spacePath = path.resolve(__dirname, '../../output/a vscode-test');
59-
const splitPath = vscodeExecutablePath.split('\\');
60-
const exeFile = splitPath.pop();
61-
const vscodeFolder = splitPath.pop();
62-
63-
let newVscodeExecutablePath: string = vscodeExecutablePath;
64-
if (vscodeFolder && exeFile) {
65-
newVscodeExecutablePath = path.join(spacePath, vscodeFolder, exeFile);
66-
}
67-
68-
if (!fs.existsSync(spacePath)) {
69-
duplicate(noSpacePath, spacePath);
70-
}
71-
72-
await runTests({
73-
vscodeExecutablePath: newVscodeExecutablePath,
74-
extensionDevelopmentPath,
75-
extensionTestsPath,
76-
launchArgs: [testWorkspace]
77-
});
78-
79-
} catch (err) {
80-
console.error(err);
81-
console.error('Failed to run tests');
82-
process.exit(1);
83-
}
84-
}
85-
86-
main();
87-
88-
function duplicate(sourceFolder: string, targetFolder: string) {
89-
90-
if (!fs.existsSync(targetFolder)) {
91-
fs.mkdirSync(targetFolder);
92-
}
93-
94-
const content = fs.readdirSync(sourceFolder);
95-
96-
content.forEach((element) => {
97-
const sourcePath = path.join(sourceFolder, element);
98-
const targetPath = path.join(targetFolder, element);
99-
100-
if (fs.lstatSync(sourcePath).isDirectory()) {
101-
duplicate(sourcePath, targetPath);
102-
} else {
103-
fs.copyFileSync(sourcePath, targetPath);
104-
}
105-
});
1+
/*
2+
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation. Oracle designates this
8+
* particular file as subject to the "Classpath" exception as provided
9+
* by Oracle in the LICENSE file that accompanied this code.
10+
*
11+
* This code is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+
* version 2 for more details (a copy is included in the LICENSE file that
15+
* accompanied this code).
16+
*
17+
* You should have received a copy of the GNU General Public License version
18+
* 2 along with this work; if not, write to the Free Software Foundation,
19+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+
*
21+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+
* or visit www.oracle.com if you need additional information or have any
23+
* questions.
24+
*/
25+
26+
import { downloadAndUnzipVSCode,
27+
runTests
28+
} from '@vscode/test-electron';
29+
import * as path from 'path';
30+
import * as fs from 'fs';
31+
32+
33+
34+
35+
async function main() {
36+
try {
37+
// The folder containing the Extension Manifest package.json
38+
// Passed to `--extensionDevelopmentPath`
39+
const extensionDevelopmentPath = path.resolve(__dirname, '../../');
40+
41+
// The path to the extension test runner script
42+
// Passed to --extensionTestsPath
43+
const extensionTestsPath = path.resolve(__dirname, './suite/index');
44+
45+
// The path to the test project
46+
const testWorkspace = path.resolve(__dirname, '../../fixtures/test projects/demo');
47+
48+
// Manually download latest stable VS Code release for testing.
49+
const vscodeExecutablePath = await downloadAndUnzipVSCode('1.89.0');
50+
51+
const outputFolder = path.resolve(__dirname, '../../output');
52+
53+
if (!fs.existsSync(outputFolder)) {
54+
fs.mkdirSync(outputFolder);
55+
}
56+
57+
const noSpacePath = path.resolve(__dirname, '../../.vscode-test');
58+
const spacePath = path.resolve(__dirname, '../../output/a vscode-test');
59+
const splitPath = vscodeExecutablePath.split('\\');
60+
const exeFile = splitPath.pop();
61+
const vscodeFolder = splitPath.pop();
62+
63+
let newVscodeExecutablePath: string = vscodeExecutablePath;
64+
if (vscodeFolder && exeFile) {
65+
newVscodeExecutablePath = path.join(spacePath, vscodeFolder, exeFile);
66+
}
67+
68+
if (!fs.existsSync(spacePath)) {
69+
duplicate(noSpacePath, spacePath);
70+
}
71+
72+
await runTests({
73+
vscodeExecutablePath: newVscodeExecutablePath,
74+
extensionDevelopmentPath,
75+
extensionTestsPath,
76+
launchArgs: [testWorkspace]
77+
});
78+
79+
} catch (err) {
80+
console.error(err);
81+
console.error('Failed to run tests');
82+
process.exit(1);
83+
}
84+
}
85+
86+
main();
87+
88+
function duplicate(sourceFolder: string, targetFolder: string) {
89+
90+
if (!fs.existsSync(targetFolder)) {
91+
fs.mkdirSync(targetFolder);
92+
}
93+
94+
const content = fs.readdirSync(sourceFolder);
95+
96+
content.forEach((element) => {
97+
const sourcePath = path.join(sourceFolder, element);
98+
const targetPath = path.join(targetFolder, element);
99+
100+
if (fs.lstatSync(sourcePath).isDirectory()) {
101+
duplicate(sourcePath, targetPath);
102+
} else {
103+
fs.copyFileSync(sourcePath, targetPath);
104+
}
105+
});
106106
}

0 commit comments

Comments
 (0)