[WIP] Add PDO Basic connection tests #12443
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is WIP
Before proceeding with this, what is done in
config.inc
andcommon.phpt
for each PDO driver is too different, so it might be better to make it common.....Overview
There are a bit problem with the current database-related tests. Since a failure to connect to the database is a condition for skipping the test, CI cannot detect when the connection process itself is broken. Strictly speaking, you can find "strange" skips by looking at test artifacts, but it's very unlikely that a developer will look at it every time.
So I propose to add a very simple connection test. Those tests rely on whether
fsockopen
succeeds to decide whether to skip. If successful, it assumes that the database can be connected and attempts to test the connection.These tests allow us to detect when a connection process is broken by CI failure.
What I'm worried about
I don't have any good ideas yet about what to do with SQLite.
About drivers other than PDO
I think it's difficult to check if I make a lot of changes all at once, so I'm starting with PDO first.
Current status
Since there are too many differences in config.inc etc. for each driver, I decided to organize that first.
This PR will remain in draft form for a while.
Tasks