Skip to content

Commit

Permalink
[FEATURE] Add functional tests to runTests.sh, make and github action
Browse files Browse the repository at this point in the history
Delete the outdated .travis file
  • Loading branch information
linawolf committed Jun 4, 2024
1 parent 0c75c6a commit f99e95f
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 26 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,29 @@ jobs:
- name: unit
run: Build/Scripts/runTests.sh -n -p ${{ matrix.php }} -s unit

functional:
name: Functional
runs-on: ubuntu-latest
strategy:
matrix:
php:
- '7.4'
- '8.0'
- '8.1'
- '8.2'
- '8.3'
db:
- 'mysql'
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install testing system
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s composerUpdate

- name: Lint PHP
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s functional -d ${{ matrix.db }}

code-quality:
name: Code quality
runs-on: ubuntu-latest
Expand Down
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions Build/Scripts/runTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ fi
# @todo Consider to switch from cgl to help as default
TEST_SUITE="cgl"
DATABASE_DRIVER=""
DBMS="sqlite"
DBMS="mysql"
DBMS_VERSION=""
PHP_VERSION="7.4"
PHP_XDEBUG_ON=0
Expand Down Expand Up @@ -336,7 +336,7 @@ fi

handleDbmsOptions

COMPOSER_ROOT_VERSION="13.0.x-dev"
COMPOSER_ROOT_VERSION="7.2.0-dev"
HOST_UID=$(id -u)
USERSET=""
if [ $(uname) != "Darwin" ]; then
Expand Down Expand Up @@ -475,7 +475,7 @@ case ${TEST_SUITE} in
;;
functional)
CONTAINER_PARAMS=""
COMMAND=(.Build/bin/phpunit -c Build/phpunit/FunctionalTests.xml --exclude-group not-${DBMS} ${EXTRA_TEST_OPTIONS} "$@")
COMMAND=(.Build/bin/phpunit -c .Build/bin/phpunit -c .Build/vendor/nimut/testing-framework/res/Configuration/FunctionalTests.xml Tests/Functional/ --exclude-group not-${DBMS} ${EXTRA_TEST_OPTIONS} "$@")
case ${DBMS} in
mariadb)
echo "Using driver: ${DATABASE_DRIVER}"
Expand Down
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ test-unit-8-3: ## Run unit tests with PHP 8.3 (highest supported by TYPO3 11)
.PHONY: test-unit
test-unit: test-unit-7-4 test-unit-8-3## Run unit tests with PHP 7.4 and 8.3

.PHONY: test-functional-7-4
test-functional-7-4: ## Run functional tests with PHP 7.4 and mariadb (lowest)
Build/Scripts/runTests.sh -s functional -p 7.4 -d mariadb

.PHONY: test-functional-8-3
test-functional-8-3: ## Run functional tests with PHP 8.3 and mariadb (highest supported by TYPO3 11)
Build/Scripts/runTests.sh -s functional -p 8.3 -d mariadb

.PHONY: test-functional
test-functional: test-functional-7-4 test-functional-8-3## Run functional tests with PHP 7.4 and 8.3

.PHONY: phpstan
phpstan: ## Run phpstan tests
Build/Scripts/runTests.sh -s phpstan
Expand All @@ -50,4 +61,4 @@ phpstan-baseline: ## Update the phpstan baseline
Build/Scripts/runTests.sh -s phpstanBaseline

.PHONY: test
test: test-cgl phpstan test-docs test-unit## Run all tests
test: test-cgl phpstan test-docs test-unit test-functional## Run all tests
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"cobweb/svconnector": "^5.0"
},
"require-dev": {
"cobweb/externalimport_test": "^0.14.0",
"cobweb/svconnector_csv": "^4.1",
"cobweb/svconnector_feed": "^4.1",
"ergebnis/composer-normalize": "~2.42.0",
Expand Down

0 comments on commit f99e95f

Please sign in to comment.