actions / runner-images

GitHub Actions runner images
MIT License
9.82k stars 3.01k forks source link

Set the EDGEDRIVER_VERSION environment variable #10380

Closed danielhjacobs closed 4 weeks ago

danielhjacobs commented 1 month ago

Description

This uses that environment variable:

https://github.com/webdriverio-community/node-edgedriver/blob/7b2b44946f422b86e4c937d277f412a380394a1c/src/install.ts#L24

I believe it can be set on Mac by adding to this:

https://github.com/actions/runner-images/blob/e15a279ed87d207b7dd6cf04600b95d4ecea3e6b/images/macos/scripts/build/install-edge.sh#L36

echo "export EDGEDRIVER_VERSION=${edge_driver_latest_version}" >> ${HOME}/.bashrc

I believe it can be set on Windows by adding to this:

https://github.com/actions/runner-images/blob/e15a279ed87d207b7dd6cf04600b95d4ecea3e6b/images/windows/scripts/build/Install-EdgeDriver.ps1#L34

[Environment]::SetEnvironmentVariable("EDGEDRIVER_VERSION", $latestVersion, "Machine")

I believe it can be set on Ubuntu by adding to this:

https://github.com/actions/runner-images/blob/e15a279ed87d207b7dd6cf04600b95d4ecea3e6b/images/ubuntu/scripts/build/install-microsoft-edge.sh#L48

set_etc_environment_variable "EDGEDRIVER_VERSION" "${edgedriver_latest_version}"

Relates to https://github.com/actions/runner-images/issues/10336, https://github.com/MicrosoftEdge/EdgeWebDriver/issues/156, and https://github.com/webdriverio-community/node-edgedriver/issues/365

Platforms affected

Runner images affected

Image version and build link

20240721.1.0

https://github.com/ruffle-rs/ruffle/actions/runs/10068053329/job/27832705746

Is it regression?

Not really, this environment variable was never set, but when Edge matches Edgedriver that's fine

Expected behavior

The version of EdgeDriver being used should be set so wdio doesn't try to install a different version.

Actual behavior

The version isn't set so wdio tries to install a different version and if that version is missing jobs may fail.

Repro steps

  1. Run an action that runs with this image.
  2. Try to use EdgeDriver with wdio for tests
danielhjacobs commented 1 month ago

These can also be changed to print the EDGEDRIVER_VERSION environment variable as well:

https://github.com/actions/runner-images/blob/e15a279ed87d207b7dd6cf04600b95d4ecea3e6b/images/ubuntu/scripts/docs-gen/SoftwareReport.Browsers.psm1#L47-L50

https://github.com/actions/runner-images/blob/e15a279ed87d207b7dd6cf04600b95d4ecea3e6b/images/macos/scripts/docs-gen/SoftwareReport.Browsers.psm1#L99-L102

https://github.com/actions/runner-images/blob/e15a279ed87d207b7dd6cf04600b95d4ecea3e6b/images/windows/scripts/docs-gen/SoftwareReport.Browsers.psm1#L82-L85

vidyasagarnimmagaddi commented 1 month ago

Hi @danielhjacobs , we will be checking the issue and provide solutions ,Thanks

danielhjacobs commented 1 month ago

This has been circumvented downstream in npm's edgedriver by https://github.com/webdriverio-community/node-edgedriver/commit/68043fef07b47e21056da3bc928110e6a759715e which is included in https://github.com/webdriverio-community/node-edgedriver/releases/tag/5.6.1, so if you use webdriverio with edgedriver you can circumvent this issue by updating the webdriverio-related and edgedriver dependencies. However, it would be better if the environment variable were set so this wouldn't have to go through the complicated logic of:

2024-08-05T22:34:48.348Z INFO edgedriver: Detected Microsoft Edge v127.0.2651.74
2024-08-05T22:34:48.348Z INFO edgedriver: Downloading Edgedriver from https://msedgedriver.azureedge.net/127.0.2651.74/edgedriver_linux64.zip
2024-08-05T22:34:48.690Z ERROR edgedriver: Failed to download Edgedriver: Failed to download binary from https://msedgedriver.azureedge.net/127.0.2651.74/edgedriver_linux64.zip (statusCode 404), trying alternative download URL...
2024-08-05T22:34:48.690Z INFO edgedriver: Attempt to fetch latest v127 for linux from https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver?delimiter=%2F&maxresults=2500&restype=container&comp=list&_=1722752483611&timeout=60000
2024-08-05T22:34:49.371Z INFO edgedriver: Downloading alternative Edgedriver version from https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/LATEST_RELEASE_127_LINUX
2024-08-05T22:34:49.443Z INFO edgedriver: Downloading Edgedriver from https://msedgedriver.azureedge.net/127.0.2651.87/edgedriver_linux64.zip
2024-08-05T22:34:50.000Z INFO edgedriver: Finished downloading Edgedriver
vidyasagarnimmagaddi commented 4 weeks ago

Hi @danielhjacobs , The need to set the environment cannot be implemented at our end,
Customers can do it do it via DRIVER_VERSION=$(msedgedriver --version) in their workflows. Thanks closing this issue .