improve task output handling on stdout
ClosedPublic

Authored by kparal on Aug 15 2014, 11:55 AM.

Details

Summary

Improve discoverability of what would get reported to ResultsDB. Change
the format to TAP. Add some helpful suggestions. Stop printing all
exported variables' values by default, only with --debug.

Test Plan

test suite works. I'm not sure if I need to add a new unit test, this is just a logging feature, there is no functional meaning in it.

Diff Detail

Repository
rLTRN libtaskotron
Lint
Lint Skipped
Unit
Unit Tests Skipped
kparal retitled this revision from to improve task output handling on stdout.Aug 15 2014, 11:55 AM
kparal updated this object.
kparal edited the test plan for this revision. (Show Details)
kparal added reviewers: tflink, mkrizek, jskladan, lbrabec.

Before:

$ runtask -i xchat-2.8.8-21.fc20 -t koji_build -a x86_64 ../task-rpmlint/rpmlint.yml 
[libtaskotron:runner.py:226] 2014-08-15 13:46:34 DEBUG   Parsed arguments: Namespace(arch=['x86_64'], debug=False, item='xchat-2.8.8-21.fc20', jobid='-1', override=[], task=['../task-rpmlint/rpmlint.yml'], type='koji_build')
[libtaskotron:config.py:93] 2014-08-15 13:46:34 DEBUG   Using config file: /etc/taskotron/taskotron.yaml
[libtaskotron:config.py:64] 2014-08-15 13:46:34 DEBUG   Using config profile: development
[libtaskotron:koji_directive.py:133] 2014-08-15 13:46:34 INFO    Getting RPMs for koji build xchat-2.8.8-21.fc20 (['x86_64', 'noarch']) and downloading to /var/tmp/taskotron/task-Q4z0kB
[libtaskotron:koji_utils.py:116] 2014-08-15 13:46:34 INFO    Querying Koji for a list of RPMS for: xchat-2.8.8-21.fc20
[libtaskotron:koji_utils.py:166] 2014-08-15 13:46:35 INFO    Fetching 2 RPMs for: xchat-2.8.8-21.fc20
xchat-2.8.8-21.fc20.x86_64.rpm                                                                                                                                                              | 952 kB  00:00:08     
xchat-tcl-2.8.8-21.fc20.x86_64.rpm                                                                                                                                                          |  48 kB  00:00:00     
[libtaskotron:python_directive.py:154] 2014-08-15 13:46:44 INFO    Executing Python: run_rpmlint.run() with args {'workdir': '/var/tmp/taskotron/task-Q4z0kB'}
[libtaskotron:resultsdb_directive.py:167] 2014-08-15 13:46:48 INFO    TAP is OK.
[libtaskotron:resultsdb_directive.py:168] 2014-08-15 13:46:48 INFO    Reporting to ResultsDB is disabled.
[libtaskotron:resultsdb_directive.py:169] 2014-08-15 13:46:48 INFO    Once enabled, the following would be reported:
[libtaskotron:resultsdb_directive.py:170] 2014-08-15 13:46:48 INFO    <CheckDetail: {'_outcome': 'PASSED',
 'item': 'xchat-2.8.8-21.fc20.x86_64.rpm',
 'keyvals': {},
 'output': '<stripped out>',
 'report_type': 'koji_build',
 'summary': 'RPMLINT PASSED for xchat-2.8.8-21.fc20.x86_64.rpm'}>
<CheckDetail: {'_outcome': 'PASSED',
 'item': 'xchat-tcl-2.8.8-21.fc20.x86_64.rpm',
 'keyvals': {},
 'output': '<stripped out>',
 'report_type': 'koji_build',
 'summary': 'RPMLINT PASSED for xchat-tcl-2.8.8-21.fc20.x86_64.rpm'}>
[libtaskotron:runner.py:245] 2014-08-15 13:46:48 INFO    Check execution finished. Showing stored variables:
[libtaskotron:runner.py:247] 2014-08-15 13:46:48 INFO    ${rpmlint_output}:
TAP version 13
1..2
ok - $CHECKNAME for Koji build xchat-2.8.8-21.fc20.x86_64.rpm
  ---
  details:
    output: |
      xchat.x86_64: W: file-not-utf8 /usr/share/doc/xchat/ChangeLog
      xchat.x86_64: W: non-conffile-in-etc /etc/gconf/schemas/apps_xchat_url_handler.schemas
      xchat.x86_64: W: no-manual-page-for-binary xchat
      1 packages and 0 specfiles checked; 0 errors, 3 warnings.
  item: xchat-2.8.8-21.fc20.x86_64.rpm
  outcome: PASSED
  summary: RPMLINT PASSED for xchat-2.8.8-21.fc20.x86_64.rpm
  type: koji_build
  ...
