-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Test] Optimized pdo_mysql tests #12555
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
[Test] Optimized pdo_mysql tests #12555
Conversation
77ca72d
to
fedccd1
Compare
fedccd1
to
4b16c62
Compare
ext/pdo_mysql/tests/bug53551.phpt
Outdated
$createSql = "CREATE TABLE `test` ( | ||
`count` bigint(20) unsigned NOT NULL DEFAULT '0' | ||
)"; | ||
|
||
$db->exec('drop table if exists bug53551'); | ||
$db->exec('drop table if exists test'); | ||
$db->exec($createSql); | ||
$db->exec("insert into bug53551 set `count` = 1 "); | ||
$db->exec("insert into test set `count` = 1 "); | ||
$db->exec("SET sql_mode = 'Traditional'"); | ||
$sql = 'UPDATE bug53551 SET `count` = :count'; | ||
$sql = 'UPDATE test SET `count` = :count'; | ||
$stmt = $db->prepare($sql); |
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.
Please do not do this, each test should use it's own table so we can run them in parallel, and this also goes against #11879
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.
This clashes with #11879 and from a glance most of this should be dropped as it is using a common table for all tests which is something we are actively worked to undo as it prevents running tests in parallel.
4b16c62
to
a6e29ab
Compare
@Girgias |
a6e29ab
to
b2df20d
Compare
4c86a38
to
64ba080
Compare
64ba080
to
f3280f7
Compare
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'init.inc'); | ||
require_once(dirname(__FILE__) . str_replace('/', DIRECTORY_SEPARATOR, '/../../../../ext/pdo/tests/pdo_test.inc')); | ||
|
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.
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'init.inc'); | |
require_once(dirname(__FILE__) . str_replace('/', DIRECTORY_SEPARATOR, '/../../../../ext/pdo/tests/pdo_test.inc')); | |
require_once __DIR__ . DIRECTORY_SEPARATOR . 'init.inc'; | |
require_once dirname(__DIR__, 4) . '/ext/pdo/tests/pdo_test.inc'; |
No need to convert paths for Windows, also do not use parenthesis around require as it is not a function but a language construct and the semantics are slightly different.
[wip]
PDO's test specifications, especially the config, are too different, so I'm trying to unify them to some extent and make the tests easier to understand. However, changing everything at once would result in too many diffs, so I started with pdo_mysql first.
MySQLPDOTest
methods so that they can be reused.Other fixes
PDOTest
and others usedMySQLPDOTest
, we unified them intoMySQLPDOTest
.common.phpt
is no longer needed, so I removed it. (I'm thinking of deletingcommon.phpt
for other PDO drivers as well.)For some tests that only use one table, the table name has been unified to "test".--CLEAN--
to tests that need to be cleaned up but have not been cleaned up.table.inc
is not used so I deleted it.The number of files is still quite large, so if you would like to split it up further, please let me know.