Skip to content
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

[POC] Run tests with TiDb #22180

Draft
wants to merge 4 commits into
base: 5.x-dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/matomo-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
6 changes: 4 additions & 2 deletions core/Updates/1.2-rc1.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down
5 changes: 5 additions & 0 deletions tests/PHPUnit/System/BackwardsCompatibility1XTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/PHPUnit/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
testdox="false"
testdox="true"
verbose="true">

<testsuites>
Expand Down
Loading