Bug 20080 - Test for utf8mb4 encoding and collation
Summary: Test for utf8mb4 encoding and collation
Status: CLOSED FIXED
Alias: None
Product: Project Infrastructure
Classification: Unclassified
Component: QA tools (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal
Assignee: Tomás Cohen Arazi
QA Contact:
URL:
Keywords:
Depends on: 18336
Blocks:
  Show dependency treegraph
 
Reported: 2018-01-23 19:00 UTC by Tomás Cohen Arazi
Modified: 2019-10-14 19:56 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 20080: Test for utf8mb4 encoding and collation (1.23 KB, patch)
2018-01-23 19:11 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 20080: Test for utf8mb4 encoding and collation (1.28 KB, patch)
2018-01-26 14:25 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 20080: Followup: corrected unless/if logic (1.81 KB, patch)
2018-01-26 14:25 UTC, Mark Tompsett
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2018-01-23 19:00:16 UTC

    
Comment 1 Tomás Cohen Arazi 2018-01-23 19:01:06 UTC
Bug 18336 introduces the use of a different collation and encoding. The QA tools should be adapted if that bug gets its patches pushed to master.
Comment 2 Tomás Cohen Arazi 2018-01-23 19:11:11 UTC
Created attachment 70861 [details] [review]
Bug 20080: Test for utf8mb4 encoding and collation

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 3 Mark Tompsett 2018-01-25 01:50:54 UTC
Lacks test plan, and I did try to figure it out.
I figure something about prove t/Perl.t in qa-test-tools,
but I think there is a data/4/sql and/or data/5/sql file which may affect this, but I keep getting failures. I'm not sure what I'm doing wrong. Easier for you to explain how to prove this works.
Comment 4 Tomás Cohen Arazi 2018-01-26 12:48:00 UTC
Those tests are failing in master already. So, to test:

To test:
- Apply this patch
- Change kohastructure.sql with a fake commit creating a table "the old way"
- Run:
  $ kshell
 k$ qa -c 1 -v 2
=> SUCCESS: The QA script gives an error, due to bad encoding/collation
- Add a new commit fixing the encoding/collation
- Run:
  $ kshell
 k$ qa -c 2 -v 2
=> SUCCESS: No encoding/collation problems reported!
- Sign off :-D
Comment 5 Mark Tompsett 2018-01-26 14:25:29 UTC
Created attachment 70957 [details] [review]
Bug 20080: Test for utf8mb4 encoding and collation

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

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 6 Mark Tompsett 2018-01-26 14:25:32 UTC
Created attachment 70958 [details] [review]
Bug 20080: Followup: corrected unless/if logic

Changed unless to if, because unless was the wrong logic.

TEST PLAN
---------
1) Run the following commands on a kohadev box:
    cd ~/qa-test-tools
    git pull
    git checkout -b bug_20080 origin/master
    git bz apply 20080

    cd ~/kohaclone
    git pull
    git checkout -b bug_20080 origin/master
    git bz apply 18336

2) Edit ~/kohaclone/installer/data/mysql/kohastructure.sql
   changing CHARSET and COLLATE on a table to just utf8, instead of
   the utf8mb variation it is.

3) Run the following commands:
    git add installer/data/mysql/kohastructure.sql
    git commit
   -- doesn't matter what the commit message is.

4) Run the following commands:
    kshell
    qa -v 2 -c 1
   -- this should fail with a collation problem.

5) Edit ~/kohaclone/installer/data/mysql/kohastructure.sql
   changing CHARSET and COLLATE on a table back to the utf8mb variation it was.

6) Run the following commands:
    kshell
    qa -v 2 -c 2
   -- this should pass

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 7 Katrin Fischer 2018-02-04 20:31:11 UTC
Hm, have a problem with this one:

An error occurred : Use of uninitialized value $_ in concatenation (.) or string at /home/vagrant/qa-test-tools/QohA/File/Specific/Kohastructure.pm line 39.
Comment 8 Kyle M Hall 2018-02-16 18:35:16 UTC
../qa-test-tools/koha-qa.pl -v 2 -c 9
testing 9 commit(s) (applied to f34dcf3 'Bug 18789: (follow-up) Fix page title')

Processing files before patches
|================>        | 4 / 6 (66.67%)

An error occurred : Use of uninitialized value $_ in concatenation (.) or string at /home/vagrant/qa-test-tools/QohA/File/Specific/Kohastructure.pm line 39.
Comment 9 Tomás Cohen Arazi 2018-02-17 13:46:57 UTC
Issues regarding the QA tools are handled in the Gitlab repository:

https://gitlab.com/koha-community/qa-test-tools
Comment 10 Jonathan Druart 2018-08-13 18:00:12 UTC
These patches were wrong, the issue should have been fixed by https://gitlab.com/koha-community/qa-test-tools/issues/1