Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include test metadata in the results.json file #5336

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions toolset/utils/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,12 @@ def parse_config(self, config, directory):

return tests

def list_test_metadata(self):
def to_jsonable(self):
'''
Prints the metadata for all the available tests
Returns an array suitable for jsonification
'''
all_tests = self.gather_tests()
all_tests_json = json.dumps(map(lambda test: {
return map(lambda test: {
"project_name": test.project_name,
"name": test.name,
"approach": test.approach,
Expand All @@ -256,7 +256,13 @@ def list_test_metadata(self):
"notes": test.notes,
"versus": test.versus,
"tags": hasattr(test, "tags") and test.tags or []
}, all_tests))
}, all_tests)

def list_test_metadata(self):
'''
Prints the metadata for all the available tests
'''
all_tests_json = json.dumps(self.to_jsonable())

with open(
os.path.join(self.benchmarker.results.directory,
Expand Down
1 change: 1 addition & 0 deletions toolset/utils/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ def __to_jsonable(self):
toRet['succeeded'] = self.succeeded
toRet['failed'] = self.failed
toRet['verify'] = self.verify
toRet['test_metadata'] = self.benchmarker.metadata.to_jsonable()

return toRet

Expand Down