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

Augie Fackler raf at durin42.com
Fri Oct 10 08:30:10 CDT 2014


On Thu, Oct 09, 2014 at 05:22:55PM -0700, Kyle Lippincott wrote:
> # 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"

I've been meaning to investigate that. Queued, thanks.

>
> 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:
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list