diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index f641f021933..10d67c00930 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -25,6 +25,8 @@ env: # the beahvior to use the new URLs. CHROMEDRIVER_CDNURL: https://googlechromelabs.github.io/ CHROMEDRIVER_CDNBINARIESURL: https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/ + CHROME_VALIDATED_VERSION: linux-120.0.6099.71 + CHROME_VERSION_MISMATCH_MESSAGE: "The Chrome version doesn't match the previously validated version. Consider updating CHROME_VALIDATED_VERSION in the GitHub workflow if tests pass." artifactRetentionDays: 14 # Bump Node memory limit NODE_OPTIONS: "--max_old_space_size=4096" @@ -115,6 +117,15 @@ jobs: - name: install Chrome stable run: | npx @puppeteer/browsers install chrome@stable + chromeVersionString=$(ls chrome) + if [ "$CHROME_VALIDATED_VERSION" != "$chromeVersionString" ]; then + echo "::warning ::The Chrome version doesn't match the previously validated version. Consider updating CHROME_VALIDATED_VERSION in the GitHub workflow if tests pass." + echo "::warning ::Previously validated version: ${CHROME_VALIDATED_VERSION} vs. Installed version: $chromeVersionString" + echo "CHROME_VERSION_NOTES=$CHROME_VERSION_MISMATCH_MESSAGE" >> "$GITHUB_ENV" + fi + - name: Test Evn TEMP + run: | + echo $CHROME_VERSION_NOTES=$CHROME_VERSION_MISMATCH_MESSAGE - name: Download build archive uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/test-changed-auth.yml b/.github/workflows/test-changed-auth.yml index 06afad8df38..2eba81a8e99 100644 --- a/.github/workflows/test-changed-auth.yml +++ b/.github/workflows/test-changed-auth.yml @@ -14,7 +14,7 @@ name: Test Auth -on: pull_request +on: [push, pull_request] env: # make chromedriver detect installed Chrome version and download the corresponding driver @@ -23,6 +23,7 @@ env: # the beahvior to use the new URLs. CHROMEDRIVER_CDNURL: https://googlechromelabs.github.io/ CHROMEDRIVER_CDNBINARIESURL: https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/ + CHROME_VALIDATED_VERSION: linux-120.0.6099.71 # Bump Node memory limit NODE_OPTIONS: "--max_old_space_size=4096" @@ -30,13 +31,26 @@ jobs: test-chrome: name: Test Auth on Chrome and Node If Changed runs-on: ubuntu-latest - steps: # install Chrome first, so the correct version of webdriver can be installed by chromedriver # when setting up the repo + # + # Note: we only need to check the chrome version change in one job as the warning annotation + # is appended to the entire workflow results, not just this job's results. - name: install Chrome stable + env: + CHROME_VERSION_MISMATCH_MESSAGE: "The Chrome version doesn't match the previously validated version. Consider updating CHROME_VALIDATED_VERSION in the GitHub workflow if tests pass." run: | npx @puppeteer/browsers install chrome@stable + chromeVersionString=$(ls chrome) + if [ "$CHROME_VALIDATED_VERSION" != "$chromeVersionString" ]; then + echo "::warning ::The Chrome version doesn't match the previously validated version. Consider updating CHROME_VALIDATED_VERSION in the GitHub workflow if tests pass." + echo "::warning ::Previously validated version: ${CHROME_VALIDATED_VERSION} vs. Installed version: $chromeVersionString" + echo "CHROME_VERSION_NOTES=$CHROME_VERSION_MISMATCH_MESSAGE" >> "$GITHUB_ENV" + fi + - name: Test Evn TEMP + run: | + echo $CHROME_VERSION_NOTES=$CHROME_VERSION_MISMATCH_MESSAGE - name: Checkout Repo uses: actions/checkout@master with: diff --git a/scripts/ci-test/test_changed.ts b/scripts/ci-test/test_changed.ts index 5d2f30865ed..ed60cdc8e4a 100644 --- a/scripts/ci-test/test_changed.ts +++ b/scripts/ci-test/test_changed.ts @@ -80,6 +80,14 @@ async function runTests(config: TestConfig) { process.exit(0); } catch (e) { console.error(chalk`{red ${e}}`); + + const chrome_notes = process.env.CHROME_VERSION_NOTES; + if (chrome_notes) { + console.error(); + console.error(chalk`{red ${chrome_notes}}`); + console.error(); + } + process.exit(1); } } diff --git a/scripts/run_tests_in_ci.js b/scripts/run_tests_in_ci.js index a5ba6cd3289..96f85979165 100644 --- a/scripts/run_tests_in_ci.js +++ b/scripts/run_tests_in_ci.js @@ -87,7 +87,15 @@ const argv = yargs.options({ console.error('Failure: ' + name); console.log(stdout); console.error(stderr); + + if (process.env.CHROME_VERSION_NOTES) { + console.error(); + console.error(process.env.CHROME_VERSION_NOTES); + console.error(); + } + writeLogs('Failure', name, stdout + '\n' + stderr); + process.exit(1); } })();