Browse Source

Bug 28948: Fix random failure

This patch makes the query for randomly generated libraries
deterministic, thus getting rid of the random tests failures.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
21.11.x
Tomás Cohen Arazi 3 years ago
committed by Jonathan Druart
parent
commit
fde97d3969
  1. 9
      t/db_dependent/Koha/REST/Plugin/Objects.t

9
t/db_dependent/Koha/REST/Plugin/Objects.t

@ -89,7 +89,10 @@ get '/libraries/:library_id_1/:library_id_2' => sub {
my $library_id_1 = $c->param('library_id_1');
my $library_id_2 = $c->param('library_id_2');
my $libraries_rs = Koha::Libraries->search({ branchcode => [ $library_id_1, $library_id_2 ] });
my $libraries_rs = Koha::Libraries->search(
{ branchcode => [ $library_id_1, $library_id_2 ] },
{ order_by => 'branchname' }
);
my $libraries = $c->objects->search( $libraries_rs );
$c->render(
@ -538,8 +541,8 @@ subtest 'objects.search helper, public requests' => sub {
$schema->storage->txn_begin;
my $library_1 = $builder->build_object({ class => 'Koha::Libraries' });
my $library_2 = $builder->build_object({ class => 'Koha::Libraries' });
my $library_1 = $builder->build_object({ class => 'Koha::Libraries', value => { branchname => 'A' } });
my $library_2 = $builder->build_object({ class => 'Koha::Libraries', value => { branchname => 'B' } });
my $t = Test::Mojo->new;

Loading…
Cancel
Save