-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
SE_NODE_STEREOTYPE_EXTRA to append custom capabilities to default Node stereotype #2624
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
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
CI Feedback 🧐(Feedback updated until commit b8b89f3)A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
795eb32
to
5b411a6
Compare
…e stereotype Signed-off-by: Viet Nguyen Duc <[email protected]>
5b411a6
to
9e262a1
Compare
Signed-off-by: Viet Nguyen Duc <[email protected]>
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
Fixes #2506
In another case, if you want to retain the default Node stereotype and append additional capabilities, you can use the
SE_NODE_STEREOTYPE_EXTRA
environment variable to set your capabilities. Those will be merged to the default stereotype. For example:This help setting custom capabilities for matching specific Nodes. For example, you added your custom capabilities when starting the Node, and you want assign a test to run on that Node which matches your capabilities. For example in test code:
Noted: Your custom capabilities with key values should be in W3C capabilities convention, extension capabilities key must contain a ":" (colon) character, denoting an implementation specific namespace.
Noted: Ensure that Node config
detect-drivers = false
inconfig.toml
(or--detect-drivers false
in CLI option) to make feature setting custom capabilities for matching specific Nodes get working.In addition, default Node stereotype includes capability
se:containerName
which can visible in node capabilities, or session capabilities to identify the container name where the node/session is running. The prefixedse:containerName
is not included in slot matcher. By default, value is getting fromhostname
command in container, this value is equivalent to thecontainer_id
that you saw viadocker ps
command. If you want to override this value, you can set the environment variableSE_NODE_CONTAINER_NAME
to your desired value. For example, when deploy to Kubernetes cluster, you can assign Pod name to env varSE_NODE_CONTAINER_NAME
to track a node is running in which Pod.In an advanced case, where you control to spawn up a Node container, let it register to Hub, and then trigger a test to be assigned exactly to run on that Node. By default, the value of command
$(hostname)
is added to capability namecontainer:hostname
in Node stereotype. Combine with above feature setting custom capabilities for matching specific Nodes. You can use thehostname
of the Node container just spawned up and set it as a custom capability. For example, in Python binding:Noted: Those above changes require new image tag where the changeset is included & released.
Motivation and Context
Types of changes
Checklist
PR Type
Enhancement, Documentation
Description
Introduced
SE_NODE_STEREOTYPE_EXTRA
to append custom capabilities to default Node stereotype.Added a Python script (
json_merge.py
) for merging JSON strings.Updated Dockerfile and configuration scripts to integrate
SE_NODE_STEREOTYPE_EXTRA
.Enhanced documentation with examples and explanations for new environment variables.
Changes walkthrough 📝
5 files
Added Python script for merging JSON strings
Updated script to include additional file types
Integrated `json_merge.py` into Docker image
Added logic to merge `SE_NODE_STEREOTYPE_EXTRA` into Node stereotype
Integrated
SE_NODE_STEREOTYPE_EXTRA
into standalone Node configuration3 files
Documented new environment variables for Node configuration
Added usage examples for
SE_NODE_STEREOTYPE_EXTRA
and related featuresAdded descriptions for new environment variables
1 files
Added default values for new environment variables