-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Incremental dotnet test
#20071
Comments
Note: This is different from incremental build (which we also fail at, here microsoft/vstest#3266). Incremental build ensures that we don't re-build the assemblies, but we will run tests from all of them. This asks to only run tests from the assemblies that changed or whose dependencies changed. This seems like a special case of a bigger "run only impacted tests" functionality, that could use other sources of change than just build. @kendrahavens should we consider adding this functionality? |
@nohwnd while "run only impacted tests" would also be a very useful feature, I don't see this as particularly related to that. This feature doesn't have to understand what tests are impacted, or even really that tests are involved at all. I am in fact simply asking to apply the concept of "incremental build" to running tests; in other words, if I'm not familiar with the relationship between |
@nohwnd I continue to see interest in making Looking at how Do you think that could work? Or do you have any other ideas? |
@eatdrinksleepcode I don't know enough about this to suggest a better way. Maybe you could tell me what the ideal situation would be and we can work from there? :) There also was a recent change in net9 to run tfms in parallel that collects tfms to build and runs inner msbuild: #38569 I don't know if that will makes things significantly more difficult, but thought it might be interesting to you. |
Also you should know that we are also quite unlikely to invest significant effort into this path, we would rather have a more complete and more granular solution. |
Is this referring to your previous comment:
I'm still all for it. I'm just concerned that it won't happen before I retire 😄 Is there an issue for that I can watch? |
Description
Incremental build is a critical feature for decreasing build times for large solutions. Currently we have incremental behavior for
dotnet build
anddotnet publish
, but notdotnet test
: tests are always run, even if nothing has changed since they last completed successfully.In the early days of .NET core, before
dotnet test
existed, I worked with the dotnet build tools team to add this behavior (see dotnet/buildtools#116). It has since been lost in the various tooling changes that have happened.Steps to reproduce
Consider the following project structure, where capital letters are projects with production code and lower-case letters are projects with test code:
I run
dotnet test
at the root: all six projects build, and all three test projects run tests, which pass.Now I change code in B, and run
dotnet test
from the root again.Expected behavior
B
/b
andC
/c
are built, butA
/a
are not built because they are up-to-date.b
andc
run tests, buta
does not run tests because none of its inputs have changed since the tests last passed.Actual behavior
B
/b
andC
/c
are built, butA
/a
are not built because they are up-to-date.a
,b
andc
run tests, irrespective of whether they have changed since they last passed.The text was updated successfully, but these errors were encountered: