changeset 49497:1baf0fffd82f

run-tests: display the time it took to install Mercurial It will help make people aware of this critical step and to assess the time it takes in various options (like a CI run for example).
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 22 Sep 2022 01:50:53 +0200
parents 35bf7f23b84c
children f2b1bc19ce90
files tests/run-tests.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Thu Sep 22 01:48:02 2022 +0200
+++ b/tests/run-tests.py	Thu Sep 22 01:50:53 2022 +0200
@@ -3444,6 +3444,7 @@
             if self.options.list_tests:
                 result = runner.listtests(suite)
             else:
+                install_start_time = time.monotonic()
                 self._usecorrectpython()
                 if self._installdir:
                     self._installhg()
@@ -3457,6 +3458,11 @@
                 elif self.options.pyoxidized:
                     self._build_pyoxidized()
                 self._use_correct_mercurial()
+                install_end_time = time.monotonic()
+                if self._installdir:
+                    msg = 'installed Mercurial in %.2f seconds'
+                    msg %= install_end_time - install_start_time
+                    log(msg)
 
                 log(
                     'running %d tests using %d parallel processes'