Skip to content

Commit

Permalink
Merge pull request #10656 from M0ses/fix_backend_tests
Browse files Browse the repository at this point in the history
Fix backend tests
  • Loading branch information
mlschroe committed Jan 20, 2021
2 parents ce8e211 + a5c49a5 commit 6254c71
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/backend/t/0015-BSSched-EventSource-Directory.t
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ my $stdout_content;
},
{
'project' => 'devel:languages:perl:CPAN-S',
'evfilename' => 't/data/0015/events/x86_64/package:devel:languages:perl::perl-Unknown-Type',
'evfilename' => 't/data/0015/events/x86_64/package:devel:languages:perl::test-package',
'type' => 'unknown',
'package' => 'perl-SWISH'
},
Expand Down Expand Up @@ -223,10 +223,11 @@ $file_name =~ s/\//::/;

$ev_dir = "$eventdir_base/publish/";
$got = readxml("$ev_dir/$file_name",$BSXML::event);
delete $got->{time};
$expected = {
'repository' => 'openSUSE_Leap_42.1',
'project' => 'devel:languages:perl',
'type' => 'publish'
'type' => 'publish',
};

is_deeply($got,$expected,"Checking sendpublishevent");
Expand Down Expand Up @@ -258,8 +259,11 @@ push(@files_to_remove,"$ev_dir/$file_name");
unshift(@files_to_remove,"$eventdir_base/$arch/$evname");

for (BSUtil::unify(sort {$b cmp $a} @files_to_remove)) {
( -d $_ ) ? rmdir $_ : unlink $_;
warn "$_: $!" if $!;
if ( -d $_ ) {
rmdir $_ || warn "$_: $!"
} else {
unlink $_ || warn "$_: $!";
}
}

exit 0;
Expand Down

0 comments on commit 6254c71

Please sign in to comment.