Include short test suites ln total_seconds stat (#56040)
Summary:
Up until this PR, the top-level `total_seconds` stat we've been uploading to S3 has only included suites longer than one second. This PR corrects that issue, and also clarifies the script's textual output for "longest tests of entire run".
(Note that the `total_time` local variable is passed as the `total_seconds` parameter in the call to `assemble_s3_object`.)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/56040
Test Plan:
Create a simple test file (call it `test_quick_maths.py`) with these contents:
```py
from torch.testing._internal.common_utils import TestCase, run_tests
class TestQuickMaths(TestCase):
def test_two_plus_two(self):
self.assertEqual(2 + 2, 4)
if __name__ == '__main__':
run_tests()
```
Run it and save the test results:
```sh
rm -r /tmp/reports ; python3 test_quick_maths.py --save-xml=/tmp/reports
```
Then display them using the script:
```sh
tools/print_test_stats.py /tmp/reports
```
- Before this PR:
```
No scribe access token provided, skip sending report!
Total runtime is 0:00:00
0 longest tests of entire run:
```
- With this PR:
```
No scribe access token provided, skip sending report!
Total runtime is 0:00:00.108000
0 longest tests of entire run (ignoring suites totaling less than 1.0 seconds):
```
If you were to upload this to S3 (see https://github.com/pytorch/pytorch/issues/49190 for an example of how to do this manually), the top-level `total_seconds` field should also change from `0` to `0.108`.
Reviewed By: janeyx99
Differential Revision: D27770666
Pulled By: samestep
fbshipit-source-id: 8255a4726ab3a692bbeff4c48974fbb3c6375142