Skip to content

Commit

Permalink
Puppeteer E2E test: Fail if all Chromium snaphots are unaccessible (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
LeviPesin authored Feb 14, 2023
1 parent 6ba91f1 commit ea36d1a
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions test/e2e/puppeteer.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,21 @@ async function downloadLatestChromium() {
const revisions = await ( await fetch( OMAHA_PROXY ) ).json();
const omahaRevisionInfo = revisions.find( revs => revs.os === os ).versions.find( version => version.channel === chromiumChannel );

let revision = omahaRevisionInfo.branch_base_position;
while ( ! ( await browserFetcher.canDownload( revision ) ) ) {
let revision = Number( omahaRevisionInfo.branch_base_position );
while ( ! ( await browserFetcher.canDownload( String( revision ) ) ) && revision > 0 ) {

revision = String( revision - 1 );
revision --;

}

if ( revision === 0 ) {

throw new Error( 'No Chromium snapshots available to download' );

}

revision = String( revision );

let revisionInfo = browserFetcher.revisionInfo( revision );
if ( revisionInfo.local === true ) {

Expand Down

0 comments on commit ea36d1a

Please sign in to comment.