Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to enable MariaDB in CI #36049

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

nicosomb
Copy link
Contributor

Questions Answers
Branch? develop / 8.1.x
Description? Please be specific when describing the PR.
Every detail helps: versions, browser/server configuration, specific module/theme, etc. Feel free to add more information below this table.
Type? bug fix / improvement / new feature / refacto
Category? FO / BO / CO / IN / WS / TE / LO / ME / PM
BC breaks? yes / no
Deprecations? yes / no
How to test? Indicate how to verify that this change works as expected.
UI Tests Please run UI tests and paste here the link to the run. Read this page to know why and how to use this tool..
Fixed issue or discussion? Fixes #{issue number here}, Fixes #{another issue number here}, Fixes https://github.com/PrestaShop/PrestaShop/discussions/ {discussion number here}
Related PRs If theme, autoupgrade or other module change is needed to make this change work, provide a link to related PRs here.
Sponsor company Your company or customer's name goes here (if applicable).

@nicosomb nicosomb added the WIP Status: Work In Progress label Apr 29, 2024
@prestonBot
Copy link
Collaborator

Hi, thanks for this contribution!

I found some issues with the Pull Request description:

  • The category should be one of these: BO, CO, FO, IN, LO, ME, PM, TE or WS (Read explanation)

Would you mind having a look at it? This will help us understand how interesting your contribution is, thank you very much!

(Note: this is an automated message, but answering it will reach a real human)

@prestonBot prestonBot added Bug fix Type: Bug fix BC break Type: Introduces a backwards-incompatible break labels Apr 29, 2024
@nicosomb nicosomb closed this Apr 29, 2024
@nicosomb nicosomb reopened this Apr 29, 2024
@nicosomb nicosomb force-pushed the mariadb-in-ci branch 3 times, most recently from e6d9877 to 3118469 Compare April 29, 2024 14:57
Copy link

@grooverdan grooverdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry I can't see the cause of the integration test failure.

- name: Change MySQL authentication method
run: mysql -h127.0.0.1 -uroot -ppassword -e "ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password'; FLUSH PRIVILEGES;"
- name: Change MariaDB authentication method
run: mysql -h127.0.0.1 -uroot -ppassword -e "ALTER USER root@localhost IDENTIFIED VIA mysql_native_password USING PASSWORD('password'); FLUSH PRIVILEGES;"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This chunk isn't needed. The mysql root password of the getlong/mariadb-action will set the password. Also `FLUSH PRIVILEGES isn't required after any ALTER USER or other SQL statement granting privs/user changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to remove it, but it fails too. I don't know why, I can't debug the error https://github.com/PrestaShop/PrestaShop/actions/runs/8892768244/job/24417552756?pr=36049
if you have any idea ...

@nicosomb nicosomb mentioned this pull request Apr 30, 2024
2 tasks
@grooverdan
Copy link

I tested locally on PrestaShop 44c66da

