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

Imported test metadata should be stored in a reasonable order #86

Closed
psss opened this issue Jan 21, 2020 · 3 comments · Fixed by #192
Closed

Imported test metadata should be stored in a reasonable order #86

psss opened this issue Jan 21, 2020 · 3 comments · Fixed by #192
Assignees
Labels
command | import The import command

Comments

@psss
Copy link
Collaborator

psss commented Jan 21, 2020

Currently tmt test convert stores yaml keys in random order. It would be nice to store the information in a way which is pleasant for user to read. For example summary, if present, should be the first. Implementation should be relatively easy using an OrderedDict.

The proposed order of the L1 Metadata keys:

  • summary
  • description
  • contact
  • test
  • path
  • duration
  • environment
  • tag
  • tier
  • component
  • relevancy
  • enabled
  • result
@psss
Copy link
Collaborator Author

psss commented Jan 21, 2020

@hegerj, this might be an interesting stuff for you.

@psss psss added enhancement command | import The import command labels Jan 21, 2020
@hegerj
Copy link
Collaborator

hegerj commented Jan 23, 2020

"Changed in version 3.7: Dictionary order is guaranteed to be insertion order. This behavior was an implementation detail of CPython from 3.6."
https://docs.python.org/3.7/library/stdtypes.html#dict

Should I then bother with OrderedDict given the yaml.dump() issue?

@psss
Copy link
Collaborator Author

psss commented Jan 29, 2020

Seems the yaml.dump() method supports sort_keys=False parameter. So the only thing we need is to disable sorting and put the keys in the dictionary in the right order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
command | import The import command
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants