bash
python utils/test_fetcher.py
from the root of the Transformers repo. It will:
Check for each file in the diff if the changes are in the code or only in comments or docstrings. Only the files with real code changes are kept.
Build an internal map that gives for each file of the source code of the library all the files it recursively impacts. Module A is said to impact module B if module B imports module A. For the recursive impact, we need a chain of modules going from module A to module B in which each module imports the previous one.
Apply this map on the files gathered in step 1, which  gives us the list of model files impacted by the PR.
Map each of those files to their corresponding test file(s) and get the list of tests to run.
When executing the script locally, you should get the results of step 1, 3 and 4 printed and thus know which tests are run. The script will also create a file named test_list.txt which contains the list of tests to run, and you can run them locally with the following command:
