Skip to content

Commit 8429659

Browse files
authored
Merge pull request #65130 from nextcloud/backport/62491/stable33
[stable33] test: enable filecache partitioning for one mysql test
2 parents cd87439 + 941be9d commit 8429659

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

‎.github/workflows/phpunit-mysql.yml‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ jobs:
6464
include:
6565
- mysql-versions: '8.4'
6666
php-versions: '8.5'
67+
partitioning: true
6768

68-
name: MySQL ${{ matrix.mysql-versions }} (PHP ${{ matrix.php-versions }}) - database tests
69+
name: MySQL ${{ matrix.mysql-versions }} (PHP ${{ matrix.php-versions }})${{ case(matrix.partitioning || false, ' Partitioning', '') }} - database tests
6970

7071
services:
7172
cache:
@@ -123,9 +124,21 @@ jobs:
123124
NC_debug=true ./occ testing:prepare-ci
124125
php -f tests/enable_all.php
125126
127+
- name: Enable partitioning for oc_filecache
128+
if: ${{ matrix.partitioning }}
129+
run: |
130+
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
131+
echo "alter table oc_filecache partition by hash(storage) partitions 5;" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword nextcloud
132+
126133
- name: PHPUnit
127134
run: composer run test:db -- --log-junit junit.xml
128135

136+
- name: Show partition info
137+
if: ${{ matrix.partitioning }}
138+
run: |
139+
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
140+
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
141+
129142
- name: Upload test results
130143
if: ${{ !cancelled() }}
131144
uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # v1.2.1

0 commit comments

Comments
 (0)