Skip to content

Commit

Permalink
[TASK] Use own configuration files for tests
Browse files Browse the repository at this point in the history
Resolves: #902
  • Loading branch information
lukaszuznanski committed Oct 17, 2023
1 parent 28523ea commit 2925abd
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 4 deletions.
42 changes: 42 additions & 0 deletions Tests/Functional/FunctionalTests.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<phpunit
backupGlobals="true"
bootstrap="../../.Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTestsBootstrap.php"
cacheResult="false"
colors="true"
convertErrorsToExceptions="true"
convertWarningsToExceptions="true"
convertDeprecationsToExceptions="true"
convertNoticesToExceptions="true"
forceCoversAnnotation="false"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
verbose="false"
beStrictAboutTestsThatDoNotTestAnything="false"
failOnWarning="true"
failOnRisky="true"
>
<testsuites>
<testsuite name="Functional tests">
<!--
This path either needs an adaption in extensions, or an extension's
test location path needs to be given to phpunit.
-->
<directory suffix="Test.php">./</directory>
</testsuite>
</testsuites>
<php>
<!-- @deprecated: will be removed with next major version, constant TYPO3_MODE is deprecated -->
<const name="TYPO3_MODE" value="BE" />
<!--
@deprecated: Set this to not suppress warnings, notices and deprecations in functional tests
with TYPO3 core v11 and up.
Will always be done with next major version.
To still suppress warnings, notices and deprecations, do NOT define the constant at all.
-->
<const name="TYPO3_TESTING_FUNCTIONAL_REMOVE_ERROR_HANDLER" value="true" />
<ini name="display_errors" value="1" />
<env name="TYPO3_CONTEXT" value="Testing" />
</php>
</phpunit>
46 changes: 46 additions & 0 deletions Tests/Unit/UnitTests.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<phpunit
backupGlobals="true"
bootstrap="../../.Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTestsBootstrap.php"
cacheResult="false"
colors="true"
convertDeprecationsToExceptions="true"
convertErrorsToExceptions="true"
convertWarningsToExceptions="true"
convertNoticesToExceptions="true"
forceCoversAnnotation="false"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
verbose="false"
beStrictAboutTestsThatDoNotTestAnything="false"
failOnWarning="true"
failOnRisky="true"
>
<testsuites>
<testsuite name="Unit tests">
<!--
This path either needs an adaption in extensions, or an extension's
test location path needs to be given to phpunit.
-->
<directory suffix="Test.php">./</directory>
</testsuite>
</testsuites>
<!-- @todo: change tag to 'coverage' when TF requires phpunit > 9 -->
<filter>
<!-- @todo: change tag to 'include' when TF requires phpunit > 9 -->
<whitelist>
<!--
This path needs an adaption in extensions, when coverage statistics are wanted.
-->
<directory>../../../../../../typo3/sysext/*/Classes/</directory>
</whitelist>
</filter>
<php>
<!-- @deprecated: will be removed with next major version, constant TYPO3_MODE is deprecated -->
<const name="TYPO3_MODE" value="BE" />
<ini name="display_errors" value="1" />
<env name="TYPO3_CONTEXT" value="Testing" />
</php>
</phpunit>
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@
],
"ci:coverage:functional": [
"@coverage:create-directories",
".Build/bin/phpunit -c .Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTests.xml --whitelist Classes --coverage-php=.Build/coverage/functional.cov Tests/Functional"
".Build/bin/phpunit -c ./Tests/Functional/FunctionalTests.xml --whitelist Classes --coverage-php=.Build/coverage/functional.cov Tests/Functional"
],
"ci:coverage:merge": [
"@coverage:create-directories",
"@php tools/phpcov merge --clover=./.Build/logs/clover.xml ./.Build/coverage/"
],
"ci:coverage:unit": [
"@coverage:create-directories",
".Build/bin/phpunit -c .Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTests.xml --whitelist Classes --coverage-php=.Build/coverage/unit.cov Tests/Unit"
".Build/bin/phpunit -c ./Tests/Unit/UnitTests.xml --whitelist Classes --coverage-php=.Build/coverage/unit.cov Tests/Unit"
],
"ci:dynamic": [
"@ci:tests"
Expand Down Expand Up @@ -148,8 +148,8 @@
"@ci:tests:unit",
"@ci:tests:functional"
],
"ci:tests:functional": "find 'Tests/Functional' -wholename '*Test.php' | parallel --gnu 'echo; echo \"Running functional test suite {}\"; .Build/bin/phpunit -c .Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTests.xml {}';",
"ci:tests:unit": ".Build/bin/phpunit -c .Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTests.xml Tests/Unit",
"ci:tests:functional": "find 'Tests/Functional' -wholename '*Test.php' | parallel --gnu 'echo; echo \"Running functional test suite {}\"; .Build/bin/phpunit -c ./Tests/Functional/FunctionalTests.xml {}';",
"ci:tests:unit": ".Build/bin/phpunit -c ./Tests/Unit/UnitTests.xml Tests/Unit",
"ci:ts:lint": "typoscript-lint -c Configuration/TsLint.yml --ansi -n --fail-on-warnings -vvv Configuration/TypoScript",
"ci:yaml:lint": "find . ! -path '*.Build/*' ! -path '*node_modules/*' -regextype egrep -regex '.*.ya?ml$' | xargs -r php ./.Build/bin/yaml-lint",
"coverage:create-directories": "mkdir -p .Build/logs .Build/coverage",
Expand Down

0 comments on commit 2925abd

Please sign in to comment.