resultsdb_directive: always return TAP
ClosedPublic

Authored by kparal on Jul 3 2015, 3:39 PM.

Details

Summary

In 39a62f7a1 we started relying on exporting the output from
resultsdb_directive and forwarding it to other directives
(bodhi_comments_directive). That breaks if reporting to ResultsDB is
disabled. This patch fixes that.

Test Plan

test suite works, and my manual task execution as well (with bodhi comments enabled, but resultsdb reporting disabled)

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.
kparal retitled this revision from to resultsdb_directive: always return TAP.Jul 3 2015, 3:39 PM
kparal updated this object.
kparal edited the test plan for this revision. (Show Details)
kparal added reviewers: jskladan, mkrizek, tflink, lbrabec.
tflink added a comment.Jul 7 2015, 3:53 AM

Looks like it'll work but wouldn't it be better if we replicated the return statement that's used if resultsdb reporting is enabled instead of doing something different? The check detail objects aren't altered during the reporting process and they're already constructed bythe time that we get to the return statements

libtaskotron/directives/resultsdb_directive.py
211

Why return the input data here instead of replicating the return check.export_TAP(check_details) call that's made if resultsdb reporting is enabled?

kparal added inline comments.Jul 7 2015, 10:22 AM
libtaskotron/directives/resultsdb_directive.py
211

My original (very quick) thought was that when reporting is disabled, I'd return the raw unaltered input data, behaving as a "no-op" operation. If I import and re-export TAP, I'll return different data (reordered, reformatted, unknown fields ignored). I'd be basically sanitizing the data to some extent.

But thinking about it more, it's probably somewhat weird for this directive to return sometimes raw input content, and sometimes sanitized content, depending on results having been reported or not. Consistent output behavior (sans the result id field) seems like a better thing to do. Good point. I'll adjust accordingly.

kparal updated this revision to Diff 1106.Jul 7 2015, 10:56 AM

change according to @tflink's comments

tflink accepted this revision.Jul 8 2015, 4:14 AM
This revision is now accepted and ready to land.Jul 8 2015, 4:14 AM
This revision was automatically updated to reflect the committed changes.