Skip to content

[Tests] Optimized pdo_odbc tests #12654

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SakiTakamachi
Copy link
Member

@SakiTakamachi SakiTakamachi commented Nov 12, 2023

Related to the following PR.
#12555

I made the config a little easier to understand and changed the table name so that it can be executed in parallel with pdo core and ext/odbc tests.

(I don't think it's very likely that table names will overlap with pdo core or ext/odbc, but I thought about the possibility of that happening in the future.)

@SakiTakamachi SakiTakamachi force-pushed the optimize-pdo-odbc-tests branch 3 times, most recently from a831cd0 to 969b544 Compare November 12, 2023 09:09
Comment on lines +40 to +43
try {
$db = self::factory();
} catch (PDOException $e) {
die('skip could not connect');
}
Copy link
Member Author

Choose a reason for hiding this comment

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

I would like to eventually make parent skip like this, but the scope is too wide, so I won't change it yet in this PR.

@SakiTakamachi SakiTakamachi force-pushed the optimize-pdo-odbc-tests branch 2 times, most recently from 2fed51c to 74bbe7a Compare November 12, 2023 10:56
@Girgias Girgias requested a review from kocsismate November 12, 2023 13:35
@SakiTakamachi SakiTakamachi force-pushed the optimize-pdo-odbc-tests branch from 74bbe7a to 341ce59 Compare November 17, 2023 14:06
Copy link
Member

@NattyNarwhal NattyNarwhal left a comment

Choose a reason for hiding this comment

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

This refactor LGTM. I have an obvious nitpick, but the rest is fine, I trust your judgement here.

The Access bit is clever; I remember there were some other funny ODBC drivers that came out of the box on Windows (like a CSV one), but Access is the one that’s probably actually reliable.

}
}

static function skipToofewCredentials() {
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick: should be skipTooFewCredentials

$db->exec("DROP TABLE IF EXISTS bug80783a");
require_once __DIR__ . '/inc/odbc_pdo_test.inc';
$db = ODBCPDOTest::factory();
$db->exec("DROP TABLE IF EXISTS bug80783a_pdo_odbc");
Copy link
Member

Choose a reason for hiding this comment

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

General comment on the pattern: I like removing the hardcoded table names from the query strings. It’s a little annoying that it has to be hardcoded here after it was unhardcoded for all the tests in their FILE sections, but I see why you probably didn’t do it for CLEAN (it’d be an ugly use of ENV/ARGS, and I’m not sure if those get propagated to CLEAN to begin with).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants