Skip to content

[Auth CI] Log warning if chrome version has changed #7872

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/test-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this possible that this line can be automatically updated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not easily, unless you have any ideas!

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"
Expand Down Expand Up @@ -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:
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/test-changed-auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -23,20 +23,34 @@ 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"

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:
Expand Down
8 changes: 8 additions & 0 deletions scripts/ci-test/test_changed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
8 changes: 8 additions & 0 deletions scripts/run_tests_in_ci.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
})();