[MGNLTEST-425] VncRecordingHelper evaluates wrong host (most of the times) on saas Created: 18/Jul/23  Updated: 06/Sep/23  Resolved: 06/Sep/23

Status: Closed
Project: Magnolia Test Framework
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Christoph Meier Assignee: Christoph Meier
Resolution: Resolved Votes: 0
Labels: VN-Testing, vncRecorder-issue
Remaining Estimate: Not Specified
Time Spent: 2d 6.5h
Original Estimate: Not Specified

Issue Links:
relation
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[X]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Epic Link: reporting-and-coverage-improvments-and-fixes
Work Started:

 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());

See: https://git.magnolia-cms.com/projects/PLATFORM/repos/test-framework/browse/magnolia-test-framework/src/main/java/info/magnolia/test/vnc/VncRecordingHelper.java#85

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



 Comments   
Comment by Christoph Meier [ 02/Aug/23 ]

Changes on this project merged -> PR

Now integrating changes on core-TF consumer-modules which are using selenium-hub

Comment by Christoph Meier [ 02/Aug/23 ]

ce/master -> integrated -> PR

Comment by Christoph Meier [ 02/Aug/23 ]

dx-core/master integrated -> PR

Comment by Christoph Meier [ 03/Aug/23 ]

magnolia-sso integrated ->PR

Comment by Christoph Meier [ 10/Aug/23 ]

ce-release/6.2 integrated -> PR

Comment by Christoph Meier [ 10/Aug/23 ]

dx-core-master integrated ->commit

Comment by Christoph Meier [ 10/Aug/23 ]

dx-core release/62 integrated -> commit

Comment by Christoph Meier [ 10/Aug/23 ]

dx-core-ee9 integrated ->commit

Comment by Christoph Meier [ 10/Aug/23 ]

ce-ee9 integrated ->commit

Comment by Christoph Meier [ 06/Sep/23 ]

Also. integrated in addons-tests
See https://git.magnolia-cms.com/projects/INTERNAL/repos/addon-tests/commits/8acf368c6cc2503140c98bc589597d15777c85c5 

Generated at Mon Feb 12 07:48:50 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.