Against MariaDB-11.5 (with my delete single table alias extensions MariaDB/server#3237)

$ composer run-script integration-tests --timeout=0
> @php ./tests/bin/create-test-db.php
Testing database settings
Creating database test_prestashop
Creating database test_prestashop
Dropping database tables
Installing database
Dropping database tables
Initializing test context
Installing default data
Populating database
Configuring shop
Installing language
Installing fixtures
Cannot create image "Dade_County" for entity "store"
Cannot create image "E_Fort_Lauderdale" for entity "store"
Cannot create image "Pembroke_Pines" for entity "store"
Cannot create image "Coconut_Grove" for entity "store"
Cannot create image "N_Miami_Biscayne" for entity "store"
Installing theme classic
Installing modules on disk
Cannot install module "ganalytics"
Creating database dump
Backup resources
Test DB was successfully created
> @php ./tests/bin/create-test-tables-dump.php
> @php -d date.timezone=UTC -d memory_limit=-1 ./vendor/phpunit/phpunit/phpunit -c tests/Integration/phpunit.xml
PHPUnit 9.6.19 by Sebastian Bergmann and contributors.

.............................................................   61 / 1307 (  4%)
.............................................................  122 / 1307 (  9%)
.............................................................  183 / 1307 ( 14%)
.............................................................  244 / 1307 ( 18%)
.............................................................  305 / 1307 ( 23%)
.............................................................  366 / 1307 ( 28%)
.............................................................  427 / 1307 ( 32%)
.............................................................  488 / 1307 ( 37%)
.............................................................  549 / 1307 ( 42%)
.............................................................  610 / 1307 ( 46%)
.............................................................  671 / 1307 ( 51%)
.............................................................  732 / 1307 ( 56%)
.............................................................  793 / 1307 ( 60%)
.............................................................  854 / 1307 ( 65%)
.............................................................  915 / 1307 ( 70%)
.............................................................  976 / 1307 ( 74%)
............................................................. 1037 / 1307 ( 79%)
............................................................. 1098 / 1307 ( 84%)
............................................................. 1159 / 1307 ( 88%)
............................................................. 1220 / 1307 ( 93%)
............................................................. 1281 / 1307 ( 98%)
..........................                                    1307 / 1307 (100%)

Time: 01:31.491, Memory: 708.00 MB

OK (1307 tests, 10958 assertions)

THE ERROR HANDLER HAS CHANGED!

Remaining self deprecation notices (1633)

Remaining direct deprecation notices (407)

Remaining indirect deprecation notices (5475)

Other deprecation notices (871)
> @php -d date.timezone=UTC ./vendor/phpunit/phpunit/phpunit -c tests/Integration/phpunit-isolated.xml
PHPUnit 9.6.19 by Sebastian Bergmann and contributors.

.PrestaShopException in /home/dan/repos/PrestaShop/classes/db/DbPDO.php line 151
#0 /home/dan/repos/PrestaShop/classes/db/Db.php(381): DbPDOCore->_query()
#1 /home/dan/repos/PrestaShop/classes/db/Db.php(618): DbCore->query()
#2 /home/dan/repos/PrestaShop/classes/shop/Shop.php(1365): DbCore->executeS()
#3 /home/dan/repos/PrestaShop/classes/shop/Shop.php(356): ShopCore::findShopByHost()
#4 /home/dan/repos/PrestaShop/config/config.inc.php(122): ShopCore::initialize()
#5 /home/dan/repos/PrestaShop/bin/console(18): require_once('...')
#6 {main}
PrestaShopException in /home/dan/repos/PrestaShop/classes/db/DbPDO.php line 151
#0 /home/dan/repos/PrestaShop/classes/db/Db.php(381): DbPDOCore->_query()
#1 /home/dan/repos/PrestaShop/classes/db/Db.php(618): DbCore->query()
#2 /home/dan/repos/PrestaShop/classes/shop/Shop.php(1365): DbCore->executeS()
#3 /home/dan/repos/PrestaShop/classes/shop/Shop.php(356): ShopCore::findShopByHost()
#4 /home/dan/repos/PrestaShop/config/config.inc.php(122): ShopCore::initialize()
#5 /home/dan/repos/PrestaShop/bin/console(18): require_once('...')
#6 {main}
.PrestaShopException in /home/dan/repos/PrestaShop/classes/db/DbPDO.php line 151
#0 /home/dan/repos/PrestaShop/classes/db/Db.php(381): DbPDOCore->_query()
#1 /home/dan/repos/PrestaShop/classes/db/Db.php(618): DbCore->query()
#2 /home/dan/repos/PrestaShop/classes/shop/Shop.php(1365): DbCore->executeS()
#3 /home/dan/repos/PrestaShop/classes/shop/Shop.php(356): ShopCore::findShopByHost()
#4 /home/dan/repos/PrestaShop/config/config.inc.php(122): ShopCore::initialize()
#5 /home/dan/repos/PrestaShop/bin/console(18): require_once('...')
#6 {main}
PrestaShopException in /home/dan/repos/PrestaShop/classes/db/DbPDO.php line 151
#0 /home/dan/repos/PrestaShop/classes/db/Db.php(381): DbPDOCore->_query()
#1 /home/dan/repos/PrestaShop/classes/db/Db.php(618): DbCore->query()
#2 /home/dan/repos/PrestaShop/classes/shop/Shop.php(1365): DbCore->executeS()
#3 /home/dan/repos/PrestaShop/classes/shop/Shop.php(356): ShopCore::findShopByHost()
#4 /home/dan/repos/PrestaShop/config/config.inc.php(122): ShopCore::initialize()
#5 /home/dan/repos/PrestaShop/bin/console(18): require_once('...')
#6 {main}
.PrestaShopException in /home/dan/repos/PrestaShop/classes/db/DbPDO.php line 151
#0 /home/dan/repos/PrestaShop/classes/db/Db.php(381): DbPDOCore->_query()
#1 /home/dan/repos/PrestaShop/classes/db/Db.php(618): DbCore->query()
#2 /home/dan/repos/PrestaShop/classes/shop/Shop.php(1365): DbCore->executeS()
#3 /home/dan/repos/PrestaShop/classes/shop/Shop.php(356): ShopCore::findShopByHost()
#4 /home/dan/repos/PrestaShop/config/config.inc.php(122): ShopCore::initialize()
#5 /home/dan/repos/PrestaShop/bin/console(18): require_once('...')
#6 {main}
PrestaShopException in /home/dan/repos/PrestaShop/classes/db/DbPDO.php line 151
#0 /home/dan/repos/PrestaShop/classes/db/Db.php(381): DbPDOCore->_query()
#1 /home/dan/repos/PrestaShop/classes/db/Db.php(618): DbCore->query()
#2 /home/dan/repos/PrestaShop/classes/shop/Shop.php(1365): DbCore->executeS()
#3 /home/dan/repos/PrestaShop/classes/shop/Shop.php(356): ShopCore::findShopByHost()
#4 /home/dan/repos/PrestaShop/config/config.inc.php(122): ShopCore::initialize()
#5 /home/dan/repos/PrestaShop/bin/console(18): require_once('...')
#6 {main}
PrestaShopException in /home/dan/repos/PrestaShop/classes/db/DbPDO.php line 151
#0 /home/dan/repos/PrestaShop/classes/db/Db.php(381): DbPDOCore->_query()
#1 /home/dan/repos/PrestaShop/classes/db/Db.php(618): DbCore->query()
#2 /home/dan/repos/PrestaShop/classes/shop/Shop.php(1365): DbCore->executeS()
#3 /home/dan/repos/PrestaShop/classes/shop/Shop.php(356): ShopCore::findShopByHost()
#4 /home/dan/repos/PrestaShop/config/config.inc.php(122): ShopCore::initialize()
#5 /home/dan/repos/PrestaShop/bin/console(18): require_once('...')
#6 {main}
.....................                                          24 / 24 (100%)

Time: 00:28.129, Memory: 181.00 MB

OK (24 tests, 72 assertions)

Remaining self deprecation notices (6)

Remaining indirect deprecation notices (546)

Other deprecation notices (14)

Against MariaDB-10.11.8- ae03374f29944f4ae5cbc4df80d7273f2476dcff (current latest) / and 10.4.34-f378e7643459f0baa6c4149a795463f2f46b6871 (current latest).

$ composer run-script integration-tests --timeout=0
> @php ./tests/bin/create-test-db.php
Testing database settings
Creating database test_prestashop
Creating database test_prestashop
Dropping database tables
Installing database
Dropping database tables
Initializing test context
Installing default data
Populating database
Configuring shop
Installing language
Installing fixtures
Cannot create image "Dade_County" for entity "store"
Cannot create image "E_Fort_Lauderdale" for entity "store"
Cannot create image "Pembroke_Pines" for entity "store"
Cannot create image "Coconut_Grove" for entity "store"
Cannot create image "N_Miami_Biscayne" for entity "store"
Installing theme classic
Installing modules on disk
Cannot install module "ganalytics"
Creating database dump
Backup resources
Test DB was successfully created
> @php ./tests/bin/create-test-tables-dump.php
> @php -d date.timezone=UTC -d memory_limit=-1 ./vendor/phpunit/phpunit/phpunit -c tests/Integration/phpunit.xml
PHPUnit 9.6.19 by Sebastian Bergmann and contributors.

.............................................................   61 / 1307 (  4%)
.............................................................  122 / 1307 (  9%)
.............................................................  183 / 1307 ( 14%)
..........................................................FFF  244 / 1307 ( 18%)
.............................................................  305 / 1307 ( 23%)
.............................................................  366 / 1307 ( 28%)
.............................................................  427 / 1307 ( 32%)
.............................................................  488 / 1307 ( 37%)
.............................................................  549 / 1307 ( 42%)
.............................................................  610 / 1307 ( 46%)
.............................................................  671 / 1307 ( 51%)
.............................................................  732 / 1307 ( 56%)
.............................................................  793 / 1307 ( 60%)
.............................................................  854 / 1307 ( 65%)
.............................................................  915 / 1307 ( 70%)
.............................................................  976 / 1307 ( 74%)
............................................................. 1037 / 1307 ( 79%)
............................................................. 1098 / 1307 ( 84%)
............................................................. 1159 / 1307 ( 88%)
............................................................. 1220 / 1307 ( 93%)
............................................................. 1281 / 1307 ( 98%)
..........................                                    1307 / 1307 (100%)

Time: 01:22.072, Memory: 694.00 MB

There were 3 failures:

1) Tests\Integration\Classes\CartRuleTest::testGetAllCustomersCartRulesInMyAccountZone
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    0 => '4'
-    1 => '8'
-    2 => '2'
-    3 => '6'
+    0 => 2
+    1 => 4
+    2 => 6
+    3 => 8
 )

