Bug 1386769 - [RFE] rlAssertNotDiffer verbose output if files differ
Summary: [RFE] rlAssertNotDiffer verbose output if files differ
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: beakerlib
Version: rawhide
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: ---
Assignee: Dalibor Pospíšil
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-19 15:22 UTC by David Jež
Modified: 2018-01-29 23:55 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug


Attachments (Terms of Use)

Description David Jež 2016-10-19 15:22:51 UTC
Hi,

In case that files are differ output of rlAssertNotDiffer seems like:
:: [   FAIL   ] :: Files reproducer.expected and output should not differ

which says nothing and it then is really hard to debug what is wrong. So now I temporary use following code in the test which print diff output if files are differ or nothing if files are same:

rlAssertNotDiffer expected.txt output.txt || rlLogWarning "$(diff -u
expected.txt output.txt)"

it would be nice add this verbose output to rlAssertNotDiffer function.

Thanks,
DJ

Comment 1 Dalibor Pospíšil 2016-10-19 19:20:55 UTC
The files can also be kind of binary so the diff should not be printed by default. I propose adding an option which would cause the output to be printed.

Comment 2 David Jež 2016-10-21 08:58:47 UTC
I can not see any problem with binaries, AFAIK diff -u never print any binary output, see e.g.:

$ diff -u David.jpg Image.ashx.jpg
Binary files David.jpg and Image.ashx.jpg differ

$

But in some case output could be really long... So add an option like -v for '... diff | head -200 ' and -vv for diff without head or something like that would be OK.

Comment 3 Dalibor Pospíšil 2016-10-21 10:15:39 UTC
(In reply to David Jež from comment #2)
> But in some case output could be really long... So add an option like -v for
> '... diff | head -200 ' and -vv for diff without head or something like that
> would be OK.

This sound reasonable to me.

Lets wait for others to express their acks.

Comment 4 Ales Zelinka 2016-10-21 13:23:39 UTC
Personally I've always considered rlAssert*Diff to be useless, not having any advantage over rlRun "diff ...". So adding few more useful features to it would, in my eyes, at least make it worth keeping around.

Comment 5 Martin Kyral 2016-11-08 11:07:03 UTC
I deem the feature quite useful -> ack+


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