e2e-tests: Eliminate broker resource duplication and symlinks#1409
Merged
e2e-tests: Eliminate broker resource duplication and symlinks#1409
Conversation
d84d4e5 to
ece5d2d
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1409 +/- ##
==========================================
- Coverage 86.44% 86.26% -0.18%
==========================================
Files 99 99
Lines 6690 6690
Branches 111 111
==========================================
- Hits 5783 5771 -12
- Misses 851 859 +8
- Partials 56 60 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
b9fdac5 to
65ab510
Compare
65ab510 to
cfae36d
Compare
It's overwritten by the definition in e2e-tests/resources/authd-msentraid/broker.resource
Previously the broker was selected at runtime by creating a symlink tests/resources/broker -> authd-msentraid (or authd-google). This caused confusion in IDEs (IntelliJ/Copilot) and led to the same Browser.py and browser_login.py being duplicated in both broker resource directories. Replace the approach with a permanent resources/broker/ directory that holds the shared code: - broker.resource: all shared Robot Framework keywords, parameterized by variables that are defined by broker_vars.py based on the BROKER environment variable. - Browser.py: dispatches to the correct login script based on the BROKER environment variable. - browser_login/base.py: shared scaffolding. - browser_login/google.py, msentraid.py: broker-specific login flows. Because the run-tests.sh script now doesn't create a symlink to the resource directory anymore, we add the e2e-tests directory to the PYTHONPATH via robot's --pythonpath option and import the resources from there. The run-tests.sh script also doesn't create symlinks to the tests anymore, we instead pass the paths to the tests below e2e-tests/tests.
For the same reason explained in the previous commit (confusion in IDEs and Copilot), this commit removes the symlink to YARF's kvm.resource and video_input_vars.py. They are not imported directly from from YARF's yarf/rf_libraries/resources directory and yarf/rf_libraries/variables, which we add to the PYTHONPATH.
The file configures RobotCode, a plugin for Robot Framework in VS Code and IntelliJ. It is only used for code completion and IntelliSense, and does not affect the actual execution of tests.
Fixes code navigation with the RobotCode plugin and is cleaner anyway than using a global variable.
By default, the robot command barely prints any output to the terminal, so it's unclear what it's currently doing / waiting for. This commit adds a Listener which prints any log messages printed by the tests and the suite and keyword that's currently executed, and how long it took to complete.
When specifying multiple tests, the SUITE_NAME contains all of them, and
only after a '.' comes the name of the suite that's executed. If we use
that as the directory name, it results in something like
Authd Disabled & Broker Disabled.Authd Disabled
That's with just two tests, if we would specify more, it becomes even
longer.
The fix is to only use the part after the '.' as the directory name.
Now that we don't symlink files into it anymore, the test run directory didn't contain any files or directories beside the output directory, so we can just use it itself as the output directory.
cfae36d to
b1eef2a
Compare
denisonbarbosa
approved these changes
Apr 8, 2026
Member
denisonbarbosa
left a comment
There was a problem hiding this comment.
Amazing work! It's going to be way easier to navigate around the tests now, and it's definitely for the best. Thanks for the work on this!
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Previously the broker was selected at runtime by creating a symlink
tests/resources/broker->authd-msentraid(orauthd-google). This caused confusion in IDEs (IntelliJ/Copilot) and led to the sameBrowser.pyandbrowser_login.pybeing duplicated in both broker resource directories.Replace the approach with a permanent
resources/broker/directory that holds the shared code:broker.resource: all shared Robot Framework keywords, parameterized by variables that are defined bybroker_vars.pybased on theBROKERenvironment variable.Browser.py: dispatches to the correct login script based on theBROKERenvironment variable.browser_login/base.py: shared scaffolding.browser_login/google.py,msentraid.py: broker-specific login flows.Because the run-tests.sh script now doesn't create a symlink to the resource directory anymore, we add the e2e-tests directory to the PYTHONPATH via robot's --pythonpath option and import the resources from there.
The run-tests.sh script also doesn't create symlinks to the tests anymore, we instead pass the paths to the tests below e2e-tests/tests.
UDENG-9637