/home/dan/repos/PrestaShop/tests/Integration/Classes/CartRuleTest.php:213

2) Tests\Integration\Classes\CartRuleTest::testGetAllCustomersCartRulesInBackoffice
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    0 => '8'
-    1 => '6'
-    2 => '4'
-    3 => '2'
-    4 => '9'
+    0 => 2
+    1 => 4
+    2 => 6
+    3 => 8
+    4 => 9
 )

/home/dan/repos/PrestaShop/tests/Integration/Classes/CartRuleTest.php:255

3) Tests\Integration\Classes\CartRuleTest::testGetHighlightedVouchersInCart
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    0 => '1'
-    1 => '5'
-    2 => '2'
-    3 => '6'
+    0 => 1
+    1 => 2
+    2 => 5
+    3 => 6
 )

/home/dan/repos/PrestaShop/tests/Integration/Classes/CartRuleTest.php:308

FAILURES!
Tests: 1307, Assertions: 10957, Failures: 3.

THE ERROR HANDLER HAS CHANGED!

Remaining self deprecation notices (1633)

Remaining direct deprecation notices (407)

Remaining indirect deprecation notices (5470)

Other deprecation notices (862)
Script @php -d date.timezone=UTC -d memory_limit=-1 ./vendor/phpunit/phpunit/phpunit -c tests/Integration/phpunit.xml handling the integration-tests event returned with error code 1

Still can't see why gh actions fails on "create-test-db"

@nicosomb
Copy link
Contributor Author

nicosomb commented May 2, 2024

@grooverdan thank you for your tests.
locally I don't have any problem too ... I don't understand.

@grooverdan
Copy link

Glad one of does have it working ok :-).

Maybe mariadb not fully running for some reason. As a step before testing

until mysql -h 127.0.0.1 -u root  -ppassword -e 'select 1'; do sleep 1; echo not there yet; done; echo "ready"

@nicosomb nicosomb closed this May 2, 2024
@nicosomb nicosomb reopened this May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BC break Type: Introduces a backwards-incompatible break Bug fix Type: Bug fix WIP Status: Work In Progress
Projects
Status: Reopened
Development

Successfully merging this pull request may close these issues.

None yet

3 participants