mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Use intuitive side-by-side diff if test failed. [#CLICKHOUSE-2]
This commit is contained in:
parent
df9ada58fb
commit
e92862a7d7
@ -8,6 +8,7 @@ import lxml.etree as et
|
||||
from argparse import ArgumentParser
|
||||
from argparse import FileType
|
||||
from pprint import pprint
|
||||
import subprocess
|
||||
from subprocess import check_call
|
||||
from subprocess import Popen
|
||||
from subprocess import PIPE
|
||||
@ -187,9 +188,11 @@ def main(args):
|
||||
report_testcase.append(skipped)
|
||||
print("{0} - no reference file".format(MSG_UNKNOWN))
|
||||
else:
|
||||
(diff, _) = Popen(['diff', reference_file, stdout_file], stdout = PIPE).communicate()
|
||||
result_is_different = subprocess.call(['cmp', '--quiet', reference_file, stdout_file], stdout = PIPE)
|
||||
|
||||
if result_is_different:
|
||||
(diff, _) = Popen(['diff', '--side-by-side', reference_file, stdout_file], stdout = PIPE).communicate()
|
||||
|
||||
if diff:
|
||||
failure = et.Element("failure", attrib = {"message": "result differs with reference"})
|
||||
report_testcase.append(failure)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user