Skip to content

Commit 27b574f

Browse files
committed
Use 1.56.0 version of VSCode to run test to avoid trusted workspaces
Signed-off-by: Denis Golovin [email protected]
1 parent 503c58c commit 27b574f

File tree

5 files changed

+151
-97
lines changed

5 files changed

+151
-97
lines changed

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ node('rhel8'){
3737

3838
stage('vsix package smoke test') {
3939
wrap([$class: 'Xvnc']) {
40-
sh "node ./out/build/install-vscode.js openshift-connector-${packageJson.version}-${env.BUILD_NUMBER}.vsix && node ./out/build/run-tests.js vsix-test test/fake-extension/"
40+
sh "node ./out/build/install-vscode.js 1.56.0 && .vscode-test/vscode-linux-x64-1.56.0/VSCode-linux-x64/bin/code --install-extension openshift-connector-${packageJson.version}-${env.BUILD_NUMBER}.vsix && node ./out/build/run-tests.js vsix-test test/fake-extension/"
4141
}
4242
}
4343

build/install-vscode.ts

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,7 @@
33
* Licensed under the MIT License. See LICENSE file in the project root for license information.
44
*-----------------------------------------------------------------------------------------------*/
55

6-
import { platform } from 'os';
7-
8-
import cp = require('child_process');
9-
import path = require('path');
10-
116
// eslint-disable-next-line import/no-extraneous-dependencies
127
const downloadAndUnzipVSCode = require('vscode-test').downloadAndUnzipVSCode;
13-
14-
downloadAndUnzipVSCode().then((executable: string) => {
15-
let vsCodeExecutable;
16-
if (platform() === 'darwin') {
17-
vsCodeExecutable = `'${path.join(executable.substring(0, executable.indexOf('.app')+4), 'Contents', 'Resources', 'app', 'bin', 'code')}'`;
18-
} else {
19-
vsCodeExecutable = path.join(path.dirname(executable), 'bin', 'code');
20-
}
21-
const extensionRootPath = path.resolve(__dirname, '..', '..');
22-
const [, , vsixName] = process.argv;
23-
const vsixPath = path.join(extensionRootPath, vsixName);
24-
cp.execSync(`${vsCodeExecutable} --install-extension ${vsixPath}`);
25-
});
8+
const [, , version] = process.argv;
9+
downloadAndUnzipVSCode(version);

build/run-tests.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ async function main(): Promise<void> {
2727
path.resolve(extensionRootPath,'test', 'fixtures', 'components', 'components.code-workspace')
2828
] : [
2929
path.resolve(extensionRootPath,'test', 'fixtures', 'components', 'empty.code-workspace')
30-
]
30+
],
31+
version: '1.56.0'
3132
});
3233
} catch(error) {
3334
// eslint-disable-next-line no-console

package-lock.json

Lines changed: 145 additions & 76 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175
"unzip-stream": "^0.3.0",
176176
"utf-8-validate": "^5.0.2",
177177
"vscode-extension-tester": "^4.0.1",
178-
"vscode-test": "^1.2.3",
178+
"vscode-test": "^1.5.2",
179179
"webpack": "^4.35.2",
180180
"webpack-cli": "^3.3.5",
181181
"webpack-dev-server": "^3.11.0"

0 commit comments

Comments
 (0)