Skip to content

Commit

Permalink
maintain the right client/server order while writing out the test res…
Browse files Browse the repository at this point in the history
…ults as JSON (#391)
  • Loading branch information
jaikiran authored May 24, 2024
1 parent 6a49890 commit 601c9fc
Showing 1 changed file with 29 additions and 28 deletions.
57 changes: 29 additions & 28 deletions interop.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,35 +306,36 @@ def _export_results(self):
"measurements": [],
}

for client, server in self._client_server_pairs:
results = []
for test in self._tests:
r = None
if hasattr(self.test_results[server][client][test], "value"):
r = self.test_results[server][client][test].value
results.append(
{
"abbr": test.abbreviation(),
"name": test.name(), # TODO: remove
"result": r,
}
)
out["results"].append(results)
for client in clients:
for server in servers:
results = []
for test in self._tests:
r = None
if hasattr(self.test_results[server][client][test], "value"):
r = self.test_results[server][client][test].value
results.append(
{
"abbr": test.abbreviation(),
"name": test.name(), # TODO: remove
"result": r,
}
)
out["results"].append(results)

measurements = []
for measurement in self._measurements:
res = self.measurement_results[server][client][measurement]
if not hasattr(res, "result"):
continue
measurements.append(
{
"name": measurement.name(), # TODO: remove
"abbr": measurement.abbreviation(),
"result": res.result.value,
"details": res.details,
}
)
out["measurements"].append(measurements)
measurements = []
for measurement in self._measurements:
res = self.measurement_results[server][client][measurement]
if not hasattr(res, "result"):
continue
measurements.append(
{
"name": measurement.name(), # TODO: remove
"abbr": measurement.abbreviation(),
"result": res.result.value,
"details": res.details,
}
)
out["measurements"].append(measurements)

f = open(self._output, "w")
json.dump(out, f)
Expand Down

0 comments on commit 601c9fc

Please sign in to comment.