Files
scylladb/tests/mutation_diff
Botond Dénes 90721468f0 tests/mutation_diff: remove false-positive diff of the partition header
Currently the partition header will always be reported as different when
comparing two mutations. This is because they are prepended with the
"expected: " and "... but got: " texts. This generates unnecessary
noise. Inject a new line between the prefix and the partition-header
proper. This way the partition header will only show up in the diff when
there is an actual difference. The "expected: " and "... but got: "
phrases are still shown as different on the top of the diff but this is
fine as one can immediately see that they are not part of the data and
additionaly they help the reader in determining which part of the diff
is the expected one and which is the actual one.

Signed-off-by: Botond Dénes <bdenes@scylladb.com>
Message-Id: <29e0f413d248048d7db032224a3fd4180bf1b319.1554909144.git.bdenes@scylladb.com>
2019-04-10 18:05:36 +02:00

14 lines
375 B
Bash
Executable File

#!/usr/bin/env bash
#
# Converts assertion failure text involving two mutations to a diff.
#
# Usage: mutation_diff <path-to-test-output-file>
#
function filter {
sed 's/@0x[0-9a-f]*//g'
}
colordiff -u <(sed -n '/expected/,/got:/p' $1 | head -n-1 | sed 's/.*expected /&\n/' | filter) \
<(sed -n '/got:/,/^$/p' $1 | sed 's/.*got: /&\n/' | filter) | less -R