[WIP] Fix code as per review comments in PR 690#703
Closed
krishnakumar4a4 with Copilot wants to merge 9 commits into
Closed
[WIP] Fix code as per review comments in PR 690#703krishnakumar4a4 with Copilot wants to merge 9 commits into
krishnakumar4a4 with Copilot wants to merge 9 commits into
Conversation
Introduce BuildTaskRunner and PackageTaskRunner with #[automock] to decouple BuildAction orchestration tests from the full provider stack. BuildAction tests now mock runners instead of every individual provider, reducing tests.rs from ~3400 lines to ~700 lines while maintaining equivalent coverage through dedicated unit tests in build_task.rs and package_task.rs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: fa978dd1-9d61-4cea-a03a-7ebc914228fa
…due to expectation overrides
Group top-level orchestration tests into three submodules by scenario type: - standalone_driver_project: single-package driver builds - driver_workspace: multi-package Cargo workspace builds - emulated_workspace: filesystem-based emulated workspace builds No test logic changes; only structural reorganization for clarity. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: fa978dd1-9d61-4cea-a03a-7ebc914228fa
- Rename TestBuildAction to BuildActionHarness for consistency with PackageTaskHarness naming convention in the task layer. - Shorten test function names since submodule names already provide the 'given' context (e.g. standalone_driver_project::run_skips_probe...). - Rename test_build_action parameter to harness throughout. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: fa978dd1-9d61-4cea-a03a-7ebc914228fa
BuildTaskRunner::run previously collected the entire cargo message stream into a Vec, which forced every message to be parsed and allocated up front and prevented get_target_dir_from_output from short-circuiting once the matching cdylib artifact is found. Return Box<dyn Iterator<..>> instead so the runner forwards BuildTask::run's lazy stream while still being mockable (mockall cannot mock an opaque impl Trait return, but can mock a boxed trait object). BuildTask::run gains + use<> precise capturing so its owned, 'static iterator can move out of the temporary BuildTask and be boxed. Addresses PR review comment r3581534373. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: fa978dd1-9d61-4cea-a03a-7ebc914228fa
Contributor
|
A copilot bug created this PR instead of committing changes to original PR. Closing this one. |
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.
Address review comments from PR #690 review (pullrequestreview-4705206556):
TEST_MUTEX.lock().unwrap()withunwrap_or_else(|e| e.into_inner())(9 sites in package_task.rs)--locked/Featuresare forwarded into metadata provider call in setup helper(s)harness.featuresand asserts the cargo-rustc probe still succeeds (feature forwarding)