Skip to content

Commit 7e9034a

Browse files
authored
[5.4] Add mysql to test matrix and proper min max db versions (joomla#46186)
* Add mysql to test system matrix and proper min max db versions * Extend integration tests * Load constants from env
1 parent eda3c74 commit 7e9034a

File tree

9 files changed

+177
-157
lines changed

9 files changed

+177
-157
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ plugins/finder/* @hackwar
99
build/build.php @rdeutz
1010
build/bump.php @rdeutz
1111
build/deleted_file_check.php @rdeutz
12+
.drone.yml @rdeutz @hackwar
1213

1314
# Core/Extension Install/Update Tools
1415
administrator/components/com_joomlaupdate/* @rdeutz
@@ -19,9 +20,7 @@ libraries/src/Updater/* @rdeutz
1920
.github/workflows/ci.yml @rdeutz @hackwar @laoneo
2021
tests/* @hackwar @laoneo
2122
tests/Unit/* @rdeutz @laoneo
22-
.drone.yml @rdeutz @hackwar @laoneo
2323
phpunit.xml.dist @rdeutz @hackwar @laoneo
24-
phpunit-pgsql.xml.dist @rdeutz @hackwar @laoneo
2524
phpunit-windows.xml.dist @rdeutz @hackwar @laoneo
2625

2726
# Workflow

.github/workflows/ci.yml

Lines changed: 64 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,31 @@ jobs:
134134
strategy:
135135
matrix:
136136
php_version: ['8.1', '8.2', '8.3', '8.4']
137-
config: ['phpunit.xml.dist', 'phpunit-pgsql.xml.dist']
137+
config:
138+
- my_version: '8.4'
139+
engine: 'mysqli'
140+
host: 'mysql'
141+
user: 'joomla_ut'
142+
- my_version: '8.0.13'
143+
engine: 'mysqli'
144+
host: 'mysql'
145+
user: 'joomla_ut'
146+
- maria_version: '12.0'
147+
engine: 'mysqli'
148+
host: 'maria'
149+
user: 'joomla_ut'
150+
- maria_version: '10.4'
151+
engine: 'mysqli'
152+
host: 'maria'
153+
user: 'joomla_ut'
154+
- pg_version: '12.0'
155+
engine: 'pgsql'
156+
host: 'postgres'
157+
user: 'root'
158+
- pg_version: '18.0'
159+
engine: 'pgsql'
160+
host: 'postgres'
161+
user: 'root'
138162
steps:
139163
- uses: actions/checkout@v4
140164
- name: Start LDAP container
@@ -146,23 +170,36 @@ jobs:
146170
path: libraries/vendor
147171
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
148172
- name: Run Integration tests
173+
env:
174+
JTEST_DB_ENGINE: ${{ matrix.config.engine }}
175+
JTEST_DB_HOST: ${{ matrix.config.host }}
176+
JTEST_DB_USER: ${{ matrix.config.user }}
177+
JTEST_DB_NAME: test_joomla
178+
JTEST_DB_PASSWORD: joomla_ut
149179
run: |
150180
sleep 3
151-
./libraries/vendor/bin/phpunit --testsuite Integration --configuration ${{ matrix.config }}
181+
./libraries/vendor/bin/phpunit --testsuite Integration --configuration phpunit.xml.dist
152182
- name: Stop LDAP container
153183
uses: docker://docker
154184
with:
155185
args: docker kill openldap
156186
services:
157187
mysql:
158-
image: mariadb
188+
image: mysql:${{ matrix.config.my_version || '8.4' }}
189+
env:
190+
MYSQL_USER: joomla_ut
191+
MYSQL_PASSWORD: joomla_ut
192+
MYSQL_ROOT_PASSWORD: joomla_ut
193+
MYSQL_DATABASE: test_joomla
194+
maria:
195+
image: mariadb:${{ matrix.config.maria_version || '12.0' }}
159196
env:
160197
MARIADB_USER: joomla_ut
161198
MARIADB_PASSWORD: joomla_ut
162199
MARIADB_ROOT_PASSWORD: joomla_ut
163200
MARIADB_DATABASE: test_joomla
164201
postgres:
165-
image: postgres:12-alpine
202+
image: postgres:${{ matrix.config.pg_version || '18' }}-alpine
166203
env:
167204
POSTGRES_USER: root
168205
POSTGRES_PASSWORD: joomla_ut
@@ -270,18 +307,32 @@ jobs:
270307
test_group: cmysqlmax
271308
db_engine: mysqli
272309
db_host: mysql
310+
my_version: '8.4'
273311
- php_version: '8.1'
274312
test_group: cmysql
275313
db_engine: mysqli
276314
db_host: mysql
315+
my_version: '8.0.13'
316+
- php_version: '8.4'
317+
test_group: cmariamax
318+
db_engine: mysqli
319+
db_host: maria
320+
maria_version: '12.0'
321+
- php_version: '8.1'
322+
test_group: cmaria
323+
db_engine: mysqli
324+
db_host: maria
325+
maria_version: '10.4'
277326
- php_version: '8.1'
278327
test_group: cpostgres
279328
db_engine: pgsql
280329
db_host: postgres
330+
pg_version: '12.0'
281331
- php_version: '8.4'
282332
test_group: cpostgresmax
283333
db_engine: pgsql
284334
db_host: postgres
335+
pg_version: '18.0'
285336
env:
286337
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
287338
steps:
@@ -313,14 +364,21 @@ jobs:
313364
if-no-files-found: ignore
314365
services:
315366
mysql:
316-
image: mariadb
367+
image: mysql:${{ matrix.config.my_version || '8.4' }}
368+
env:
369+
MYSQL_USER: joomla_ut
370+
MYSQL_PASSWORD: joomla_ut
371+
MYSQL_ROOT_PASSWORD: joomla_ut
372+
MYSQL_DATABASE: test_joomla
373+
maria:
374+
image: mariadb:${{ matrix.config.maria_version || '12.0' }}
317375
env:
318376
MARIADB_USER: joomla_ut
319377
MARIADB_PASSWORD: joomla_ut
320378
MARIADB_ROOT_PASSWORD: joomla_ut
321379
MARIADB_DATABASE: test_joomla
322380
postgres:
323-
image: postgres:12-alpine
381+
image: postgres:${{ matrix.config.pg_version || '18' }}-alpine
324382
env:
325383
POSTGRES_USER: root
326384
POSTGRES_PASSWORD: joomla_ut

build/build.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,6 @@ function capture_or_fail(string $command): string
451451
'package.json',
452452
'phpstan-baseline.neon',
453453
'phpstan.neon',
454-
'phpunit-pgsql.xml.dist',
455454
'phpunit-windows.xml.dist',
456455
'phpunit.xml.dist',
457456
'plugins/sampledata/testing/language/en-GB/en-GB.plg_sampledata_testing.ini',

0 commit comments

Comments
 (0)