diff --git a/.github/workflows/matomo-tests.yml b/.github/workflows/matomo-tests.yml index 296bda512aa..c6eda173575 100644 --- a/.github/workflows/matomo-tests.yml +++ b/.github/workflows/matomo-tests.yml @@ -48,7 +48,7 @@ jobs: matrix: type: [ 'UnitTests', 'SystemTestsPlugins', 'SystemTestsCore', 'IntegrationTestsCore', 'IntegrationTestsPlugins' ] php: [ '7.2', '8.2', '8.3' ] - engine: [ 'Mysql', 'Mariadb' ] + engine: [ 'Tidb' ] adapter: [ 'PDO_MYSQL', 'MYSQLI' ] exclude: - php: '7.2' @@ -138,6 +138,7 @@ jobs: test-type: 'UI' php-version: '7.2' node-version: '16' + mysql-engine: 'Tidb' redis-service: true artifacts-pass: ${{ secrets.ARTIFACTS_PASS }} upload-artifacts: true diff --git a/core/Updates/1.2-rc1.php b/core/Updates/1.2-rc1.php index f6c87e920b6..0367b709490 100644 --- a/core/Updates/1.2-rc1.php +++ b/core/Updates/1.2-rc1.php @@ -47,9 +47,11 @@ public function getMigrations(Updater $updater) return array( // Various performance improvements schema updates $this->migration->db->sql('ALTER TABLE `' . Common::prefixTable('log_visit') . '` - DROP `visit_server_date`, DROP INDEX `index_idsite_date_config`, - DROP INDEX `index_idsite_datetime_config`, + DROP INDEX `index_idsite_datetime_config` + ', array(Updater\Migration\Db::ERROR_CODE_UNKNOWN_COLUMN, Updater\Migration\Db::ERROR_CODE_COLUMN_NOT_EXISTS)), + $this->migration->db->sql('ALTER TABLE `' . Common::prefixTable('log_visit') . '` + DROP `visit_server_date`, ADD `idvisitor` BINARY(8) NOT NULL AFTER `idsite`, ADD `config_id` BINARY(8) NOT NULL AFTER `config_md5config` ', array(Updater\Migration\Db::ERROR_CODE_UNKNOWN_COLUMN, Updater\Migration\Db::ERROR_CODE_COLUMN_NOT_EXISTS)), diff --git a/tests/PHPUnit/System/BackwardsCompatibility1XTest.php b/tests/PHPUnit/System/BackwardsCompatibility1XTest.php index 99c249183a7..14c0481eb10 100644 --- a/tests/PHPUnit/System/BackwardsCompatibility1XTest.php +++ b/tests/PHPUnit/System/BackwardsCompatibility1XTest.php @@ -10,6 +10,7 @@ namespace Piwik\Tests\System; use Piwik\Common; +use Piwik\Config\DatabaseConfig; use Piwik\Db; use Piwik\Plugin\Manager; use Piwik\Plugins\VisitFrequency\API as VisitFrequencyApi; @@ -34,6 +35,10 @@ public static function setUpBeforeClass(): void { parent::setUpBeforeClass(); + if (DatabaseConfig::getConfigValue('schema') === 'Tidb') { + self::markTestSkipped('TiDb can only be used as of Matomo 5.2+, so updating from older versions is unsupported'); + } + $installedPlugins = Manager::getInstance()->getInstalledPluginsName(); // ensure all plugins are installed correctly (some plugins database tables would be missing otherwise) diff --git a/tests/PHPUnit/phpunit.xml.dist b/tests/PHPUnit/phpunit.xml.dist index 0af257f09b7..52a4a469970 100644 --- a/tests/PHPUnit/phpunit.xml.dist +++ b/tests/PHPUnit/phpunit.xml.dist @@ -15,7 +15,7 @@ stopOnFailure="false" stopOnIncomplete="false" stopOnSkipped="false" - testdox="false" + testdox="true" verbose="true">