TT#133502 Exit with non-zero if schemes are different

If formatter=tap is used - exit with 0 code so jenkins can parse tap
report.

If this option is not set - exit 0 if schemes are equal but exit 1 if
they are not.

Change-Id: Ie1f034205acde538187e016e51ebad1caf555d91
bookworm/master
Mykola Malkov 4 years ago
parent 49a8e64e86
commit bddc4d6152

@ -184,13 +184,13 @@ foreach my $schema ( split( / /, $argv->{schemes} ) ) {
$struct2 = $dbh2->selectall_hashref( $queries->{$obj}, 'key_col' );
unless ( Compare($struct1, $struct2) ) {
$exit = 1;
print_diff($struct1, $struct2, $obj, $res, $schema);
}
}
}
if ( $argv->{formatter} eq 'tap' ) {
$exit = 0;
tap_output();
}
else {
@ -316,6 +316,7 @@ sub tap_output {
sub human_output {
my $number = scalar(@{$res});
if ( $number > 0 ) {
$exit = 1;
print "The following errors were found:\n\n";
foreach my $err ( @{$res} ) {
print "$err\n";

@ -62,4 +62,4 @@ if [[ -n "${FORMATTER}" ]]; then
fi
/usr/share/ngcp-system-tests/compare_dbs.pl \
--schemes="${NGCP_DB_BACKUP_FINAL_LIST[*]}" \
"${opts[@]}" || true
"${opts[@]}"

Loading…
Cancel
Save