Skip to content

e2e-tests: Eliminate broker resource duplication and symlinks#1409

Merged
adombeck merged 9 commits intomainfrom
e2e-tests-refactor
Apr 8, 2026
Merged

e2e-tests: Eliminate broker resource duplication and symlinks#1409
adombeck merged 9 commits intomainfrom
e2e-tests-refactor

Conversation

@adombeck
Copy link
Copy Markdown
Contributor

@adombeck adombeck commented Apr 7, 2026

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.

UDENG-9637

@adombeck adombeck force-pushed the e2e-tests-refactor branch 2 times, most recently from d84d4e5 to ece5d2d Compare April 7, 2026 13:07
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.26%. Comparing base (1590501) to head (b1eef2a).
⚠️ Report is 22 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@adombeck adombeck changed the title e2e-tests: eliminate broker resource duplication and symlinks e2e-tests: Eliminate broker resource duplication and symlinks Apr 7, 2026
@adombeck adombeck force-pushed the e2e-tests-refactor branch 3 times, most recently from b9fdac5 to 65ab510 Compare April 7, 2026 20:02
@adombeck adombeck marked this pull request as ready for review April 7, 2026 20:53
@adombeck adombeck requested a review from denisonbarbosa April 7, 2026 20:53
@adombeck adombeck force-pushed the e2e-tests-refactor branch from 65ab510 to cfae36d Compare April 7, 2026 21:47
adombeck added 9 commits April 8, 2026 01:14
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.
@adombeck adombeck force-pushed the e2e-tests-refactor branch from cfae36d to b1eef2a Compare April 7, 2026 23:14
Copy link
Copy Markdown
Member

@denisonbarbosa denisonbarbosa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

@adombeck adombeck merged commit bfe1e43 into main Apr 8, 2026
35 of 43 checks passed
@adombeck adombeck deleted the e2e-tests-refactor branch April 8, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants