Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@ jobs:
shell: bash
run: npm ci

- name: Install Chrome Canary
shell: bash
run: |
CANARY_PATH=$(npx @puppeteer/browsers install chrome@canary --format "{{path}}")
echo "CANARY_EXECUTABLE_PATH=$CANARY_PATH" >> $GITHUB_ENV

- name: Build
run: npm run bundle
env:
Expand Down
18 changes: 17 additions & 1 deletion scripts/test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// Note: can be converted to ts file once node 20 support is dropped.
// Node 20 does not support --experimental-strip-types flag.

import {spawn} from 'node:child_process';
import {spawn, execSync} from 'node:child_process';
import path from 'node:path';
import process from 'node:process';

Expand Down Expand Up @@ -58,6 +58,19 @@ const nodeArgs = [
...files,
];

function installChrome(version) {
try {
return execSync(
`npx @puppeteer/browsers install chrome@${version} --format "{{path}}"`,
)
.toString()
.trim();
} catch (e) {
console.error(`Failed to install Chrome ${version}:`, e);
process.exit(1);
}
}

async function runTests(attempt) {
if (attempt > 1) {
console.log(`\nRun attempt ${attempt}...\n`);
Expand All @@ -78,6 +91,9 @@ async function runTests(attempt) {
});
}

const chromePath = installChrome('146.0.7680.31');
process.env.CHROME_M146_EXECUTABLE_PATH = chromePath;

const maxAttempts = shouldRetry ? 3 : 1;
let exitCode = 1;

Expand Down
2 changes: 1 addition & 1 deletion tests/tools/extensions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ describe('extension', () => {
assert.ok(pageTargetAfter, 'Page should exist after action');
},
{
executablePath: process.env.CANARY_EXECUTABLE_PATH,
executablePath: process.env.CHROME_M146_EXECUTABLE_PATH,
},
{
categoryExtensions: true,
Expand Down
Loading