chore: fix Browsers failing tests (#9768)

This commit is contained in:
Nikolay Vitkov 2023-03-05 20:52:26 +01:00 committed by GitHub
parent 2922611f5e
commit 3a4e726078
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 6 deletions

View File

@ -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'));

View File

@ -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'));

View File

@ -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(
@ -52,7 +54,6 @@ describe('launcher', () => {
this.timeout(60000);
let tmpDir = '/tmp/puppeteer-browsers-test';
const testChromeBuildId = '1083080';
beforeEach(async () => {
tmpDir = fs.mkdtempSync(
@ -91,7 +92,6 @@ describe('launcher', () => {
this.timeout(60000);
let tmpDir = '/tmp/puppeteer-browsers-test';
const testFirefoxBuildId = '111.0a1';
beforeEach(async () => {
tmpDir = fs.mkdtempSync(

View File

@ -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.
// Firefox keeps only `latest` version of Nightly builds.
export const testFirefoxBuildId = '112.0a1';