[PATCH 1 of 5] run-tests: when building json, use result.failures instead of result.faildata

Martin von Zweigbergk martinvonz at google.com
Fri May 8 18:23:30 CDT 2015


On Fri, May 8, 2015 at 11:54 AM Pierre-Yves David <
pierre-yves.david at ens-lyon.org> wrote:

> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at fb.com>
> # Date 1431066024 25200
> #      Thu May 07 23:20:24 2015 -0700
> # Node ID dccc3de8c055f386a1dbfe72e86091251dbd0b50
> # Parent  c25b2adb3664cd3c488e2c53aab0c64100d40af7
> run-tests: when building json, use result.failures instead of
> result.faildata
>
> It is unclear to me why 'faildata' was used. Lets use the same kind of
> attribute
> as for the other groups.
>

I think this needs to be described better. They don't seem to be
equivalent. For example, "faildata" is not populated with failures that
were accepted in interactive mode. addFailure(), which adds to "failures",
is called from two places and I know too little to understand what kinds of
failures would be added in each place and whether the same errors would be
added to "faildata"


>
> diff --git a/tests/run-tests.py b/tests/run-tests.py
> --- a/tests/run-tests.py
> +++ b/tests/run-tests.py
> @@ -1535,16 +1535,16 @@ class TextTestRunner(unittest.TextTestRu
>                                    'time': ('%0.3f' % timesd[tc.name][0]),
>                                    'cuser': ('%0.3f' % timesd[tc.name
> ][1]),
>                                    'csys': ('%0.3f' % timesd[tc.name][2])}
>                      outcome[tc.name] = testresult
>
> -                for tc, err in sorted(result.faildata.iteritems()):
> +                for tc, error in result.failures:
>                      testresult = {'result': 'failure',
> -                                  'time': ('%0.3f' % timesd[tc][0]),
> -                                  'cuser': ('%0.3f' % timesd[tc][1]),
> -                                  'csys': ('%0.3f' % timesd[tc][2])}
> -                    outcome[tc] = testresult
> +                                  'time': ('%0.3f' % timesd[tc.name][0]),
> +                                  'cuser': ('%0.3f' % timesd[tc.name
> ][1]),
> +                                  'csys': ('%0.3f' % timesd[tc.name][2])}
> +                    outcome[tc.name] = testresult
>
>                  for tc, reason in result.skipped:
>                      testresult = {'result': 'skip',
>                                    'time': ('%0.3f' % timesd[tc.name][0]),
>                                    'cuser': ('%0.3f' % timesd[tc.name
> ][1]),
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20150508/cc3ed5e7/attachment.html>


More information about the Mercurial-devel mailing list