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
22 changes: 19 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ jobs:
needs: [build]
strategy:
matrix:
os: [ubuntu, macos, windows]
os: [ubuntu-latest, macos-latest, windows-latest]
version: ["", 1295939, 120, dev, latest]
runs-on: ${{ matrix.os }}-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -59,7 +59,6 @@ jobs:
- uses: actions/download-artifact@v4
with:
name: dist

- name: Install Google Chrome
uses: ./
with:
Expand All @@ -70,6 +69,23 @@ jobs:
(Get-Item (Get-Command "${{ steps.setup-chrome.outputs.chrome-path }}").Source).VersionInfo.ProductVersion
(Get-Item (Get-Command "${{ steps.setup-chrome.outputs.chromedriver-path }}").Source).VersionInfo.ProductVersion

test-linux-arm:
needs: [build]
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/download-artifact@v4
with:
name: dist
- name: Install Google Chrome
uses: ./
with:
chrome-version: canary
install-chromedriver: true
id: setup-chrome
- run: |
"${{ steps.setup-chrome.outputs.chrome-path }}" --version
"${{ steps.setup-chrome.outputs.chromedriver-path }}" --version

test-install-dependencies:
needs: [build]
strategy:
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/manual-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ on:
required: true
type: choice
options:
- ubuntu
- windows
- macos
- ubuntu-latest
- windows-latest
- macos-latest
- ubuntu-24.04-arm
container:
description: 'Container image to run test on'
required: false
Expand Down Expand Up @@ -41,7 +42,7 @@ jobs:

test:
needs: [build]
runs-on: ${{ inputs.os }}-latest
runs-on: ${{ inputs.os }}
container: ${{ inputs.container }}
steps:
- uses: actions/download-artifact@v4
Expand All @@ -51,6 +52,7 @@ jobs:
uses: ./
with:
chrome-version: ${{ inputs.chrome-version }}
install-chromedriver: true
id: setup-chrome
- if: runner.os == 'Linux' || runner.os == 'macOS'
run: |
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ steps:

| | Linux x64 | Linux ARM32 | Linux ARM64 | macOS x64 | macOS ARM64 | Windows x64 | Windows ARM64 |
| --- | --- | --- | --- | --- | --- | --- | --- |
| Channel name | ✅ | ❌ | | ✅ | ✅ | ✅ | ❌ |
| Channel name | ✅ | ❌ | | ✅ | ✅ | ✅ | ❌ |
| Commit position | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ |
| Specific version | ✅ | ❌ | | ✅ | ✅ | ✅ | ❌ |
| Specific version | ✅ | ❌ | | ✅ | ✅ | ✅ | ❌ |
| Latest snapshot | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ |

## Parameters
Expand Down
43 changes: 36 additions & 7 deletions __test__/chrome_for_testing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ describe("KnownGoodVersionResolver", () => {
});

test.each`
spec | version | browserURL | driverURL
${"120.0.6099.5"} | ${"120.0.6099.5"} | ${"https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/120.0.6099.5/linux64/chrome-linux64.zip"} | ${"https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/120.0.6099.5/linux64/chromedriver-linux64.zip"}
${"120.0.6099.x"} | ${"120.0.6099.56"} | ${"https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/120.0.6099.56/linux64/chrome-linux64.zip"} | ${"https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/120.0.6099.56/linux64/chromedriver-linux64.zip"}
${"1234.0.6099.x"} | ${undefined} | ${undefined} | ${undefined}
spec | version | browserURL | driverURL
${"120.0.6099.5"} | ${"120.0.6099.5"} | ${"https://storage.googleapis.com/chrome-for-testing-public/120.0.6099.5/linux64/chrome-linux64.zip"} | ${"https://storage.googleapis.com/chrome-for-testing-public/120.0.6099.5/linux64/chromedriver-linux64.zip"}
${"120.0.6099.x"} | ${"120.0.6099.109"} | ${"https://storage.googleapis.com/chrome-for-testing-public/120.0.6099.109/linux64/chrome-linux64.zip"} | ${"https://storage.googleapis.com/chrome-for-testing-public/120.0.6099.109/linux64/chromedriver-linux64.zip"}
${"1234.0.6099.x"} | ${undefined} | ${undefined} | ${undefined}
`(
"should resolve known good versions for $spec",
async ({ spec, version, browserURL, driverURL }) => {
Expand Down Expand Up @@ -70,7 +70,22 @@ describe("KnownGoodVersionResolver", () => {
const resolved2 = await resolver.resolveBrowserOnly("113.0.5672.0");
expect(resolved2?.version).toEqual("113.0.5672.0");
expect(resolved2?.browserDownloadURL).toEqual(
"https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/113.0.5672.0/linux64/chrome-linux64.zip",
"https://storage.googleapis.com/chrome-for-testing-public/113.0.5672.0/linux64/chrome-linux64.zip",
);
});

test("should resolve known good versions for linux arm64", async () => {
const resolver = new KnownGoodVersionResolver({
os: "linux",
arch: "arm64",
});
const resolved = await resolver.resolveBrowserAndDriver("153.0.8001.0");
expect(resolved?.version).toEqual("153.0.8001.0");
expect(resolved?.browserDownloadURL).toEqual(
"https://storage.googleapis.com/chrome-for-testing-public/153.0.8001.0/linux-arm64/chrome-linux-arm64.zip",
);
expect(resolved?.driverDownloadURL).toEqual(
"https://storage.googleapis.com/chrome-for-testing-public/153.0.8001.0/linux-arm64/chromedriver-linux-arm64.zip",
);
});

Expand Down Expand Up @@ -107,10 +122,24 @@ describe("LastKnownGoodVersionResolver", () => {
});
const resolved = await resolver.resolve("stable");
expect(resolved?.browserDownloadURL).toEqual(
"https://storage.googleapis.com/chrome-for-testing-public/125.0.6422.78/linux64/chrome-linux64.zip",
"https://storage.googleapis.com/chrome-for-testing-public/152.0.7977.42/linux64/chrome-linux64.zip",
);
expect(resolved?.driverDownloadURL).toEqual(
"https://storage.googleapis.com/chrome-for-testing-public/152.0.7977.42/linux64/chromedriver-linux64.zip",
);
});

test("should resolve last known good versions for linux arm64", async () => {
const resolver = new LastKnownGoodVersionResolver({
os: "linux",
arch: "arm64",
});
const resolved = await resolver.resolve("canary");
expect(resolved?.browserDownloadURL).toEqual(
"https://storage.googleapis.com/chrome-for-testing-public/153.0.8009.0/linux-arm64/chrome-linux-arm64.zip",
);
expect(resolved?.driverDownloadURL).toEqual(
"https://storage.googleapis.com/chrome-for-testing-public/125.0.6422.78/linux64/chromedriver-linux64.zip",
"https://storage.googleapis.com/chrome-for-testing-public/153.0.8009.0/linux-arm64/chromedriver-linux-arm64.zip",
);
});

Expand Down
2 changes: 1 addition & 1 deletion __test__/data/known-good-versions-with-downloads.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion __test__/data/last-known-good-versions-with-downloads.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions __test__/version_installer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe("KnownGoodVersionInstaller", () => {
expect(cacheCacheDirSpy).toHaveBeenCalledWith(
"/tmp/extracted/chrome-linux64",
"chrome",
"120.0.6099.56",
"120.0.6099.109",
);
});

Expand Down Expand Up @@ -134,7 +134,7 @@ describe("KnownGoodVersionInstaller", () => {
expect(cacheCacheDirSpy).toHaveBeenCalledWith(
"/tmp/extracted/chromedriver-linux64",
"chromedriver",
"120.0.6099.56",
"120.0.6099.109",
);
});

Expand Down
3 changes: 3 additions & 0 deletions src/chrome_for_testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const LAST_KNOWN_GOOD_VERSION =
"https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json";

export type PlatformString =
| "linux-arm64"
| "linux64"
| "mac-arm64"
| "mac-x64"
Expand Down Expand Up @@ -64,6 +65,8 @@ export type KnownGoodVersion = {
const platformString = (platform: Platform): PlatformString => {
if (platform.os === OS.LINUX && platform.arch === Arch.AMD64) {
return "linux64";
} else if (platform.os === OS.LINUX && platform.arch === Arch.ARM64) {
return "linux-arm64";
} else if (platform.os === OS.DARWIN && platform.arch === Arch.AMD64) {
return "mac-x64";
} else if (platform.os === OS.DARWIN && platform.arch === Arch.ARM64) {
Expand Down
Loading