diff --git a/.github/workflows/phpunit-mysql.yml b/.github/workflows/phpunit-mysql.yml index d36945245c993..a6ae02fd40f01 100644 --- a/.github/workflows/phpunit-mysql.yml +++ b/.github/workflows/phpunit-mysql.yml @@ -24,10 +24,12 @@ jobs: include: - mysql-versions: '8.4' php-versions: '8.3' + partitioning: false - mysql-versions: '9.7' php-versions: '8.5' + partitioning: true - name: MySQL ${{ matrix.mysql-versions }} (PHP ${{ matrix.php-versions }}) - database tests + name: MySQL ${{ matrix.mysql-versions }} (PHP ${{ matrix.php-versions }})${{ case(matrix.partitioning, ' Partitioning', '') }} - database tests services: cache: @@ -86,12 +88,24 @@ jobs: ./occ maintenance:install --verbose --database=mysql --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin php -f tests/enable_all.php + - name: Enable partitioning for oc_filecache + if: ${{ matrix.partitioning }} + run: | + echo "alter table oc_filecache drop primary key, add primary key (fileid, storage);" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword nextcloud + echo "alter table oc_filecache partition by hash(storage) partitions 5;" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword nextcloud + - name: PHPUnit run: composer run test:db -- --log-junit junit.xml env: DB_ROOT_USER: root DB_ROOT_PASS: rootpassword + - name: Show partition info + if: ${{ matrix.partitioning }} + run: | + echo "SELECT table_name, partition_name, table_rows FROM information_schema.partitions WHERE partition_name is not null;" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword nextcloud + echo "SELECT table_rows FROM information_schema.tables WHERE table_name = 'oc_filecache';" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword nextcloud + - name: Print logs if: always() run: |