You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Our test suite contains tests and fixtures which execute MySQL specific DDL statements. In order to support alternative databases we need to abstract these statements to the core/Db class or PDO adapter. Ideally tests and fixtures should never execute DDL statements directly.
Suggested Approach
Identify MySQL specific tests that only make sense to run on MySQL, adjust these tests to check which PDO adapter is in use and markTestSkipped if not running the MySQL PDO adapter.
Non-db specific tests and fixtures that directly create tables or databases need to be abstracted to methods in core/Db which could then abstract to the PDO adapter as needed.
Integration tests depend on the OmniFixture database dump which is MySQL specific:
Rename the OmniFixture dump based on the database adapter name is it suited for, ie. OmniFixture-dump-mysql.sql.
A new getOmniFixtureFilename() method should be added to core/Db/AdapterInterface this will return the OmniFixture filename to use so PDO Adapters can share the same dump if required. The standard Matomo MySQL PDO adapter should return OmniFixture-dump-mysql.sql.
Integration testing code should use the chosen PDO Adapter getOmniFixtureFilename() method to determine the OmniFixture data to load. Future PDO adapters can then override this method load data suitable for their schema.
Clean up the instructions and commands around generating new OmniFixture dumps.
The text was updated successfully, but these errors were encountered:
bx80
added
the
Enhancement
For new feature suggestions that for example enhance Matomo's cabapilities..
label
Aug 19, 2022
Our test suite contains tests and fixtures which execute MySQL specific DDL statements. In order to support alternative databases we need to abstract these statements to the
core/Db
class or PDO adapter. Ideally tests and fixtures should never execute DDL statements directly.Suggested Approach
Identify MySQL specific tests that only make sense to run on MySQL, adjust these tests to check which PDO adapter is in use and
markTestSkipped
if not running the MySQL PDO adapter.Non-db specific tests and fixtures that directly create tables or databases need to be abstracted to methods in
core/Db
which could then abstract to the PDO adapter as needed.Integration tests depend on the OmniFixture database dump which is MySQL specific:
Rename the OmniFixture dump based on the database adapter name is it suited for, ie.
OmniFixture-dump-mysql.sql
.A new
getOmniFixtureFilename()
method should be added tocore/Db/AdapterInterface
this will return the OmniFixture filename to use so PDO Adapters can share the same dump if required. The standard Matomo MySQL PDO adapter should returnOmniFixture-dump-mysql.sql
.Integration testing code should use the chosen PDO Adapter
getOmniFixtureFilename()
method to determine the OmniFixture data to load. Future PDO adapters can then override this method load data suitable for their schema.Clean up the instructions and commands around generating new OmniFixture dumps.
The text was updated successfully, but these errors were encountered: