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

[BUG] Functional testing chrome/chromedriver versions incompatibility #3716

Closed
curq opened this issue Mar 28, 2023 · 4 comments
Closed

[BUG] Functional testing chrome/chromedriver versions incompatibility #3716

curq opened this issue Mar 28, 2023 · 4 comments
Labels
bug Something isn't working docs Improvements or additions to documentation OSCI Open Source Contributor Initiative

Comments

@curq
Copy link
Collaborator

curq commented Mar 28, 2023

Describe the bug

The current version of dashboards uses chromedriver version 107, while the current latest chrome version is 111.
When the latest version of chrome is installed on the system there is incompatibility between google-chrome and chromedriver, which prevents selenium from running functional tests.

To Reproduce
Steps to reproduce the behavior:

  1. Install latest chrome version ( 108 or later )
  2. Start functional test yarn test:ftr
  3. The error about incompatibility of chromedriver and chrome versions will be displayed

Expected behavior
Functional tests start without problems. My suggestion is to add requirement for the specific version (107 in this case) of chrome in testing manual.

Dashboards Version
2.6.0

Host/Environment (please complete the following information):

  • OS: Linux ( Ubuntu 22.04 LTS )
  • Browser and version: Chrome 108 and later
@curq curq added bug Something isn't working untriaged labels Mar 28, 2023
@curq curq changed the title [BUG] Functional testing chrome/chromedriver versions [BUG] Functional testing chrome/chromedriver versions incompatibility Mar 28, 2023
@kavilla kavilla added docs Improvements or additions to documentation and removed untriaged labels Mar 28, 2023
@kavilla
Copy link
Member

kavilla commented Mar 28, 2023

Hello @curq,

Unfortunately, we did not do a good job at documenting this. Due to the number of different environments that our tests run on there could be a number of different versions. There can be an improvement to utilize the correct chromedriver but as a mitigation you can run the following:

node scripts/upgrade_chromedriver.js
yarn osd bootstrap

This will install the appropriate driver for your environment but will cause a diff in your packages. Please unstage those changes once you are ready for review. Apologies, I know that can feel frustration when developing.

I think this issue can be repurposed to bump the version to ideally the latest or we enable the Selenium tests to call this script to run if needed and bootstrap. Then restore the previous version. But I can see that becoming too slow in an already slow enough test suite.

The least we can do is document this workaround in our developer guide until the migration to cypress is complete.

Thoughts @ananzh @joshuarrrr ?

@ananzh
Copy link
Member

ananzh commented Mar 28, 2023

Thanks @kavilla I agree.

Hey @curq, thanks for opening this issue. I think we have a PR before that may solve this issue: #2990

This PR is designed to allow you upgrade the chromedriver version within the node_modules directory so that you can use the updated version that matches your installed Google Chrome.

So you run the script using the following command:

node scripts/upgrade_chromedriver.js [--install]

Replace scripts/upgrade_chromedriver.js with the path to the script file. Use the --install flag if you want to directly install the matching chromedriver version using the yarn add command. If the flag is not provided, the script will attempt to modify your package.json file to update the chromedriver version. If you didn't use the --install flag and the script successfully modified your package.json file, you'll need to run yarn osd bootstrap to install the updated chromedriver dependency.

If you want to test, in the upgrade_chromedriver.js script, you could comment out or remove the following block of code that tries to execute the version check commands:

versionCheckCommands.some((cmd) => {
  try {
    console.log(cmd);
    versionCheckOutput = execSync(cmd, { encoding: 'utf8' })?.trim?.();
    return true;
  } catch (e) {
    console.log('Failed to get version using', cmd);
  }
});

Replace the removed block with a line that sets the versionCheckOutput variable and assign it a fixed value. For example:

versionCheckOutput = 'Google Chrome 108.0.4500.1';

From what I observe, it could update my package.json chromedriver to 108. Then I run yarn osd bootstrap to update the node_modules. Pls check if this could help.

@ananzh
Copy link
Member

ananzh commented Mar 28, 2023

I am currently working on this issue #3700 which is to use VNC viewer to allow users to see browser interactions of the functional test if they use docker. I will add instructions to the docker instruction to update chromedriver. If you think there are other good places that even benefit non-docker users, pls create a PR to add more instructions.

@curq
Copy link
Collaborator Author

curq commented Mar 29, 2023

Thank you @ananzh @kavilla, I have tried your solutions and they both work without problems.
After updating to chrome 111 from manually installed version 107, I was able to update chromedriver as per your instructions to the same version as chrome (111.0.5563.146) and then start functional tests without any issues.

@joshuarrrr joshuarrrr added the OSCI Open Source Contributor Initiative label Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working docs Improvements or additions to documentation OSCI Open Source Contributor Initiative
Projects
None yet
Development

No branches or pull requests

4 participants