[PATCH] run-tests: more accurate/helpful message than "diff generation failed"

Kyle Lippincott spectral at google.com
Thu Oct 9 19:22:55 CDT 2014


# HG changeset patch
# User Kyle Lippincott <spectral at google.com>
# Date 1412899229 25200
#      Thu Oct 09 17:00:29 2014 -0700
# Node ID b5ceffcc0e92bc9cd22ce2c67148bd8e1118d53e
# Parent  6e9e1deb1152d7282c08ba3675d2414feb234bf0
run-tests: more accurate/helpful message than "diff generation failed"

Diff generation didn't really fail, it recognized that an hg serve server has
failed to start, and thus skipped the diff generation intentionally.

The most common reason for a server to fail to start is that the port was
already in use, so output HGPORT as well, to help finding it (since pgrep -f
'hg serve' is not sufficient, if the command line is something like 'hg -R main
serve')

diff -r 6e9e1deb1152 -r b5ceffcc0e92 tests/run-tests.py
--- a/tests/run-tests.py	Mon Oct 06 14:52:19 2014 -0700
+++ b/tests/run-tests.py	Thu Oct 09 17:00:29 2014 -0700
@@ -1235,10 +1235,12 @@
             os.system("%s %s %s" %
                       (self._options.view, test.refpath, test.errpath))
         else:
-            failed, lines = getdiff(expected, got,
-                                    test.refpath, test.errpath)
-            if failed:
-                self.addFailure(test, 'diff generation failed')
+            servefail, lines = getdiff(expected, got,
+                                       test.refpath, test.errpath)
+            if servefail:
+                self.addFailure(
+                    test,
+                    'server failed to start (HGPORT=%s)' % test._startport)
             else:
                 self.stream.write('\n')
                 for line in lines:


More information about the Mercurial-devel mailing list