You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thanks for contributing to the Docker-Selenium project! A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines, applied for this repository.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
fix: conflict config.toml in browser containers when node-docker volumes is shared
Motivation and Context
After harmonized mount points to /opt/selenium/config.toml (#2343). Once volumes config is shared to node browser containers, its config.toml could be overwritten by node-docker container config file.
In this case, mount your config.toml file to another name e.g /opt/selenium/docker.toml in node-docker container. And set the environment variable SE_NODE_DOCKER_CONFIG_FILENAME=docker.toml to specify that config file name for the startup script.
Types of changes
Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)
Breaking change (fix or feature that would cause existing functionality to change)
Configuration Flexibility The script now uses an environment variable SE_NODE_DOCKER_CONFIG_FILENAME to determine the configuration file path. Ensure that this variable is always set properly in environments where the script runs to avoid defaulting to config.toml, which might not exist.
New Capabilities New capabilities suppressKillServer and allowDelayAdb have been added. Verify that these capabilities are supported in all target environments and do not introduce any side effects or undesired behavior.
Add a check to ensure the SE_NODE_DOCKER_CONFIG_FILENAME environment variable is set
Consider adding a check to ensure that the environment variable SE_NODE_DOCKER_CONFIG_FILENAME is not empty before using it in the --config option. This can prevent potential issues where the configuration file might not be specified, leading to unexpected behaviors.
---config /opt/selenium/${SE_NODE_DOCKER_CONFIG_FILENAME:-"config.toml"}+if [ -z "${SE_NODE_DOCKER_CONFIG_FILENAME}" ]; then+ echo "Error: SE_NODE_DOCKER_CONFIG_FILENAME is not set."+ exit 1+fi+--config /opt/selenium/${SE_NODE_DOCKER_CONFIG_FILENAME}
Apply this suggestion
Suggestion importance[1-10]: 9
Why: This suggestion adds a crucial check to ensure that the SE_NODE_DOCKER_CONFIG_FILENAME environment variable is set, which can prevent potential issues where the configuration file might not be specified, leading to unexpected behaviors.
9
Add a check to ensure version variables are synchronized
To avoid potential issues with version mismatches or unexpected behavior in builds, consider adding a check to ensure that BASE_VERSION, BINDING_VERSION, and VERSION are synchronized, especially when they are expected to match.
Why: Ensuring that version variables are synchronized can prevent potential issues with version mismatches or unexpected behavior in builds, which is important for maintaining consistency.
8
Enhancement
Adjust volume mount paths to prevent conflicts
Ensure that the volume mount paths are correctly set to avoid potential conflicts or overwrites, especially when dealing with configuration files that might be shared across different containers.
-- ./videos/config.toml:/opt/selenium/docker.toml+- ./config/docker.toml:/opt/selenium/docker.toml # Adjusted path to separate config files from video files
Apply this suggestion
Suggestion importance[1-10]: 7
Why: Adjusting the volume mount paths to separate config files from video files can help avoid potential conflicts or overwrites, improving the reliability of the configuration.
7
Best practice
Validate and comment on the intentional settings of boolean capabilities
It's recommended to validate the boolean values for capabilities like suppressKillServer and allowDelayAdb to ensure they are intentionally set as expected, especially when their default values might cause unintended behavior in test environments.
-options.set_capability('appium:suppressKillServer', True)-options.set_capability('appium:allowDelayAdb', False)+options.set_capability('appium:suppressKillServer', True) # Ensure this is the intended setting+options.set_capability('appium:allowDelayAdb', False) # Verify this should not be True
Apply this suggestion
Suggestion importance[1-10]: 5
Why: Adding comments to validate boolean values is a good practice for clarity, but it does not significantly improve the functionality or prevent major issues.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Thanks for contributing to the Docker-Selenium project!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines, applied for this repository.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
fix: conflict config.toml in browser containers when node-docker volumes is shared
Motivation and Context
After harmonized mount points to
/opt/selenium/config.toml
(#2343). Once volumes config is shared to node browser containers, itsconfig.toml
could be overwritten by node-docker container config file.In this case, mount your
config.toml
file to another name e.g/opt/selenium/docker.toml
in node-docker container. And set the environment variableSE_NODE_DOCKER_CONFIG_FILENAME=docker.toml
to specify that config file name for the startup script.Types of changes
Checklist
PR Type
Bug fix, Enhancement, Documentation
Description
SE_NODE_DOCKER_CONFIG_FILENAME
environment variable.suppressKillServer
andallowDelayAdb
in Selenium tests setup.gen_certs
target in the Makefile.config.toml
to/opt/selenium
.Changes walkthrough 📝
start-selenium-grid-docker.sh
Make configuration file path dynamic in startup script
NodeDocker/start-selenium-grid-docker.sh
SE_NODE_DOCKER_CONFIG_FILENAME
environment variable.__init__.py
Add new Appium capabilities in Selenium tests setup
tests/SeleniumTests/init.py
suppressKillServer
andallowDelayAdb
.Makefile
Update Selenium version and add certificate generation target
Makefile
gen_certs
target and included it in thebase
target.Dockerfile
Adjust Dockerfile to copy config.toml to /opt/selenium
NodeDocker/Dockerfile
config.toml
copy command to a new line and changed itsdestination directory.
docker-compose-v3-test-node-docker.yaml
Update docker-compose for dynamic config file path
tests/docker-compose-v3-test-node-docker.yaml
config.toml
and addedSE_NODE_DOCKER_CONFIG_FILENAME
environment variable.README.md
Document sharing volumes config in Dynamic Grid
README.md
container to node browser containers.