resultsdb_directive raises an exception when check_detail is missing data
ClosedPublic

Authored by jskladan on Apr 7 2015, 1:51 PM.

Details

Summary

resultsdb_directive now checks the CheckDetails produced from the TAP given on input
it the CheckDetails miss either item or report_type (meaning, that the values are set
to 'non-True-like'), proper exception is raised

Test Plan

unittests work

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.
jskladan retitled this revision from to resultsdb_directive raises an exception when check_detail is missing data.Apr 7 2015, 1:51 PM
jskladan updated this object.
jskladan edited the test plan for this revision. (Show Details)
jskladan added reviewers: kparal, tflink, mkrizek.
kparal accepted this revision.Apr 7 2015, 2:26 PM

LGTM, but please adjust the documentation before pushing.

libtaskotron/directives/resultsdb_directive.py
33–34

This should be amended to also mention that we raise this if certain yaml keys (let's name them) are missing.

163

I guess we should change this to

TAP output parses OK

Otherwise we claim that TAP is OK on one line, and then immediately fail on the next line saying that e.g. 'item' is missing.

testing/test_resultsdb_directive.py
101–105

Alternatively,

tap = '\n'.join([line for line in self.ref_input['results'].splitlines() if 'item:' not in line])

However, not sure if that's more readable :)

This revision is now accepted and ready to land.Apr 7 2015, 2:26 PM
jskladan updated this revision to Diff 895.Apr 7 2015, 2:34 PM
  • Fixed according to review
mkrizek accepted this revision.Apr 8 2015, 6:09 AM
This revision was automatically updated to reflect the committed changes.