pytorch/.ci
Joel Schlosser 64720f3b89 Introduce checks to validate public API tests (#131390)
This PR introduces a new sanity check for the public API tests in `.ci/pytorch/test.sh`.
* Validates two public API tests:
    1. Ensures `test_correct_module_names` fails when a new file OR an existing file adds an invalid public API function (e.g. one whose `__module__` is unset).
    2. Ensures `test_modules_can_be_imported` fails when a module underneath `torch/` cannot be imported.
* Runs this in CI as part just before the pre-existing FC / BC checks.

I've verified that re-introducing the bug that #131386 fixed causes the new check to fail:
![public_api_failure](https://github.com/user-attachments/assets/376ddef3-d14a-41f6-93e2-f935deb6555a)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/131390
Approved by: https://github.com/albanD
2024-08-03 00:29:00 +00:00
..
caffe2
docker [Docker] Replace epel release rpm by yum install (#132449) 2024-08-02 00:16:03 +00:00
onnx Workaround dind-rootless bind mount permissions (#123641) 2024-04-10 22:44:57 +00:00
pytorch Introduce checks to validate public API tests (#131390) 2024-08-03 00:29:00 +00:00