Skip to content

fix: support geckodriver download mirrors - #1341

Merged
KuznetsovRoman merged 1 commit into
masterfrom
TESTPLANE-905.geckodriver
Oct 7, 2026
Merged

KuznetsovRoman merged 1 commit into
masterfrom
TESTPLANE-905.geckodriver

Conversation

@KuznetsovRoman

Copy link
Copy Markdown
Member

No description provided.

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

✅ Testplane E2E run succeed

Report

@pkg-pr-new

pkg-pr-new Bot commented Oct 7, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/gemini-testing/testplane@1341

commit: a2920c6

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

✅ Testplane browser-env run succeed

Report

const cargoVersionsToml = await retryFetch(GECKODRIVER_CARGO_TOML).then(res => res.text());
const version = cargoVersionsToml.split("\n").find(line => line.startsWith("version = "));
const execFileAsync = promisify(execFile);
const GECKODRIVER_PLATFORMS = {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Despite our mirror only has linux64 geckodriver, it sounds right to implement other platforms support for the future, in case there would be a mirror with other platforms support

Comment on lines +41 to +42
const versionLine = cargoVersionsToml.split("\n").find(line => /^version\s*=/.test(line));
const version = versionLine?.match(/^version\s*=\s*["'](\d+\.\d+\.\d+)["']/);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switched to using explicit regexp matching

Comment on lines +60 to +61
const isWindows = platform === BrowserPlatform.WIN32 || platform === BrowserPlatform.WIN64;
const filename = `geckodriver-v${version}-${GECKODRIVER_PLATFORMS[platform]}${isWindows ? ".zip" : ".tar.gz"}`;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like every other mirror packs binaries into ".zip" for windows and ".tar.gz" for other platforms
So i suppose its fair to assume "geckodriver" would not be an exception


try {
const archivePath = path.join(downloadDir, filename);
await pipeline(Readable.fromWeb(response.body as never), fs.createWriteStream(archivePath));

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For chromedriver and chrome, we can use puppeteer's mirror feature
But "geckodriver" npm package we use in order to download geckodriver, does not have the ability to specify mirrors. So we download + unpack it manually

@DudaGod DudaGod left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@KuznetsovRoman
KuznetsovRoman merged commit 26bc973 into master Oct 7, 2026
7 of 17 checks passed
@KuznetsovRoman
KuznetsovRoman deleted the TESTPLANE-905.geckodriver branch October 7, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants