Skip to content

chore: factor mock mctx/rctx functionality into separate file#3700

Merged
rickeylev merged 16 commits intobazel-contrib:mainfrom
rickeylev:refactor.mocks
Apr 13, 2026
Merged

chore: factor mock mctx/rctx functionality into separate file#3700
rickeylev merged 16 commits intobazel-contrib:mainfrom
rickeylev:refactor.mocks

Conversation

@rickeylev
Copy link
Copy Markdown
Collaborator

This factors the various mocking logic spread throughout the code
base into a single mocks module. This should make it easier to re-use
and add unit tests of other functionality.

@rickeylev rickeylev requested review from aignas and groodt as code owners April 13, 2026 03:10
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request centralizes mocking logic for Bazel repository and module contexts into a new tests/support/mocks/mocks.bzl library and refactors existing tests to use these shared utilities. Feedback identifies a bug in _mctx_new that breaks method chaining, suggests improving path resolution for MockFile objects in read methods, and recommends removing internal developer notes and fixing a logic error in _rctx_download_and_extract.

@rickeylev rickeylev enabled auto-merge April 13, 2026 04:32
@rickeylev rickeylev added this pull request to the merge queue Apr 13, 2026
Merged via the queue into bazel-contrib:main with commit 85e4a3c Apr 13, 2026
4 checks passed
@rickeylev rickeylev deleted the refactor.mocks branch April 13, 2026 04:54
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