Skip to content

Commit

Permalink
sort keys in test output json
Browse files Browse the repository at this point in the history
  • Loading branch information
grybmadsci committed Feb 10, 2016
1 parent dab5673 commit 2442146
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/io/output/output_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(self, unittest_name):
dimensions, test_name='TestTest', test_description='Unittest test',
test_version='1.0.0')
self.test.AddOutputCallback(_ReplaceStartEndTimes(OutputToJSON(
os.path.join(self.tempdir, 'record.json'))))
os.path.join(self.tempdir, 'record.json'), sort_keys=True)))
self.test.AddOutputCallback(_ReplaceStartEndTimes(
output.OutputToTestRunProto(
os.path.join(self.tempdir, 'record.testrun'))))
Expand Down
2 changes: 1 addition & 1 deletion test/io/output/record.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"phases": [{"code": "@measures(\n Measurement('measurement'),\n Measurement('dimensions').WithDimensions(UOM['HERTZ']))\ndef dimensions(test):\n test.measurements.measurement = 1\n for dim in range(5):\n test.measurements.dimensions[dim] = 1 << dim\n test.Attach('test_attachment', 'This is test attachment data.')\n", "start_time_millis": "12345", "name": "dimensions", "measured_values": {"dimensions": [["0", "1"], ["1", "2"], ["2", "4"], ["3", "8"], ["4", "16"]], "measurement": "1"}, "measurements": {"dimensions": {"outcome": "PASS", "name": "dimensions", "dimensions": [{"uom_suffix": "Hz", "uom_code": "HTZ"}]}, "measurement": {"outcome": "PASS", "name": "measurement"}}, "end_time_millis": "67891", "result": {"raised_exception": "False", "phase_result": "RESULT_CONTINUE"}, "attachments": {"test_attachment": {"mimetype": null, "data": "This is test attachment data."}}}], "start_time_millis": "12344", "outcome_details": [], "end_time_millis": "67892", "station_id": "unittest_openhtf", "dut_id": "UNKNOWN_DUT_ID", "log_records": [{"timestamp_millis": "12346", "level": "10", "source": "test_state.py", "lineno": "152", "message": "Finishing test execution with state State.PASS.", "logger_name": "output_test.py"}], "outcome": "State.PASS", "metadata": {"filename": "output_test.py", "test_name": "TestTest", "docstring": "Unit tests for the openhtf.io.output module.", "test_version": "1.0.0", "test_description": "Unittest test"}}
{"dut_id": "UNKNOWN_DUT_ID", "end_time_millis": "67892", "log_records": [{"level": "10", "lineno": "152", "logger_name": "output_test.py", "message": "Finishing test execution with state State.PASS.", "source": "test_state.py", "timestamp_millis": "12346"}], "metadata": {"docstring": "Unit tests for the openhtf.io.output module.", "filename": "output_test.py", "test_description": "Unittest test", "test_name": "TestTest", "test_version": "1.0.0"}, "outcome": "State.PASS", "outcome_details": [], "phases": [{"attachments": {"test_attachment": {"data": "This is test attachment data.", "mimetype": null}}, "code": "@measures(\n Measurement('measurement'),\n Measurement('dimensions').WithDimensions(UOM['HERTZ']))\ndef dimensions(test):\n test.measurements.measurement = 1\n for dim in range(5):\n test.measurements.dimensions[dim] = 1 << dim\n test.Attach('test_attachment', 'This is test attachment data.')\n", "end_time_millis": "67891", "measured_values": {"dimensions": [["0", "1"], ["1", "2"], ["2", "4"], ["3", "8"], ["4", "16"]], "measurement": "1"}, "measurements": {"dimensions": {"dimensions": [{"uom_code": "HTZ", "uom_suffix": "Hz"}], "name": "dimensions", "outcome": "PASS"}, "measurement": {"name": "measurement", "outcome": "PASS"}}, "name": "dimensions", "result": {"phase_result": "RESULT_CONTINUE", "raised_exception": "False"}, "start_time_millis": "12345"}], "start_time_millis": "12344", "station_id": "unittest_openhtf"}

0 comments on commit 2442146

Please sign in to comment.