Bug 34739 adds some new tests to t/db_dependent/Authority/Merge.t, which work when run alone. But when running the whole test suite, some weird fails show up. This patch fixes that bug in the test suite The new test case calls AddBiblio. And AddBiblio returns ($biblionumber, $biblioitemnumber). But the test calls it like this: my $biblionumber = AddBiblio; AddBiblio returns a list, but the calling code only stores a single value, so it get's the last value, i.e. the biblioitemnumber.  Now, when running the test alone, the DB sequences for biblio and biblioitem are in sync and both return the same value so the test works (by accident) But some tests add biblios with multiple items (or biblios without items), thus the sequences are no longer in sync and when the test tries to load a biblio via a biblioitemid, it finds nothing, which causes the fail bad: my $biblionumber = AddBiblio( $biblio_record, '', { skip_record_index => 1 } ); ok-ish: my ($biblionumber) = AddBiblio( $biblio_record, '', { skip_record_index => 1 } );
Created attachment 181309 [details] [review] Bug 39700: Fix test case t/db_dependent/Authority/Merge.t broken in 34739 Bug 34739 added some test cases to t/db_dependent/Authority/Merge.t which work when run as a standlone test, but fail when run with some other tests. This patch fixes the test. Test Plan: * Start KTD and enter a shell * Run only the single test: prove t/db_dependent/Authority/Merge.t * You should get "All test successful" * Now run two tests: prove t/db_dependent/Biblio.t t/db_dependent/Authority/Merge.t * You will get a FAIL: t/db_dependent/Authority/Merge.t (Wstat: 256 (exited 1) Tests: 14 Failed: 1) Failed test: 13 * Apply the patch * Again run two tests: prove t/db_dependent/Biblio.t t/db_dependent/Authority/Merge.t * You should get "All test successful" Sponsored by: HKS3
Created attachment 181310 [details] [review] Bug 39700: Fix test case t/db_dependent/Authority/Merge.t broken in 34739 Bug 34739 added some test cases to t/db_dependent/Authority/Merge.t which work when run as a standlone test, but fail when run with some other tests. This patch fixes the test. Test Plan: * Start KTD and enter a shell * Run only the single test: prove t/db_dependent/Authority/Merge.t * You should get "All test successful" * Now run two tests: prove t/db_dependent/Biblio.t t/db_dependent/Authority/Merge.t * You will get a FAIL: t/db_dependent/Authority/Merge.t (Wstat: 256 (exited 1) Tests: 14 Failed: 1) Failed test: 13 * Apply the patch * Again run two tests: prove t/db_dependent/Biblio.t t/db_dependent/Authority/Merge.t * You should get "All test successful" Sponsored by: HKS3 Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Great detective work, thanks a lot, Thomas!
Picking this out of the queue :)
Pushed for 25.05! Well done everyone, thank you!