Bug 16160

Summary: t/db_dependent/www/search_utf8.t fails due to layout change
Product: Koha Reporter: Tomás Cohen Arazi <tomascohen>
Component: Test SuiteAssignee: Tomás Cohen Arazi <tomascohen>
Status: CLOSED FIXED QA Contact: Galen Charlton <gmcharlt>
Severity: major    
Priority: P5 - low CC: brendan, chris, jonathan.druart, julian.maurice
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 16160: Fix t/../www/search_utf8.t for layout change
Bug 16160: Fix t/../www/search_utf8.t for layout change

Description Tomás Cohen Arazi 2016-03-29 19:08:28 UTC
Aparently, a layout change made the tests fail. To reproduce:

- Run (on kohadevbox:ansible)
  $ sudo koha-shell kohadev
  $ cd kohaclone
  $ prove t/db_dependent/www/search_utf8.t
=> FAIL: mainsubmitform is not found, and the tests hang
Comment 1 Tomás Cohen Arazi 2016-03-29 19:09:31 UTC
I mark this as major because a POC of the fix made some UTF-8 related tests fail, and need help debugging it (ran out of time today).
Comment 2 Tomás Cohen Arazi 2016-03-29 20:12:04 UTC Comment hidden (obsolete)
Comment 3 Tomás Cohen Arazi 2016-03-29 20:15:32 UTC
Tests are not failing with the patch, false alarm. But it is worth pushing ASAP, becasue we have a useless jenkins right now, due to this tests hanging forever.
Comment 4 Tomás Cohen Arazi 2016-03-29 20:18:01 UTC
For non kohadevbox:ansible users willing to test this, you can run it on a regular dev setup, provided you already set this environment variables (adjust values to your setup):

export KOHA_USER=koha_kohadev
export KOHA_PASS=password
export KOHA_INTRANET_URL=http://localhost:8080
export KOHA_OPAC_URL=http://localhost:80
Comment 5 Chris Cormack 2016-03-29 20:38:36 UTC
Hmm, It looks like it hangs if you have the wrong settings still.

prove t/db_dependent/www/search_utf8.t
t/db_dependent/www/search_utf8.t .. Error GETing http://localhost:5001/cgi-bin/koha/mainpage.pl: Can't connect to localhost:5001 (Connection refused) at t/db_dependent/www/search_utf8.t line 117
# Looks like your test exited with 111 before it could output anything.


It's hung there ... 10 minutes now, that is with the patch applied.
Comment 6 Tomás Cohen Arazi 2016-03-29 22:03:09 UTC
(In reply to Chris Cormack from comment #5)
> Hmm, It looks like it hangs if you have the wrong settings still.
> 
> prove t/db_dependent/www/search_utf8.t
> t/db_dependent/www/search_utf8.t .. Error GETing
> http://localhost:5001/cgi-bin/koha/mainpage.pl: Can't connect to
> localhost:5001 (Connection refused) at t/db_dependent/www/search_utf8.t line
> 117
> # Looks like your test exited with 111 before it could output anything.
> 
> 
> It's hung there ... 10 minutes now, that is with the patch applied.

That'd be bug 14158, for which I haven't written a patch! This one is simpler, just a layout change, reflected on the WWW::Mechanize use.
Comment 7 Jonathan Druart 2016-03-30 09:32:13 UTC
Created attachment 49675 [details] [review]
Bug 16160: Fix t/../www/search_utf8.t for layout change

Some of the include files in tools/manage-marc-import.tt introduced a new form object
so the form index for the tests needed to be changed to match the new layout.

While testing this I also found that due to the new record_type input in stage-marc-import.tt
the tests would fail if run on an instance with already imported stuff (i.e. the import id
was defaulting to zero). This might have been the cause of some random failures in jenkins
befire we started to DROP / re-CREATE the DB.

To test:
- Run (on kohadevbox:ansible)
  $ sudo koha-shell kohadev
  $ cd kohaclone
  $ prove t/db_dependent/www/search_utf8.t
=> FAIL: mainsubmitform is not found, and the tests hang
- Apply the patch
- re-run the tests:
 $ prove t/db_dependent/www/search_utf8.t
=> SUCCESS: Tests now pass!
- Sign off

Regards

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Jonathan Druart 2016-03-30 09:32:37 UTC
Skipping QA.
Comment 9 Jonathan Druart 2016-03-30 09:35:12 UTC
Tomas, did you notice that the tests do not pass if plack is enabled?

$ prove t/db_dependent/www/search_utf8.t
t/db_dependent/www/search_utf8.t .. 9/66 0% completed at t/db_dependent/www/search_utf8.t line 181.
t/db_dependent/www/search_utf8.t .. 37/66 Link not found at t/db_dependent/www/search_utf8.t line 127.
# Looks like you planned 66 tests but ran 37.
# Looks like your test exited with 255 just after 37.
^C
Comment 10 Brendan Gallagher 2016-03-30 13:44:47 UTC
Pushed to Master - Should be in the May 2016 release.  Thanks!
Comment 11 Julian Maurice 2016-04-01 13:49:03 UTC
Tests pass on 3.22.x without this patch, status changed to RESOLVED