Skip to content
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

Rename run_rule to run_rule_with_mocks #10702

Merged
merged 1 commit into from Aug 29, 2020

Conversation

Eric-Arellano
Copy link
Contributor

run_rule() sounds far too similar to RuleRunner(). See https://www.pantsbuild.org/v2.0/docs/rules-api-testing for how these things are different.

run_rule_with_mocks better expresses what this approach is useful for: running a @rule with controlled (~mocked) input, including mocked await Gets.

We move this function to testutil/rule_runner.py for easier imports, as it does fit into the overall theme of "running rules".

[ci skip-rust]
[ci skip-build-wheels]

# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
@Eric-Arellano
Copy link
Contributor Author

Open to better names :)

We move this function to testutil/rule_runner.py for easier imports, as it does fit into the overall theme of "running rules".

This means that we will have much more cache invalidation for our own tests than we'd like. But I'm optimizing here for a good public API as documented by https://www.pantsbuild.org/v2.0/docs/rules-api-testing.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 0.0% when pulling efb1ea5 on Eric-Arellano:run-rule-with-mocks into d3eee59 on pantsbuild:master.

@Eric-Arellano Eric-Arellano merged commit 9632f36 into pantsbuild:master Aug 29, 2020
@Eric-Arellano Eric-Arellano deleted the run-rule-with-mocks branch August 29, 2020 01:19
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.

None yet

3 participants