Adds a file parameter to the resultsdb_directive that allows for it to
read the input data from file, instead of the results variable
Details
- Reviewers
kparal - Group Reviewers
libtaskotron - Maniphest Tasks
- T819: ResultsDB directive should be able to read results from file
- Commits
- rLTRNd9b7a64c5b9a: Allow resultsdb_directive to read from file
added unittests
Diff Detail
- Repository
- rLTRN libtaskotron
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
libtaskotron/directives/resultsdb_directive.py | ||
---|---|---|
25 | Would this be clearer? You must use either ``results`` or ``file`` parameter (exactly one). | |
77 | on on | |
77–85 | This seems to be part of the first example (the first two directives), but it's a separate example. Let's put a new paragraph between the first two and the second two directives. Let's say something like "Read ResultsYAML from a file, as saved by a bash check". | |
84 | Typo. But actually, do we need to export the output? I think we used it for Bodhi reporting in the past, now we don't need it at all? Maybe we can strip it from the examples. | |
262–263 | Would it make sense to wrap this as well and raise TaskotronDirectiveError for IO errors? Or do we want to raise them directly (maybe document them then)? | |
268–269 | Maybe get rid of the apostrophes in the message, because this is going to be printed even for file: now. | |
testing/test_resultsdb_directive.py | ||
183–184 | This makes me very uneasy. Why we need to mock builtin open? That's a big freaking hammer. Would it be better to use pytest's tmpdir, as we use it in functest_yumrepoinfo_directive.py, to create a fake file with predefined contents (therefore ideally put it into functest_resultsdb_directive)? |
apart of the open mock, I agree, will fix asap.
testing/test_resultsdb_directive.py | ||
---|---|---|
183–184 | Taken from xunit directive, tbh. I don't really see the problem of mocking open(), though, feels even cleaner than creating fake files to me. |
libtaskotron/directives/resultsdb_directive.py | ||
---|---|---|
258–259 | Also, please add this to raises: in documentation, thanks. |
Would this be clearer?