Details
-
Bug
-
Resolution: Resolved
-
Neutral
-
None
-
None
Description
private void resolveTestExecutorNodeHostName(){}
Returns the correct node only if there is a seleniumHub running (by accident)
Update 2023-07-19
We found two issues:
Issue 1: Incorrect Selenium mode detection
Problem
The way VNC recorder detects if Selenium running in Standalone mode or Hub mode is checking container name "selenium-hub" is alive in Docker runtime environment or not.
this.isSeleniumHubOnDocker = DockerHelper.isContainerAlive(testSettings.seleniumHubContainerName());
This works as expected in local Docker, however, not ideal on Jenkins where we have a single Docker environment in a Jenkins node that run multiple testing jobs. In case one test job is running Selenium Hub mode while another test job is running Selenium standalone mode, we have incorrect detection.
Solution
We need to explicitly define and check Selenium mode for each testing job by using the supported variable "selenium.standalone".
https://git.magnolia-cms.com/projects/PLATFORM/repos/test-framework/browse/magnolia-test-framework/src/main/java/info/magnolia/test/setup/IntegrationTestSettings.java#89-91
By default, SELENIUM_STANDALONE is true, so we don't need to adapt for standalone setup.
For all of the Selenium Hub testing setup, we need to adapt by passing an environment SELENIUM_STANDALONE=false to the vncrecorder service in docker-compose.
Issue 2: In cloud-e2e, vncrecorder is using default port to access Selenium service.
Problem
The Selenium is exposing a random port for VNC access to a record: https://git.magnolia-cms.com/projects/CLOUD/repos/cloud-e2e/browse/docker-compose.yml#19
However, the VNC is checking default port 5900, so it's failed to start recording
Solution
Keep the port align between Selenium service and vncrecorder service, like this example: https://git.magnolia-cms.com/projects/CLOUD/repos/hello-saas-e2e/browse/docker-compose.yml#36-38
Just for reference, VNC recorder supported configuration is listed here: https://github.com/magnolia-cms/vncrecorderd/blob/dc94781440adf9b7736f9833daa1763deb7d40f2/README.md#configuration-options