-
Task
-
Resolution: Resolved
-
Neutral
-
None
-
None
-
None
-
-
Empty show more show less
-
Yes
Context
To run UI-tests, projects depend on core-Tf, which comes with artifacts from selenium, selenide, etc.. So - managing the version of the artifacts at one single place is done in core-TF.
But, additionally, we need docker-images from Selenium to run the tests. We typically have a docker-compose and and a .env file for each project. These two files are typically project-specific and cannot be shared among various projects.
The .env file contains this assignment:
SELENIUM_VERSION=4.13.0
The value for SELENIUM_VERSION is the same in all .env files of all projects.
(at least it should be)
Approach
Inspiration from here:
https://stackoverflow.com/questions/62121588/how-to-evaluate-a-dynamic-variable-in-a-docker-compose-yml-file
On the individual projects have this:
a file named env_raw or similar. It is identical to the final ray, but keeps a placeholder for the value of SELENIUM_VERSION
at aws-build-scripts repository we have this:
a downloadable script which contains the value for SELENIUM_VERSION and a function to transform env_raw into .env
In the Jenkins pipeline- we need to download the script and create "dynamically" the .env before calling docker-compose.
What about running tests locally?
The above mentioned approach should work fine on Jenkins.
BUT locally we would lack the .env file.
To workaround this - each project could still contain a .env file with a literal value for the SELENIUM_VERSION. On jenkins we would just override the file.
- is related to
-
BUILD-1183 pipeline-templates supporting selenium get SELENIUM-DOCKER-TAG from docker-common-values
- Closed
-
MGNLTEST-311 UI tests can run locally without the need to locally change .env and docker file(s)
- Selected
-
MGNLTEST-201 Provide default environment variables to projects
- Closed