Bug 547665 - [RFE] option for rlRun output to the log only when it fails
[RFE] option for rlRun output to the log only when it fails
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: beakerlib (Show other bugs)
rawhide
All Linux
low Severity low
: ---
: ---
Assigned To: Jan Hutař
: Patch
Depends On:
Blocks: 893053
  Show dependency treegraph
 
Reported: 2009-12-15 06:04 EST by Jan Hutař
Modified: 2013-06-27 12:33 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 893053 (view as bug list)
Environment:
Last Closed: 2013-06-27 12:33:00 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Added -c option for rlRun and tests for that (4.32 KB, patch)
2009-12-15 07:08 EST, Jan Hutař
no flags Details | Diff
Series of patches to implement bug 547665 (8.43 KB, patch)
2011-07-18 07:34 EDT, Jan Hutař
no flags Details | Diff
Add -c option to rlRun and unit-tests for it (10.24 KB, patch)
2011-07-18 07:50 EDT, Jan Hutař
no flags Details | Diff
rlRun logging limit, improvements and test cleanup (5.60 KB, patch)
2011-07-22 13:00 EDT, Petr Muller
no flags Details | Diff

  None (edit)
Description Jan Hutař 2009-12-15 06:04:12 EST
Description of problem:
As rlRun now have -l option, it would be nice to have it's variant, something like -c (conditionaly) to include output only when command executed by rlRun fails.


Version-Release number of selected component (if applicable):
beaker-lib-0.4.64-0.el5.noarch


Steps to Reproduce:
1. rlRun -c "blablabla"


Expected results:
If command failed, include output as with -l.


Additional info:
This will not add so big amount of data to journal as -l.
Comment 1 Jan Hutař 2009-12-15 07:08:36 EST
Created attachment 378483 [details]
Added -c option for rlRun and tests for that
Comment 2 Jan Hutař 2009-12-15 07:38:37 EST
Fixing bug state.
Comment 3 Petr Muller 2011-04-29 10:25:50 EDT
I like the idea (it's a pity this was overlooked for so long), but the patch no longer applies. I've removed "Patch" keyword, I'll implement this in the next iteration if anything applying is not submitted again.
Comment 4 Jan Hutař 2011-07-18 07:34:51 EDT
Created attachment 513599 [details]
Series of patches to implement bug 547665
Comment 5 Jan Hutař 2011-07-18 07:50:19 EDT
Created attachment 513601 [details]
Add -c option to rlRun and unit-tests for it
Comment 6 Jan Hutař 2011-07-18 07:51:08 EDT
Re-implemented against current git and added nice tests.
Comment 7 Petr Muller 2011-07-22 12:59:39 EDT
Reviewed and tested a bit, good to go. Thanks!

I've did some follow-up work when testing this change: I've imposed a 50 line limit on the outputs (last 50 lines are logged) to avoid having huge logs in the journal: large logs should be analysed in separated files. The size of the limit is open to discussion, the existence of it is not :)

Additionally, I've changed the way how the lines are logged, and cleaned some tests up.

Previous result:
rlRun -c 'notexists', during execution:
gcc: error: notexists: No such file or directory
gcc: fatal error: no input files
compilation terminated.
:: [18:56:48] :: [ INFO    ] :: rlRun: command = 'gcc notexists'; exitcode = 4; expected = 0
:: [18:56:48] ::  gcc notexists
gcc: error: notexists: No such file or directory
gcc: fatal error: no input files
compilation terminated.
:: [   FAIL   ] :: Running 'gcc notexists' (Expected 0, got 4)

rlRun -c 'notexists', in rlJournalPrintText:
:: [   INFO   ] :: rlRun: command = 'gcc notexists'; exitcode = 4; expected = 0
:: [   LOG    ] :: gcc notexists\ngcc: error: notexists: No such file or directory
:: [   LOG    ] :: gcc: fatal error: no input files
:: [   LOG    ] :: compilation terminated.
:: [   FAIL   ] :: Running 'gcc notexists' (Expected 0, got 4)


New result:
rlRun -c 'notexists', during execution:
gcc: error: notexists: No such file or directory
gcc: fatal error: no input files
compilation terminated.
:: [18:58:25] :: [ INFO    ] :: rlRun: command = 'gcc notexists'; exitcode = 4; expected = 0
:: [18:58:26] ::  Output of 'gcc notexists':
:: [18:58:26] ::  --------------- OUTPUT START ---------------
:: [18:58:26] ::  gcc: error: notexists: No such file or directory
:: [18:58:26] ::  gcc: fatal error: no input files
:: [18:58:26] ::  compilation terminated.
:: [18:58:26] ::  ---------------  OUTPUT END  ---------------
:: [   FAIL   ] :: Running 'gcc notexists' (Expected 0, got 4)

rlRun -c 'notexists', in rlJournalPrintText:
:: [   INFO   ] :: rlRun: command = 'gcc notexists'; exitcode = 4; expected = 0
:: [   LOG    ] :: Output of 'gcc notexists':
:: [   LOG    ] :: --------------- OUTPUT START ---------------
:: [   LOG    ] :: gcc: error: notexists: No such file or directory
:: [   LOG    ] :: gcc: fatal error: no input files
:: [   LOG    ] :: compilation terminated.
:: [   LOG    ] :: ---------------  OUTPUT END  ---------------
:: [   FAIL   ] :: Running 'gcc notexists' (Expected 0, got 4)
Comment 8 Petr Muller 2011-07-22 13:00:48 EDT
Created attachment 514744 [details]
rlRun logging limit, improvements and test cleanup
Comment 12 Petr Muller 2013-01-08 09:24:17 EST
beakerlib-1.6-1 is already in fedora

Note You need to log in before you can comment on or make changes to this bug.