-
Notifications
You must be signed in to change notification settings - Fork 389
Run tests only for source code changed on CI build server #1148
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
Comments
In general, it is difficult to do this with any precision. Even if you have per-test code coverage and thus can see which current lines affect a specific test, you can't say for sure which tests any added lines might affect. (coverlet does not record which unit tests caused what code coverage, currently.) I think the best you can hope for is to identify which unit test projects you need to re-run, based on which of their referenced projects have had changes. If you have a fine-grained project structure, this could reduce test time in some cases. Coverlet can't help with this approach, but perhaps you can identify that by what dotnet decides to rebuild. Something like this:
|
This is a duplicate of #973 We did an offline discussion and I've suggested for now to try to fork coverlet core to try to understand if using collectors(they have start/stop test event) and coverage check on the fly(you can understand what that test touched looking at "in memory hits" collection+source mappings) would be possible have an "incremental" test profile and run only test that will cover updated part since last test run. But at the moment this feature is out of coverlet scope, anyway I admit that I think it would be doable. |
Closing because answered. |
Hello,
I've a Dotnet core project with XUnit test cases. Its taking almost 1 hour to run tests. Is it possible to run tests by detecting changes in source code since last test or only source code changes on current branch?
Please point me to right project if this is not right place.
Thanks in advance.
The text was updated successfully, but these errors were encountered: