Skip to content
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

fix: chromedriver version updater #4269

Merged
merged 12 commits into from
Jun 25, 2022
Merged
Changes from all commits
Commits
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
21 changes: 13 additions & 8 deletions testing/browser-functional/browser-tests-build-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,27 @@ steps:
$dist = npm dist-tag ls $packageName;
$next = $dist.Where({$_.StartsWith("latest:")});
[string]$latestVersion = $next.Split(':')[-1].Trim();
Write-Host "$packageName latest = $latestVersion";

$packageName;
$latestVersion;
"##vso[task.setvariable variable=LatestVersion;]$latestVersion";
displayName: 'Get latest chromedriver version number from npmjs.com'
$splitVersion = $latestVersion.Split(".");
$splitVersion[0] = $splitVersion[0] - 1;
$secondLatestVersion = $splitVersion -Join ".";
Write-Host "$packageName second latest = $secondLatestVersion";

"##vso[task.setvariable variable=DriverVersion;]$secondLatestVersion";
displayName: 'Get second latest chromedriver version number from npmjs.com'

- task: PowerShell@2
inputs:
targetType: inline
script: |
# This lets the pipeline automatically keep up with Chrome browser releases.
# New Chrome browser releases happen about every 4 weeks.
# This lets the pipeline automatically keep up with Chrome browser upgrades.
# Chrome browser upgrades on ADO agents lag behind chromedriver upgrades, so
# if we use the second latest chromedriver, that should keep the tests working.

$path = "$(System.DefaultWorkingDirectory)/testing/browser-functional/package.json";
$package = 'chromedriver';
$newVersion = "$(LatestVersion)";
$newVersion = "$(DriverVersion)";

$find = "$package`": `"\S*`"";
$replace = "$package`": `"$newVersion`"";
Expand All @@ -68,7 +73,7 @@ steps:
$content -Replace "$find", "$replace" | Set-Content $_.FullName;
'-------------'; get-content $_.FullName; '==================='
}
displayName: 'Upgrade chromedriver reference to latest version'
displayName: 'Upgrade chromedriver reference to second latest version'

- task: NodeTool@0
displayName: use node 12.x
Expand Down