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

fix: correctly identify the target inside packages and match output #18956

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

duncanawoods
Copy link

This is a PR to fix most of #18955

The two main changes:

  1. update request::handle_run_test and test_runner to identify the target inside a package that matches a test request. This fixes RA failing to find the right package because the test uses the target name.

  2. extend CargoActor to take a parser object rather than just a generic type with static parsing functions. This allows context about the invocation of cargo to be used when interpreting the cargo output so it can be properly integrated with the GUI.

In this case, it's information about the test that has been run which isn't contained in cargo output. The current behaviour is very flaky so that if you have tests with the same name in multiple crates or targets, the results are often assigned to the wrong target.

The StatelessParser wrapper ensures existing static parsers can be used without any changes.

…his context available when parsing test output
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 16, 2025
@duncanawoods
Copy link
Author

This fixes 1 a), 1 b) and 2. from the issue.

1 c) requires more thought / discussion:

  • changing the test_runner to launch multiple cargo test processes would be significant behaviour change
  • introducing the notion of a default target or setting deserves some thought

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants