-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
[REF] Fix utf8mb4 test in APIv4 and re-enable the altering of databas… #21001
Conversation
(Standard links)
|
@@ -5196,11 +5196,27 @@ protected function doMerge(bool $isReverse = FALSE) { | |||
* out when we are. | |||
*/ | |||
public function testEmojiInWhereClause(): void { | |||
$schemaNeedsAlter = \CRM_Core_BAO_SchemaHandler::databaseSupportsUTF8MB4(); | |||
if ($schemaNeedsAlter) { | |||
CRM_Core_DAO::executeQuery(" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seamuslee001 so my conclusion is we can't do this alter - I ended up ripping it out because I hit so many weird situations in various parts of the suite. I think in the end it's better to just let this test actually test non-utf8 on those matrix machines that don't support utf8mb4 rather than try to mock it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also worth noting - this used to not cause problems because \CRM_Core_BAO_SchemaHandler::databaseSupportsUTF8MB4()
used to always incorrectly return FALSE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is the exact same alter that is happening in the v4 version of this test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seamuslee001 yeah - which I think we should remove to get rid of bizarre fails like #20984
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eileenmcnaughton that is only failing because the Civi::statics cache hasn't been reset after the alter. This value https://github.com/civicrm/civicrm-core/blob/master/CRM/Core/BAO/SchemaHandler.php#L922 with the current test setup will still return TRUE even tho table has now changed to not support emojis hence my reseting of the civi statics in the apiv4 test which is all that is needed to fix it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The apiv4 suite should probably unset Civi::statics
like the main suite does -
\Civi::$statics = []; |
9891f3a
to
353d609
Compare
Yep - I remember this part of the process
I can't recall the underlying issue for those fails - - but it is to do with the full text indexes in some way |
434b012
to
747f2b6
Compare
@seamuslee001 if you can win this fight then go ahead & merge :-) |
Yeah - this is about the point I gave up & decided that we should only test lack-of-support-for-utf8mb4 on databases that don't support utf8mb4 :-) Stacktrace /home/jenkins/bknix-dfl/build/core-21001-6c1u3/web/sites/all/modules/civicrm/Civi/Test/Api3TestTrait.php:199 |
…e in the v3 version of the test and fix handling for first name field
747f2b6
to
9787e1b
Compare
woot - sheer determination - take that jenkins |
well done |
…e in the v3 version of the test and fix handling for first name field
Overview
This is a follow on to #20905 which improves the APIv3 version of the test to do the faking of the database to test the re-writing of the query. It also properly fixes the handling for the v3 unit test.
Before
APIv4 unit test fails
After
V4 and V3 unit tests pass in a similar manner
ping @demeritcowboy @eileenmcnaughton