From f99e95f0f1e62b9e3f94cff896e8a4c02fdc64c5 Mon Sep 17 00:00:00 2001 From: "lina.wolf" Date: Mon, 3 Jun 2024 15:27:39 +0200 Subject: [PATCH] [FEATURE] Add functional tests to runTests.sh, make and github action Delete the outdated .travis file --- .github/workflows/tests.yml | 23 +++++++++++++++++++++++ .travis.yml | 22 ---------------------- Build/Scripts/runTests.sh | 6 +++--- Makefile | 13 ++++++++++++- composer.json | 1 + 5 files changed, 39 insertions(+), 26 deletions(-) delete mode 100644 .travis.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ea2a8af0..ce83100d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 906cff12..00000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: php -php: - - 7.2 - - 7.3 - - 7.4 - - 8.0 -branches: - only: - - master - - bettong -before_script: - - composer require nimut/testing-framework - - composer require cobweb/svconnector_feed - - composer require cobweb/svconnector_csv -script: - - phpunit --colors -c vendor/nimut/testing-framework/res/Configuration/UnitTests.xml Tests/Unit/ -# - > -# export typo3DatabaseName="typo3"; -# export typo3DatabaseHost="localhost"; -# export typo3DatabaseUsername="root"; -# export typo3DatabasePassword=""; -# phpunit --colors -c vendor/nimut/testing-framework/res/Configuration/FunctionalTests.xml Tests/Functional/; diff --git a/Build/Scripts/runTests.sh b/Build/Scripts/runTests.sh index 74438c39..3fa78539 100755 --- a/Build/Scripts/runTests.sh +++ b/Build/Scripts/runTests.sh @@ -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 @@ -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 @@ -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}" diff --git a/Makefile b/Makefile index dcb78db8..bfedff8b 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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 diff --git a/composer.json b/composer.json index 4e0ee789..a009279d 100644 --- a/composer.json +++ b/composer.json @@ -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",