ok - $CHECKNAME for Koji build xchat-tcl-2.8.8-21.fc20.x86_64.rpm
  ---
  details:
    output: |
      xchat-tcl.x86_64: W: no-documentation
      1 packages and 0 specfiles checked; 0 errors, 1 warnings.
  item: xchat-tcl-2.8.8-21.fc20.x86_64.rpm
  outcome: PASSED
  summary: RPMLINT PASSED for xchat-tcl-2.8.8-21.fc20.x86_64.rpm
  type: koji_build
  ...

After:

$ runtask -i xchat-2.8.8-21.fc20 -t koji_build -a x86_64 ../task-rpmlint/rpmlint.yml 
[libtaskotron:runner.py:228] 2014-08-15 13:47:12 DEBUG   Parsed arguments: Namespace(arch=['x86_64'], debug=False, item='xchat-2.8.8-21.fc20', jobid='-1', override=[], task=['../task-rpmlint/rpmlint.yml'], type='koji_build')
[libtaskotron:config.py:93] 2014-08-15 13:47:12 DEBUG   Using config file: /etc/taskotron/taskotron.yaml
[libtaskotron:config.py:64] 2014-08-15 13:47:12 DEBUG   Using config profile: development
[libtaskotron:koji_directive.py:133] 2014-08-15 13:47:12 INFO    Getting RPMs for koji build xchat-2.8.8-21.fc20 (['x86_64', 'noarch']) and downloading to /var/tmp/taskotron/task-47eAmp
[libtaskotron:koji_utils.py:116] 2014-08-15 13:47:12 INFO    Querying Koji for a list of RPMS for: xchat-2.8.8-21.fc20
[libtaskotron:koji_utils.py:166] 2014-08-15 13:47:13 INFO    Fetching 2 RPMs for: xchat-2.8.8-21.fc20
xchat-2.8.8-21.fc20.x86_64.rpm                                                                                                                                                              | 952 kB  00:00:04     
xchat-tcl-2.8.8-21.fc20.x86_64.rpm                                                                                                                                                          |  48 kB  00:00:00     
[libtaskotron:python_directive.py:154] 2014-08-15 13:47:18 INFO    Executing Python: run_rpmlint.run() with args {'workdir': '/var/tmp/taskotron/task-47eAmp'}
[libtaskotron:resultsdb_directive.py:170] 2014-08-15 13:47:21 INFO    Reporting to ResultsDB is disabled. Once enabled, the following would get reported:
ok - rpmlint for Koji build xchat-2.8.8-21.fc20.x86_64.rpm
  ---
  details:
    output: |-
      xchat.x86_64: W: file-not-utf8 /usr/share/doc/xchat/ChangeLog
      <stripped out>
      1 packages and 0 specfiles checked; 0 errors, 3 warnings.
  item: xchat-2.8.8-21.fc20.x86_64.rpm
  outcome: PASSED
  summary: RPMLINT PASSED for xchat-2.8.8-21.fc20.x86_64.rpm
  type: koji_build
  ...
ok - rpmlint for Koji build xchat-tcl-2.8.8-21.fc20.x86_64.rpm
  ---
  details:
    output: |
      xchat-tcl.x86_64: W: no-documentation
      1 packages and 0 specfiles checked; 0 errors, 1 warnings.
  item: xchat-tcl-2.8.8-21.fc20.x86_64.rpm
  outcome: PASSED
  summary: RPMLINT PASSED for xchat-tcl-2.8.8-21.fc20.x86_64.rpm
  type: koji_build
  ...
[libtaskotron:resultsdb_directive.py:171] 2014-08-15 13:47:21 INFO    Hint: Enabling debug output allows you to see unstripped values during variable export.
[libtaskotron:runner.py:247] 2014-08-15 13:47:21 INFO    Check execution finished.

If you use --debug, you see the full variable output during export directive.

This revision is now accepted and ready to land.Aug 15 2014, 12:03 PM
tflink accepted this revision.Aug 15 2014, 12:37 PM
kparal closed this revision.Aug 15 2014, 12:48 PM
kparal updated this revision to Diff 598.

Closed by commit rLTRN71202f3aaf67 (authored by @kparal).