Ability to run tests only for files that changed #303
Replies: 1 comment
-
One problem I see with this is that green would need to know which source control system you currently use (git is currently the most popular lately but not the only one). The more difficult thing is that there is no direct mapping between the tests and the source code. Consider this project:
So now if you change a.py I can see how we could assume that we need to run test_a.py but if it turns out that Tools such as Bazel have support to resolve dependency trees and that's actually a complicated thing. Bazel does NOT rely on git to know if something has changed and relies on explicitly declared dependencies in BUILD.bazel files as well as advanced caching mechanisms. See https://bazel.build for more details. Of course Bazel is just one such tools and there are other re-implementatios of Blaze (original name of Bazel in use at Google) such as Bucks (Facebook version). Overall there are 2 issues:
Overall I feel this is a very complicated thing to get to work reliably and universally, which would be much beyond the scope of green to be a simple and reliable tool to run unittests. Of course this is ultimately @CleanCut's decision as the owner of the project. |
Beta Was this translation helpful? Give feedback.
-
Hi, we're running green in a large repo with 1000s of tests available. This sadly takes some time to run. When opening a small PR, we often don't want to run all the tests. Ideally within the PR we just want to run the tests for the file that changed. It would be nice if green can support such feature where it relies on git file changes to be able to detect what tests to run.
This is a rough pseudo-code to do that using unittest. Would green be open to support such feature?
Beta Was this translation helpful? Give feedback.
All reactions