Bug 547665 - [RFE] option for rlRun output to the log only when it fails
Summary: [RFE] option for rlRun output to the log only when it fails
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: beakerlib
Version: rawhide
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Jan Hutař
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 893053
TreeView+ depends on / blocked
 
Reported: 2009-12-15 11:04 UTC by Jan Hutař
Modified: 2013-06-27 16:33 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 893053 (view as bug list)
Environment:
Last Closed: 2013-06-27 16:33:00 UTC
Type: ---
Embargoed:


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

Description Jan Hutař 2009-12-15 11:04:12 UTC
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 12:08:36 UTC
Created attachment 378483 [details]
Added -c option for rlRun and tests for that

Comment 2 Jan Hutař 2009-12-15 12:38:37 UTC
Fixing bug state.

Comment 3 Petr Muller 2011-04-29 14:25:50 UTC
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 11:34:51 UTC
Created attachment 513599 [details]
Series of patches to implement bug 547665

Comment 5 Jan Hutař 2011-07-18 11:50:19 UTC
Created attachment 513601 [details]
Add -c option to rlRun and unit-tests for it

Comment 6 Jan Hutař 2011-07-18 11:51:08 UTC
Re-implemented against current git and added nice tests.

Comment 7 Petr Muller 2011-07-22 16:59:39 UTC
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 17:00:48 UTC
Created attachment 514744 [details]
rlRun logging limit, improvements and test cleanup

Comment 12 Petr Muller 2013-01-08 14:24:17 UTC
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.