Fix test reporting regression (#57795)
Summary:
Here is why another move of this single line is needed:
- Regardless of whether test-run failed or succeeded it's good to
report number of tests executed
- `docker cp || echo` always succeeds so could safely be executed
before any other step in "Report test results"
- This command should not be part of "Run tests" step, otherwise it would not get executed if any of the test failed (if it must be part of "Run tests" step, it should be prefixed with [trap](https://tldp.org/LDP/Bash-Beginners-Guide/html/sect_12_02.html) command and defined before `docker exec` step
This fixes "regression" introduced by https://github.com/pytorch/pytorch/pull/56725 although real culprit here is lack of documentation
Here is an example of PR where test results are not reported back due to
the failure: https://app.circleci.com/pipelines/github/pytorch/pytorch/317199/workflows/584a658b-c742-4cbb-8f81-6bb4718a0c04/jobs/13209736/steps
Pull Request resolved: https://github.com/pytorch/pytorch/pull/57795
Reviewed By: samestep
Differential Revision: D28275510
Pulled By: malfet
fbshipit-source-id: 622f3bfca96a1ee9b8959590b28a26046eb37ea3