[PATCH] run-tests: added '--graph' functionality to store timing data in json file

Gregory Szorc gregory.szorc at gmail.com
Mon Jun 16 15:52:47 CDT 2014


On 6/16/14, 12:55 PM, Anurag Goel wrote:
> # HG changeset patch
> # User anuraggoel <anurag.dsps at gmail.com>
> # Date 1402941179 -19800
> #      Mon Jun 16 23:22:59 2014 +0530
> # Node ID c3dacef6c7c12ec1f3a0879af4a28dd72e4ac53b
> # Parent  477bc39f2d88a7d38127a3509d3d85cc9b62faee
> run-tests: added '--graph' functionality to store timing data in json file
>
> This patch added a new functionality '--graph'. While testing, if '--graph'
> is enabled then timing data gets stored in newly created "report.json" file,
> in the format of "testname : testtime".
>
> This "report.json" file will further accessed by html/javascript file to
> plot graph between testname Vs testime.
>
> diff -r 477bc39f2d88 -r c3dacef6c7c1 tests/run-tests.py
> --- a/tests/run-tests.py	Fri Jun 13 14:45:23 2014 +0530
> +++ b/tests/run-tests.py	Mon Jun 16 23:22:59 2014 +0530
> @@ -58,6 +58,7 @@
>   import killdaemons as killmod
>   import Queue as queue
>   import unittest
> +import json

Unfortunately, json was added in Python 2.6. simplejson is commonly used 
as a drop-in replacement for json. Do we want to create a test-only 
dependency? W'd have to pin an old version of simplejson, as modern 
versions dropped 2.4 compatibility.


More information about the Mercurial-devel mailing list