-
Notifications
You must be signed in to change notification settings - Fork 1.7k
#17470 - run unit tests at the crate level not workspace #17472
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
Conversation
r? @HKalbasi |
Hi! Sorry for very late response, I missed the first mention. Is the goal of this PR is to reduce the compile time of the tests by compiling only the specified crate? Is it consistence with what the |
Hi HKalbasi,
I listed the problems in the issue #17470 My personal goal is just to efficiently execute a test from a keyboard shortcut. This invokes the Test Explorer version but it caused me too many problems:
The two runners do need to be unified:
This means that the Lens no longer needs to spawn extra terminals to show the output. It would instead show the Test Results pane. The benefit of this is:
I could create an issue and look at that if you wanted?
I assume you mean the opposite :) It never uses the workspace flag. I see it uses the "exact" flag which I didn't know about and likely desirable for stopping the "search pattern" behaviour. I'm not clear on the condition it has that causes it not be added though. The Lens test runner code with |
Did you test this PR in your own workflow to see if it fixes your problems?
I think at the end we probably want to retire the But for now, test explorer is an experimental and second class feature, which is unstable and has less client support, so we should not use it in the stable and heavily used lens functionality. We may want to add an option for opting out of What I meant by keeping the code lens and test explorer consistent, was about the cargo command they use, not ui. That is, if code lens produce |
There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged. You can start a rebase with the following commands:
The following commits are merge commits: |
@duncanawoods did you intended to change something in your latest commit? I guess your change was lost during the rebase. |
Just syncing the fork... tried out Github's tempting "sync fork" button which rustbot didn't like. I think the original change is still there.
Yep, I've used it for a month with no issues so officially certified as "works on my machine"... for one workspace.
I'm not intending to refer to the Test Explorer but the VS Code API testing api https://code.visualstudio.com/api/extension-guides/testing As I understand it, this is the expected way for a language extension to support testing. It originated in the third party Test Explorer extension but was integrated as a native API and provides testing support across the vscode client which I believe includes the explorer, buttons in margins, menus and commands like
To me, that means the As I understand the two flows at the moment:
Unification to take the best from each would look something like:
i.e.
It's already optional in the settings.
It's pretty difficult to tell exactly how much they can vary from inspection because they build the command line from settings objects and there is a lot of branching / optional objects. The lens invocation has many layers to the preparation of the task where arguments and environment can be altered. As an RA user, I highly value if RA logged every command line to help sort out issues with settings. Anyway, the primary differences as far as I can tell:
Which is pretty significant e.g. they might even use different toolchains. |
About client support, I meant that code lens is supported by vscode, neovim, emacs, ... (the clients of the r-a language server) but the code in the In the table of differences (which is helpful information, thank you) some of them are fundamental differences (e.g. I'm fine with merging this PR as-is if there is some limitation with the |
tested with:
tested:
|
This one is related to the third party extension so it shouldn't do anything, right? The CI is red but it seems it is unrelated to your PR. Can you try to squash your commit to rerun CI? |
07783ad
to
a1cf516
Compare
…extra_test_bin_args settings
I believe so. I don't think it's a regression but since I tried it, thought it worth mentioning. I'm surprised it doesn't do anything.
Done. Looks like the CI has sorted itself. Strange error. |
Thanks! |
☀️ Test successful - checks-actions |
Thanks for your time and patience @HKalbasi! |
For #17470
Use the test path to identify a package in the workspace and run the unit test there instead of at the workspace.