From 36563390bc66a044c199d6e121de084b2599af91 Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Thu, 19 Aug 2021 11:02:30 -0300 Subject: [PATCH] fix e2e tag paging, bump fallback versions --- tests/e2e/env/CHANGELOG.md | 3 +++ tests/e2e/env/bin/docker-compose.sh | 4 ++-- tests/e2e/env/bin/get-latest-docker-tag.js | 28 ++++++++++++---------- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/tests/e2e/env/CHANGELOG.md b/tests/e2e/env/CHANGELOG.md index 69b47c445ad..b0872a6a12d 100644 --- a/tests/e2e/env/CHANGELOG.md +++ b/tests/e2e/env/CHANGELOG.md @@ -8,6 +8,9 @@ - `downloadZip( fileUrl, downloadPath )` downloads a plugin zip file from a remote location to the provided path. - Added `getLatestReleaseZipUrl( owner, repository, getPrerelease, perPage )` util function to get the latest release zip from a GitHub repository. - Added `DEFAULT_TIMEOUT_OVERRIDE` that allows passing in a time in milliseconds to override the default Jest and Puppeteer timeouts. +- Fix latest version tag search paging logic +- Bump PHP fallback version to 7.4.22 +- Bump MariahDB fallback version to 10.6.4 # 0.2.2 diff --git a/tests/e2e/env/bin/docker-compose.sh b/tests/e2e/env/bin/docker-compose.sh index cd091eda87c..df565766610 100755 --- a/tests/e2e/env/bin/docker-compose.sh +++ b/tests/e2e/env/bin/docker-compose.sh @@ -19,7 +19,7 @@ if [[ $1 ]]; then if [[ $TRAVIS_PHP_VERSION =~ ^[0-9]+\.[0-9]+ ]]; then export DC_PHP_VERSION=$TRAVIS_PHP_VERSION else - export DC_PHP_VERSION="7.4.9" + export DC_PHP_VERSION="7.4.22" fi if ! [[ $TRAVIS_MARIADB_VERSION =~ ^[0-9]+\.[0-9]+ ]]; then @@ -28,7 +28,7 @@ if [[ $1 ]]; then if [[ $TRAVIS_MARIADB_VERSION =~ ^[0-9]+\.[0-9]+ ]]; then export DC_MARIADB_VERSION=$TRAVIS_MARIADB_VERSION else - export DC_MARIADB_VERSION="10.5.5" + export DC_MARIADB_VERSION="10.6.4" fi if [[ $1 == 'up' ]]; then diff --git a/tests/e2e/env/bin/get-latest-docker-tag.js b/tests/e2e/env/bin/get-latest-docker-tag.js index 23adf48317a..b56d0f6ad77 100755 --- a/tests/e2e/env/bin/get-latest-docker-tag.js +++ b/tests/e2e/env/bin/get-latest-docker-tag.js @@ -84,21 +84,23 @@ function findLatestVersion( image, nameSearch ) { // Repeat the requests until we've read as many pages as necessary. const paginationFn = function ( result ) { - // We can save on unnecessarily loading every page by short-circuiting when - // the number of days between the first recorded version and the - // one from this page becomes excessive. - const lastUpdate = Date.parse( result.latestTag.last_updated ); - if ( ! earliestUpdated ) { - earliestUpdated = lastUpdate; - } else { - const daysSinceEarliestUpdate = ( earliestUpdated - lastUpdate ) / ( 1000 * 3600 * 24 ); - if ( daysSinceEarliestUpdate > 15 ) { - result.isLastPage = true; + if ( result.latestTag ) { + // We can save on unnecessarily loading every page by short-circuiting when + // the number of days between the first recorded version and the + // one from this page becomes excessive. + const lastUpdate = Date.parse( result.latestTag.last_updated ); + if ( ! earliestUpdated ) { + earliestUpdated = lastUpdate; + } else { + const daysSinceEarliestUpdate = ( earliestUpdated - lastUpdate ) / ( 1000 * 3600 * 24 ); + if ( daysSinceEarliestUpdate > 15 ) { + result.isLastPage = true; + } } - } - if ( ! latestVersion || semver.gt( result.latestTag.semver, latestVersion ) ) { - latestVersion = result.latestTag.semver; + if ( ! latestVersion || semver.gt( result.latestTag.semver, latestVersion ) ) { + latestVersion = result.latestTag.semver; + } } if ( ! result.isLastPage ) {