Skip to content

Commit

Permalink
Use latest 18.x
Browse files Browse the repository at this point in the history
it requires to get rid of unzipper which was corrupting the extracted
binary of chromedriver on Linux and VS Code on Windows with Node 18.15+

fixes #975

Signed-off-by: Aurélien Pupier <[email protected]>
  • Loading branch information
apupier committed Feb 22, 2024
1 parent 14a38b6 commit 6f608ba
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 174 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/insiders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18.15.x
node-version: 18.x
cache: npm

- name: Run Tests (macOS, windows)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/template-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18.15.x
node-version: 18.x
cache: npm

- name: Run Tests (macOS, windows)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

|NodeJS|Visual Studio Code|Operating System|
|--|--|--|
|<table style="text-align:center;"> <tr><th>16.x.x</th><th>18.x.x</th></tr><tr><td>✅</td><td>⚠️ <=18.15.x</td></tr> </table>| <table style="text-align:center;"> <tr><th>min</th><th>-</th><th>max</th></tr><tr><td>1.84.2</td><td>1.85.2</td><td>1.86.2</td></tr> </table>| <table style="text-align:center;"> <tr><th>Linux</th><th>Windows</th><th>macOS</th></tr><tr><td>✅</td><td>✅</td><td>⚠️ [Known Issues](KNOWN_ISSUES.md#macos-known-limitations-of-native-objects)</td></tr> </table>|
|<table style="text-align:center;"> <tr><th>16.x.x</th><th>18.x.x</th></tr><tr><td>✅</td><td></td></tr> </table>| <table style="text-align:center;"> <tr><th>min</th><th>-</th><th>max</th></tr><tr><td>1.84.2</td><td>1.85.2</td><td>1.86.2</td></tr> </table>| <table style="text-align:center;"> <tr><th>Linux</th><th>Windows</th><th>macOS</th></tr><tr><td>✅</td><td>✅</td><td>⚠️ [Known Issues](KNOWN_ISSUES.md#macos-known-limitations-of-native-objects)</td></tr> </table>|

### Usage

Expand Down
140 changes: 0 additions & 140 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"@types/js-yaml": "^4.0.9",
"@types/mocha": "^10.0.6",
"@types/node": "^18.17.15",
"@types/unzipper": "^0.10.9",
"mocha": "^10.3.0",
"rimraf": "^5.0.5",
"typescript": "*"
Expand All @@ -68,7 +67,6 @@
"sanitize-filename": "^1.6.3",
"selenium-webdriver": "^4.18.1",
"targz": "^1.0.1",
"unzipper": "^0.10.14",
"vscode-extension-tester-locators": "^3.11.0"
},
"peerDependencies": {
Expand Down
13 changes: 0 additions & 13 deletions src/extester.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ export const DEFAULT_STORAGE_FOLDER = process.env.TEST_RESOURCES ? process.env.T
export const VSCODE_VERSION_MIN = '1.84.2';
export const VSCODE_VERSION_MAX = '1.86.2';

/**
* The latest version of NodeJS which is properly working with selenium-webdriver
* (for more details, see https://www.npmjs.com/package/selenium-webdriver?activeTab=readme#node-support-policy)
*/
export const NODEJS_VERSION_MAX = '18.15.0';

/**
* ExTester
*/
Expand All @@ -48,13 +42,6 @@ export class ExTester {
constructor(storageFolder: string = DEFAULT_STORAGE_FOLDER, releaseType: ReleaseQuality = ReleaseQuality.Stable, extensionsDir?: string) {
this.code = new CodeUtil(storageFolder, releaseType, extensionsDir);
this.chrome = new DriverUtil(storageFolder);

if (process.versions.node > NODEJS_VERSION_MAX) {
console.log(
'\x1b[31m%s\x1b[0m',
`\nERROR:\tYou are using the unsupported NodeJS version '${process.versions.node}'. The latest supported version is '${NODEJS_VERSION_MAX}'.\n\tWe recommend to use supported version to have ExTester working properly.\n\tMore info at https://github.com/redhat-developer/vscode-extension-tester/issues/975\n\n`
);
}
}

/**
Expand Down
24 changes: 8 additions & 16 deletions src/util/unpack.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as fs from 'fs-extra';
import { exec } from 'child_process';
import targz from 'targz';
import * as unzipper from 'unzipper';

export class Unpack {
static unpack(input: fs.PathLike, target: fs.PathLike): Promise<void> {
Expand All @@ -15,21 +14,14 @@ export class Unpack {
});
}
else if (input.toString().endsWith('.zip')) {
if (process.platform === 'darwin') {
fs.mkdirpSync(target.toString());
exec(`cd ${target} && unzip -qo ${input.toString()}`, (err) => {
if (err) {
reject(err);
} else {
resolve();
}
});
} else {
fs.createReadStream(input)
.pipe(unzipper.Extract({ path: target.toString() }))
.on('error', reject)
.on('close', resolve);
}
fs.mkdirpSync(target.toString());
exec(`cd ${target} && tar -xvf ${input.toString()}`, (err) => {
if (err) {
reject(err);
} else {
resolve();
}
});
}
else {
reject(`Unsupported extension for '${input}'`);
Expand Down

0 comments on commit 6f608ba

Please sign in to comment.