Skip to content

Commit

Permalink
Sync more extra-* attributes when exporting [psss#199]
Browse files Browse the repository at this point in the history
Attributes 'extra-summary' and 'extra-task' are now synced as well
when exporting to nitrate. Docs updated.
  • Loading branch information
hegerj committed Apr 9, 2020
1 parent fb2a467 commit e598e1e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/questions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ The following attributes, if present, are exported as well:

* extra-hardware — hardware in the structured field
* extra-pepa — pepa in the structured field
* extra-summary — Nitrate test case summary
* extra-task — Nitrate test case script

They have the ``extra`` prefix as they are not part of the L1
Metadata Specification and are supposed to be synced temporarily
Expand Down
13 changes: 13 additions & 0 deletions tmt/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,19 @@ def export_to_nitrate(test, create):
else:
raise ConvertError("Nitrate test case id not found.")

# Summary
summary = test.node.get('extra-summary', test.summary)
if summary:
nitrate_case.summary = summary
echo(style('summary: ', fg='green') + summary)
else:
raise ConvertError("Nitrate case summary could not be determined.")

# Script
if test.node.get('extra-task'):
nitrate_case.script = test.node.get('extra-task')
echo(style('script: ', fg='green') + test.node.get('extra-task'))

# Components
# First remove any components that are already there
nitrate_case.components.clear()
Expand Down

0 comments on commit e598e1e

Please sign in to comment.