We currently run all tests for all changes to the code. This is, however, not always necessary. Each test depends on certain parts of the code, and if that code did not change, we don't need to rerun the tests.
For example, if a commit makes a change to Wolfram Language code only, there is no need to run C++ tests because they would not be affected by that commit. We can be even more granular by checking the dependency tree (which we can do in both WL and C++) and only running the tests if their dependencies have changed.
We can do it on a file-by-file basis for C++ and a symbol-by-symbol basis for Wolfram Language.
Possible solution
Locally, we can just compute a source code hash for each test/group of tests, and if the test script is rerun, we only need to rerun the tests for which the source code has changed.
In CI, we can find the nearest parent commit that has passed the tests and only run the tests for the changes based on the diff from that commit.
The problem
We currently run all tests for all changes to the code. This is, however, not always necessary. Each test depends on certain parts of the code, and if that code did not change, we don't need to rerun the tests.
For example, if a commit makes a change to Wolfram Language code only, there is no need to run C++ tests because they would not be affected by that commit. We can be even more granular by checking the dependency tree (which we can do in both WL and C++) and only running the tests if their dependencies have changed.
We can do it on a file-by-file basis for C++ and a symbol-by-symbol basis for Wolfram Language.
Possible solution
Locally, we can just compute a source code hash for each test/group of tests, and if the test script is rerun, we only need to rerun the tests for which the source code has changed.
In CI, we can find the nearest parent commit that has passed the tests and only run the tests for the changes based on the diff from that commit.
Also, check cache in Circle CI.