[Piglit] [PATCH 0/3] Decouple JSON loading and python classes

Dylan Baker dylan at pnwbakers.com
Tue Oct 11 00:06:51 UTC 2016


Currently piglit's JSON format loading is tightly integrated with it's class
representations of result data. This has the advantage of reducing code
duplication, and making it easy to ensure that all data is correctly translated
to it's types. However, there is a drawback, the tight coupling makes changing
the JSON format difficult, and small changes have a tendency to break things.

This rather small series decouples the internal representation and the JSON
representation, which will allow makes changes to the format easier, but it does
have a bit of a cost: it drops support for older JSON results formats. This may
not be a big deal, most of these formats were quite old, and none of them had
formal schemas, but they may still exist.

I can add some of the formats back if they're really needed, but I like the fact
that getting rid of them removes 1000 lines of code from piglit.

This is available at my github:
https://github.com/dcbaker/piglit wip/detangle-json-load

Dylan Baker (3):
  framework/backends/json: replace str() with six.text_type()
  framework: Drop support for JSON formats < 7
  framework/backends/json: Don't convert to TestrunResult while updating

 framework/backends/json.py                       | 299 +--------
 unittests/framework/backends/test_json.py        |  16 +-
 unittests/framework/backends/test_json_update.py | 791 +----------------------
 3 files changed, 55 insertions(+), 1051 deletions(-)

-- 
2.10.0



More information about the Piglit mailing list