-
Notifications
You must be signed in to change notification settings - Fork 11
WIP: Consumer tests #129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
WIP: Consumer tests #129
Conversation
License Check Results🚀 The license check job ran with the Bazel command: bazel run //src:license-check Status: ✅ Passed Click to expand output
|
The created documentation from the pull request is available at: docu-html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This draft adds end-to-end consumer tests that clone sample repositories, override their Bazel dependencies (locally or via Git), and verify build success.
- Introduces a
ConsumerRepo
dataclass and a list of repos to test - Implements helper functions to patch
MODULE.bazel
for local and Git overrides - Adds a single parametrized test (
test_and_clone_repos
) to clone repos, apply overrides, and run Bazel commands
Comments suppressed due to low confidence (1)
src/tests/test_consumer.py:24
- [nitpick] Attribute names should follow snake_case; rename to
local_override_result
for consistency.
LocalOverrideResult: bool
Adding some test commands
Figured out why it wasn't producing wanted errors Now need to introduce error parsing
1e2840e
to
5a944e8
Compare
Found a way to get results out of stderr&out. Still needs quiet a bit of work. But slowly getting there.
# Running through all 'cmds' specified with the local override | ||
print_running_cmd(repo.name, cmd, "LOCAL OVERRIDE") | ||
|
||
out = subprocess.run(cmd.split(), capture_output=True, text=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not check the subprocess for errors also here? with check=True. I feel like if some future maintainer “optimises” the processing of BR and forgets to look at returncode failures silently become successes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is, that if I do 'check=True' here, if bazel exits with a non 0 exit code (which it does when sphinx errors for example) it just stops execution immediatly there.
At least to my testing. That's why I thought it better to not do this here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
understood
Also note. This is on purpose not a Bazel test target, as this is executed via direct call. Additionally, the placement of this is obviously not finaly, I just put it there for now, if you can think of where it would fit better, let me know. |
Developing the consumer tests here for docs-as-code.
Just want to gather some feedback here on the general appraoch etc.
UNFINISHED therefore done as draft.