cpan-testers / cpantesters-backend

Backend data processing for CPAN Testers
Other
0 stars 4 forks source link

Restrict tests to correct MySQL version #19

Closed paultcochrane closed 6 years ago

paultcochrane commented 6 years ago

These changes ensure that the tests requiring MySQL only run if a MySQL or MariaDB version are sufficiently recent so as to support the JSON field. This PR thus addresses issue #8.

preaction commented 6 years ago

This is great, and I'm merging it, but it also seems like the database detection code could be useful to a lot of the CPAN::Testers tests. There's a ticket like #8 in a lot of these repos ;)

As a future task, that code could be made into a method on the CPAN::Testers::Schema object to check if the database is supported. If the database isn't fully supported, it could throw an exception with information about why ("This is MariaDB v1 and we need MariaDB v5" or "This is Postgres and we don't support Postgres yet"). Then we could run this in every test that needs to use MySQL's JSON support.

Thanks!