Skip to content

Commit

Permalink
chore: fix Browsers failing tests (#9768)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lightning00Blade committed Mar 5, 2023
1 parent 2922611 commit 3a4e726
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/browsers/test/src/cli.spec.ts
Expand Up @@ -21,12 +21,12 @@ import path from 'path';

import {CLI} from '../../lib/cjs/CLI.js';

import {testChromeBuildId, testFirefoxBuildId} from './versions.js';

describe('CLI', function () {
this.timeout(90000);

let tmpDir = '/tmp/puppeteer-browsers-test';
const testChromeBuildId = '1083080';
const testFirefoxBuildId = '111.0a1';

beforeEach(() => {
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'puppeteer-browsers-test'));
Expand Down
4 changes: 2 additions & 2 deletions packages/browsers/test/src/fetch.spec.ts
Expand Up @@ -24,14 +24,14 @@ import path from 'path';
import {Browser, BrowserPlatform} from '../../lib/cjs/browsers/browsers.js';
import {fetch, canFetch} from '../../lib/cjs/fetch.js';

import {testChromeBuildId, testFirefoxBuildId} from './versions.js';

/**
* Tests in this spec use real download URLs and unpack live browser archives
* so it requires the network access.
*/
describe('fetch', () => {
let tmpDir = '/tmp/puppeteer-browsers-test';
const testChromeBuildId = '1083080';
const testFirefoxBuildId = '111.0a1';

beforeEach(() => {
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'puppeteer-browsers-test'));
Expand Down
4 changes: 2 additions & 2 deletions packages/browsers/test/src/launcher.spec.ts
Expand Up @@ -23,6 +23,8 @@ import {Browser, BrowserPlatform} from '../../lib/cjs/browsers/browsers.js';
import {fetch} from '../../lib/cjs/fetch.js';
import {computeExecutablePath, launch} from '../../lib/cjs/launcher.js';

import {testChromeBuildId, testFirefoxBuildId} from './versions.js';

describe('launcher', () => {
it('should compute executable path for Chrome', () => {
assert.strictEqual(
Expand Down Expand Up @@ -52,7 +54,6 @@ describe('launcher', () => {
this.timeout(60000);

let tmpDir = '/tmp/puppeteer-browsers-test';
const testChromeBuildId = '1083080';

beforeEach(async () => {
tmpDir = fs.mkdtempSync(
Expand Down Expand Up @@ -91,7 +92,6 @@ describe('launcher', () => {
this.timeout(60000);

let tmpDir = '/tmp/puppeteer-browsers-test';
const testFirefoxBuildId = '111.0a1';

beforeEach(async () => {
tmpDir = fs.mkdtempSync(
Expand Down
20 changes: 20 additions & 0 deletions packages/browsers/test/src/versions.ts
@@ -0,0 +1,20 @@
/**
* Copyright 2023 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

export const testChromeBuildId = '1083080';
// TODO: We can add a Cron job to auto-update on change.

This comment has been minimized.

Copy link
@OrKoN

OrKoN Mar 7, 2023

Collaborator

oh, that's unfortunate. Thanks for fixing this. I will see if we can come up with a better solution.

// Firefox keeps only `latest` version of Nightly builds.
export const testFirefoxBuildId = '112.0a1';

0 comments on commit 3a4e726

Please sign in to comment.