CircleCI-Public / browser-tools-orb

Quickly and easily install common browsers and browser testing tools on CircleCI
https://circleci.com/developer/orbs/orb/circleci/browser-tools
MIT License
24 stars 34 forks source link

fix: make comparison based on ChromeDriver major version #110

Closed kelvintaywl closed 8 months ago

kelvintaywl commented 8 months ago

Checklist

Motivation, issues

This fixes the arithmetic error seen as reported on #109 too.

Customers are seeing the invalid arithmetic error thrown on the latest @1.4.7 when running browser-tools/install-chromedriver command. The origin of the issue was from a workaround fix @ #105, as i understand. Example public build from @e-grapp here: https://app.circleci.com/pipelines/github/e-grapp/sandbox/485/workflows/fa180058-b199-41cb-915e-39dd2ca1088e/jobs/569?invite=true#step-104-115_113

If I understand correctly, #109 offers a better solution than this PR. However, I am not deeply familiar with the context to know if #109 works; I'll leave the decision to the reviewers of both PRs then 🙇

Tested locally to verify the logic:

$ CHROMEDRIVER_VERSION="116.0.5845.140"
$ CHROMEDRIVER_MAJOR_VERSION=$(echo $CHROMEDRIVER_VERSION | cut -d '.' -f1)
$ echo CHROMEDRIVER_MAJOR_VERSION
116

$[[ $CHROMEDRIVER_MAJOR_VERSION -lt 121 ]]
$ echo $?
0

$ [ $CHROMEDRIVER_MAJOR_VERSION -lt 115 ]
$ echo $?
1