Description
Jonathan Druart
2020-08-19 06:45:10 UTC
Created attachment 108590 [details] [review] Bug 26250: Fix tests when SearchEngine=Elastic Most of the time the tests are failing because the item is not created correctly (missing biblio and/or biblioitem). The usual error is: t/db_dependent/selenium/regressions.t ..... 5/5 Can't call method "leader" on an undefined value at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch.pm line 534. In this patch we are making sure $builder->build({ source => 'Item' }) is replace with $builder->build_sample_item Test plan: Turn on Elastic and confirm that all the tests pass! Created attachment 108591 [details] [review] Bug 26250: StockRotationItems.t - wip StockRotationItems.t and StockRotationStages.t need to be fixed We are very close here, only 2 test files are still failing. Can I get some help to fix them and have this awesome patch pushed to master ASAP? It will be a nightmare to rebase, we need it now! Created attachment 108623 [details] [review] Bug 26250: StockRotationItems.t and StockRotationStages.t Thanks Martin! Created attachment 108627 [details] [review] Bug 26250: StockRotationItems.t and StockRotationStages.t Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 108730 [details] [review] Bug 26250: Fix tests when SearchEngine=Elastic Most of the time the tests are failing because the item is not created correctly (missing biblio and/or biblioitem). The usual error is: t/db_dependent/selenium/regressions.t ..... 5/5 Can't call method "leader" on an undefined value at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch.pm line 534. In this patch we are making sure $builder->build({ source => 'Item' }) is replace with $builder->build_sample_item Test plan: Turn on Elastic and confirm that all the tests pass! Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 108731 [details] [review] Bug 26250: StockRotationItems.t and StockRotationStages.t Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> We have a QA script fail here: FAIL t/db_dependent/Koha/Patrons.t OK critic FAIL forbidden patterns forbidden pattern: Use of DateTime->now should certainly be replaced with dt_from_string (bug 24840) (line 612) forbidden pattern: Use of DateTime->now should certainly be replaced with dt_from_string (bug 24840) (line 613) forbidden pattern: Use of DateTime->now should certainly be replaced with dt_from_string (bug 24840) (line 1427) forbidden pattern: Use of DateTime->now should certainly be replaced with dt_from_string (bug 24840) (line 1428) Hm, and some tests are failing? t/db_dependent/CourseReserves/CourseItems.t Test Summary Report ------------------- t/db_dependent/CourseReserves/CourseItems.t (Wstat: 1536 Tests: 35 Failed: 6) Failed tests: 2, 7, 12, 17, 22, 34 Non-zero exit status: 6 (In reply to Katrin Fischer from comment #9) > We have a QA script fail here: > > FAIL t/db_dependent/Koha/Patrons.t > OK critic > FAIL forbidden patterns > forbidden pattern: Use of DateTime->now should certainly be replaced with > dt_from_string (bug 24840) (line 612) > forbidden pattern: Use of DateTime->now should certainly be replaced with > dt_from_string (bug 24840) (line 613) > forbidden pattern: Use of DateTime->now should certainly be replaced with > dt_from_string (bug 24840) (line 1427) > forbidden pattern: Use of DateTime->now should certainly be replaced with > dt_from_string (bug 24840) (line 1428) That's not valid, the diff is: - AddIssue( $patron, $item_1->{barcode}, DateTime->now->subtract( days => 1 ) ); - AddIssue( $patron, $item_2->{barcode}, DateTime->now->subtract( days => 5 ) ); - AddIssue( $patron, $item_3->{barcode} ); + AddIssue( $patron, $item_1->barcode, DateTime->now->subtract( days => 1 ) ); + AddIssue( $patron, $item_2->barcode, DateTime->now->subtract( days => 5 ) ); + AddIssue( $patron, $item_3->barcode ); > Hm, and some tests are failing? > t/db_dependent/CourseReserves/CourseItems.t > Test Summary Report > ------------------- > t/db_dependent/CourseReserves/CourseItems.t (Wstat: 1536 Tests: 35 Failed: 6) > Failed tests: 2, 7, 12, 17, 22, 34 > Non-zero exit status: 6 It passes for me :-/ I have rerun the tests on a fresh setup and it looks much better now. I have an issue with the selenium tests in general sadly, so I am passing QA, but ask you to double check this one. Maybe you can also see what's going wrong, so posting my error too: prove t/db_dependent/selenium/regressions.t t/db_dependent/selenium/regressions.t .. Could not create new session: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output: null,"translators":null,"contributors":null,"locales":["sk"]},{"name":"Википедија (sr)","description":"Претрага Википедије на српском језику","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["sr"]},{"name":"Wikipedia (af)","description":"Wikipedia, die vrye ensiklopedie","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["af"]},{"name":"ویکیپدیا (fa)","description":"ویکیپدیا، دانشنامهٔ آزاد","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["fa"]},{"name":"വിക്കിപീഡിയ (ml)","description":"വിക്കിപീഡിയ, സ്വതന്ത്ര സര്വ്വവിജ്ഞാനകോശം ","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["ml"]},{"name":"Wikipedia (ms)","description":"Wikipedia, ensiklopedia bebas","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["ms"]},{"name":"Wikipedia (ia)","description":"Wikipedia, le encyclopedia libere","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["ia"]},{"name":"Wikipedia (no)","description":"Wikipedia, den frie encyklopedi","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["NO"]},{"name":"Википедия (ru)","description":"Википедия, свободная энциклопедия","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["ru"]},{"name":"Wikipedia (br)","description":"Wikipedia, an holloueziadur digor","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["br"]},{"name":"Wikipedia (pl)","description":"Wikipedia, wolna encyklopedia","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["pl"]},{"name":"Вікіпэдыя (be-tarask)","description":"Вікіпэдыя, вольная энцыкляпэдыя","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["be-tarask"]},{"name":"ວິກິພີເດຍ (lo)","description":"ວິກິພີເດຍ, ສາລານຸກົມເສລີ","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["lo"]},{"name":"Wikipedia (sv)","description":"Wikipedia, den fria encyklopedin","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["sv-SE"]},{"name":"Vikipēdija","description":"Vikipēdija, brīvā enciklopēdija","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["lv"]},{"name":"Wikipedija (sl)","description":"Wikipedija, prosta enciklopedija","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["sl"]},{"name":"Biquipedia (an)","description":"A enciclopedia Libre","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["an"]}],"targetApplications":[{"id":"toolkit@mozilla.org","minVersion":null,"maxVersion":null}],"targetPlatforms":[],"seen":true,"dependencies":[],"incognito":"spanning","userPermissions":{"permissions":[],"origins":[]},"icons":{"16":"favicon.ico"},"iconURL":null,"blocklistState":0,"blocklistURL":null,"startupData":null,"hidden":true,"installTelemetryInfo":null,"recommendationState":null,"rootURI":"resource://search-extensions/wikipedia/","location":"app-builtin"} 1598362999817 addons.xpi DEBUG Loading bootstrap scope from resource://search-extensions/wikipedia/ 1598362999817 addons.xpi DEBUG Calling bootstrap method install on wikipedia@search.mozilla.org version 1.0 1598362999817 addons.xpi DEBUG Calling bootstrap method startup on wikipedia@search.mozilla.org version 1.0 1598363019143 addons.productaddons INFO sending request to: https://aus5.mozilla.org/update/3/GMP/68.11.0/20200720181548/Linux_x86_64-gcc3/null/esr/Linux%204.9.0-13-amd64%20(GTK%203.22.11%2Clibpulse%20not-available)/default/default/update.xml 1598363019578 addons.productaddons INFO Completed downloading document at /home/vagrant/kohaclone/t/lib/Selenium.pm line 58. Use of uninitialized value $value in string eq at /home/vagrant/kohaclone/C4/Context.pm line 529. # Looks like your test exited with 255 before it could output anything. t/db_dependent/selenium/regressions.t .. Dubious, test returned 255 (wstat 65280, 0xff00) Failed 5/5 subtests Test Summary Report ------------------- t/db_dependent/selenium/regressions.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 5 tests but ran 0. Created attachment 109208 [details] [review] Bug 26250: Fix tests when SearchEngine=Elastic Most of the time the tests are failing because the item is not created correctly (missing biblio and/or biblioitem). The usual error is: t/db_dependent/selenium/regressions.t ..... 5/5 Can't call method "leader" on an undefined value at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch.pm line 534. In this patch we are making sure $builder->build({ source => 'Item' }) is replace with $builder->build_sample_item Test plan: Turn on Elastic and confirm that all the tests pass! Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 109209 [details] [review] Bug 26250: StockRotationItems.t and StockRotationStages.t Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> (In reply to Katrin Fischer from comment #11) > I have rerun the tests on a fresh setup and it looks much better now. I have > an issue with the selenium tests in general sadly, so I am passing QA, but > ask you to double check this one. > > Maybe you can also see what's going wrong, so posting my error too: I guess you are not using ktd but kohadevbox. It is one of the reason I moved to ktd, it was getting tricky to make the selenium tests pass. You should double check the selenium version, most of the time the problems come from there (you need 2.53.1) Yes, the last one on kohadevbox it appears... but thx for the hint, I will check! Pushed to master for 20.11, thanks to everybody involved! doesnt apply clean to 20.05.x, no backport please rebase if needed Created attachment 109838 [details] [review] Bug 26250: Fix regressions.t when SearchEngine=ES Prior to this patch it failed with: t/db_dependent/selenium/regressions.t .. 5/5 Can't call method "leader" on an undefined value at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch.pm line 548. Last patch pushed to master. |