-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Bug: [MariaDB] phpunit
test errors
#7929
Comments
Please create one issue for one issue. About 3.
We expect the tests for CI4 are executed with the clean state of the repository. Of course, it is acceptable to change a hard-coded value to a variable. |
It breaks apps for MySQL. So not acceptable.
Yes, this is the way to go. Change the expectations for MySQL or MariaDB. |
Hm. Good. Then how do I check the tests for mysqli?
They all depend on one fix. I don't think it's necessary - the big log will be fixed. |
This was an exaggeration. |
That's when you need to decide in the tests: That's all you need to work. There will be time I will open a PR or someone else. |
See the comment: CodeIgniter4/app/Config/Database.php Line 59 in f35f956
|
Oh, yes, I see it now. What to do with the hardcode? If you keep it, then the issue can be closed |
The And some, or very few? tests should ensure that the result contains I think it is fine to compare many tests against the Config value rather than against hard-coded In conclusion, I don't think it is worth doing much. |
PR released, closed? |
Error №2 is not fixed. |
PHP Version
8.2
CodeIgniter4 Version
4.4.1
CodeIgniter4 Installation Method
Git
Which operating systems have you tested for this bug?
Linux
Which server did you use?
cli-server (PHP built-in webserver)
Database
10.11.4-MariaDB-1
What happened?
Error №1 (DB is configured in .env )
Now mysql (8.1.0) and mariadb (10.11.4-MariaDB-1 ) are compatible databases, but they have different versions.
Connection return version as 10.11.4-MariaDB-1:
CodeIgniter4/tests/system/Database/Live/ForgeTest.php
Lines 944 to 950 in f35f956
Maybe you need to rewrite to
$this->mysqli->server_version
(101104)? This is BC.Or rewrite the test for different versions of
mysql
andmariadb
.I commented out the condition and the test is successful.
Error №2 (DB is configured in .env )
The problem is in the versions for
mariadb
. Related to the first error.Error №3 (DB is not configured in .env)
The third failure relates to the prefix: Some tests are built on the
db_
prefix, others correctly add$prefix. $tableName
Tests are performed only when ENV:
database.tests.DBPrefix = db_
It is necessary to replace the hard-coded table names.
phpunit log
The text was updated successfully, but these errors were encountered: