[TASK] Allow defining test instance files copy for acceptance tests#664
Merged
[TASK] Allow defining test instance files copy for acceptance tests#664
Conversation
b53e9dc to
cf142c9
Compare
Running acceptance tests with codeception on a created
test instance with a real `Apache2` webserver requires
to have the `.htaccess` files in place, otherwise the
required rewriting to the endpoints will not work.
Since TYPO3 v13 with droppend backend entrypoint this
grows to a even higher requirement.
TYPO3 monorepo implemented that directly within the
extended `BackendEnvironment` class.
To make the live for developers easier using the
`typo3/testing-framework` for project or extension
acceptance testing a new tooling is now added based
on the direct monorepo implementation.
Following `BackendEnvironment::$config[]` options are
now available:
* `'copyInstanceFiles' => [],` (`array<string, string[]>`)
to copy the soureFile to all listed target paths.
* `'copyInstanceFilesCreateTargetPath' => true,` to
configure if target folders should be created when
missing or throw a excetion.
`BackendEnvironment` applies default files to copy based on
available core extensions:
* `EXT:backend`
source.: 'typo3/sysext/backend/Resources/Public/Icons/favicon.ico'
targets:
- 'favicon.ico'
* `EXT:install`
source.: 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/root-htaccess'
targets:
- '.htaccess'
source.: 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/fileadmin-temp-htaccess'
targets:
- 'fileadmin/_temp_/.htaccess'
source.: 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/fileadmin-temp-index.html'
targets:
- 'fileadmin/_temp_/index.html'
source.: 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/typo3temp-var-htaccess'
targets:
. 'typo3temp/var/.htaccess',
That way, additional files could be defined and configured
instead of implementing custom code in the extended class.
Note that files are always provided, which does not hurt
when not using `Apache2` as acceptance instance webserver.
Releases: main, 8
cf142c9 to
0bf4970
Compare
sbuerk
added a commit
to sbuerk/b13-container
that referenced
this pull request
Dec 5, 2024
… instance TYPO3 v13.0 dropped the backend entrypoint (`./typo3/index.php`) and made the main entrypoint (`./index.php`) capable of handling frontend and backend web requests to make the backend entrypoint finally configurable and required to change the rewrite rules for webservers to ensure backend requests hits the main entrypoint. The acceptance setup for `b13/container` is based on the TYPO3 monorepo setup using a real `Apache2` webserver instead of the PHP internal webserver and thus needs `.htaccess` rules to work. Providing needed `.htaccess` files has been added to the TYPO3 monorepo only and broke the setup for acceptance testing against TYPO3 v13. As a workaround providing the old backend entrypoint file has been implemented within the extended codeception setup method `BackendContainerEnvironment::bootstrapTypo3Environment()` which worked but is literally wrong. `typo3/testing-framework` now provides these files automatically, and the wrong workaround can be removed to cleanup the code base [1][2][3][4] and is backwards compatible for older TYPO3 versions. One phpstan ignore pattern can be now removed from all baselines. [1] TYPO3/testing-framework#663 [2] TYPO3/testing-framework#664 [3] ... [4] ...
sbuerk
added a commit
to sbuerk/b13-container
that referenced
this pull request
Dec 5, 2024
… instance TYPO3 v13.0 dropped the backend entrypoint (`./typo3/index.php`) and made the main entrypoint (`./index.php`) capable of handling frontend and backend web requests to make the backend entrypoint finally configurable and required to change the rewrite rules for webservers to ensure backend requests hits the main entrypoint. The acceptance setup for `b13/container` is based on the TYPO3 monorepo setup using a real `Apache2` webserver instead of the PHP internal webserver and thus needs `.htaccess` rules to work. Providing needed `.htaccess` files has been added to the TYPO3 monorepo only and broke the setup for acceptance testing against TYPO3 v13. As a workaround providing the old backend entrypoint file has been implemented within the extended codeception setup method `BackendContainerEnvironment::bootstrapTypo3Environment()` which worked but is literally wrong. `typo3/testing-framework` now provides these files automatically, and the wrong workaround can be removed to cleanup the code base [1][2][3][4] and is backwards compatible for older TYPO3 versions. One phpstan ignore pattern can be now removed from all baselines. [1] TYPO3/testing-framework#663 [2] TYPO3/testing-framework#664 [3] ... [4] ...
sbuerk
added a commit
to sbuerk/b13-container
that referenced
this pull request
Dec 5, 2024
… instance TYPO3 v13.0 dropped the backend entrypoint (`./typo3/index.php`) and made the main entrypoint (`./index.php`) capable of handling frontend and backend web requests to make the backend entrypoint finally configurable and required to change the rewrite rules for webservers to ensure backend requests hits the main entrypoint. The acceptance setup for `b13/container` is based on the TYPO3 monorepo setup using a real `Apache2` webserver instead of the PHP internal webserver and thus needs `.htaccess` rules to work. Providing needed `.htaccess` files has been added to the TYPO3 monorepo only and broke the setup for acceptance testing against TYPO3 v13. As a workaround providing the old backend entrypoint file has been implemented within the extended codeception setup method `BackendContainerEnvironment::bootstrapTypo3Environment()` which worked but is literally wrong. `typo3/testing-framework` now provides these files automatically, and the wrong workaround can be removed to cleanup the code base [1][2][3][4] and is backwards compatible for older TYPO3 versions. Some phpstan ignore pattern can be now removed from baselines and is done in the same run. [1] TYPO3/testing-framework#663 [2] TYPO3/testing-framework#664 [3] ... [4] ...
sbuerk
added a commit
to sbuerk/b13-container
that referenced
this pull request
Dec 5, 2024
… instance TYPO3 v13.0 dropped the backend entrypoint (`./typo3/index.php`) and made the main entrypoint (`./index.php`) capable of handling frontend and backend web requests to make the backend entrypoint finally configurable and required to change the rewrite rules for webservers to ensure backend requests hits the main entrypoint. The acceptance setup for `b13/container` is based on the TYPO3 monorepo setup using a real `Apache2` webserver instead of the PHP internal webserver and thus needs `.htaccess` rules to work. Providing needed `.htaccess` files has been added to the TYPO3 monorepo only and broke the setup for acceptance testing against TYPO3 v13. As a workaround providing the old backend entrypoint file has been implemented within the extended codeception setup method `BackendContainerEnvironment::bootstrapTypo3Environment()` which worked but is literally wrong. `typo3/testing-framework` now provides these files automatically, and the wrong workaround can be removed to cleanup the code base [1][2][3][4] and is backwards compatible for older TYPO3 versions. Some phpstan ignore pattern can be now removed from baselines and is done in the same run. [1] TYPO3/testing-framework#663 [2] TYPO3/testing-framework#664 [3] ... [4] ...
sbuerk
added a commit
to sbuerk/b13-container
that referenced
this pull request
Dec 5, 2024
…ance TYPO3 v13.0 dropped the backend entrypoint (`./typo3/index.php`) and made the main entrypoint (`./index.php`) capable of handling frontend and backend web requests to make the backend entrypoint finally configurable and required to change the rewrite rules for webservers to ensure backend requests hits the main entrypoint. The acceptance setup for `b13/container` is based on the TYPO3 monorepo setup using a real `Apache2` webserver instead of the PHP internal webserver and thus needs `.htaccess` rules to work. Providing needed `.htaccess` files has been added to the TYPO3 monorepo only and broke the setup for acceptance testing against TYPO3 v13. As a workaround providing the old backend entrypoint file has been implemented within the extended codeception setup method `BackendContainerEnvironment::bootstrapTypo3Environment()` which worked but is literally wrong. `typo3/testing-framework` now provides these files automatically, and the wrong workaround can be removed to cleanup the code base [1][2][3][4] and is backwards compatible for older TYPO3 versions. Some phpstan ignore pattern can be now removed from baselines and is done in the same run. [1] TYPO3/testing-framework#663 [2] TYPO3/testing-framework#664 [3] https://github.com/TYPO3/testing-framework/releases/tag/9.1.2 [4] https://github.com/TYPO3/testing-framework/releases/tag/8.2.7
achimfritz
pushed a commit
to b13/container
that referenced
this pull request
Dec 5, 2024
…ance TYPO3 v13.0 dropped the backend entrypoint (`./typo3/index.php`) and made the main entrypoint (`./index.php`) capable of handling frontend and backend web requests to make the backend entrypoint finally configurable and required to change the rewrite rules for webservers to ensure backend requests hits the main entrypoint. The acceptance setup for `b13/container` is based on the TYPO3 monorepo setup using a real `Apache2` webserver instead of the PHP internal webserver and thus needs `.htaccess` rules to work. Providing needed `.htaccess` files has been added to the TYPO3 monorepo only and broke the setup for acceptance testing against TYPO3 v13. As a workaround providing the old backend entrypoint file has been implemented within the extended codeception setup method `BackendContainerEnvironment::bootstrapTypo3Environment()` which worked but is literally wrong. `typo3/testing-framework` now provides these files automatically, and the wrong workaround can be removed to cleanup the code base [1][2][3][4] and is backwards compatible for older TYPO3 versions. Some phpstan ignore pattern can be now removed from baselines and is done in the same run. [1] TYPO3/testing-framework#663 [2] TYPO3/testing-framework#664 [3] https://github.com/TYPO3/testing-framework/releases/tag/9.1.2 [4] https://github.com/TYPO3/testing-framework/releases/tag/8.2.7
reviewtypo3org
pushed a commit
to TYPO3/typo3
that referenced
this pull request
Dec 6, 2024
Update `typo3/testing-framework` to ensure having latest
changes available and prepare for removing a temporary
solution added with #103297 and remove duplicated code
from codeception environment setup class which is now
provided with the new `typo3/testing-framework` releases
[1][2] containing [3][4][5].
Following updates are made depending on TYPO3 branch:
* main: update typo3/testing-framework:dev-main [5]
* 13.4: Require typo3/testing-framework:9.1.2 [3]
* 12.4: Require typo3/testing-framework:8.2.7 [4]
Used command(s):
> sed -i 's/typo3\/testing-framework:^9.0.3/typo3\/testing-framework:^9.1.2/g' \
Build/Scripts/setupAcceptanceComposer.sh
> composer require --no-update \
-d Build/tests/packages/dataset_import \
typo3/testing-framework:^9.1.2
> composer require --dev typo3/testing-framework:^9.1.2
Removing of temporary solution and duplicated code will
be handled with dedicated followup changes.
[1] https://github.com/TYPO3/testing-framework/releases/tag/9.1.2
[2] https://github.com/TYPO3/testing-framework/releases/tag/8.2.7
[3] TYPO3/testing-framework#663
[4] TYPO3/testing-framework#664
[5] TYPO3/testing-framework@e9c3bc4
Resolves: #105775
Related: #103297
Releases: main, 13.4, 12.4
Change-Id: I07b8cb50fae5967d6726c43c489ea1abd6fbea49
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/87384
Tested-by: core-ci <typo3@b13.com>
Tested-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: Garvin Hicking <gh@faktor-e.de>
Reviewed-by: Garvin Hicking <gh@faktor-e.de>
reviewtypo3org
pushed a commit
to TYPO3/typo3
that referenced
this pull request
Dec 6, 2024
Update `typo3/testing-framework` to ensure having latest changes available and prepare for removing a temporary solution added with #103297 and remove duplicated code from codeception environment setup class which is now provided with the new `typo3/testing-framework` releases [1][2] containing [3][4][5]. Following updates are made depending on TYPO3 branch: * main: update typo3/testing-framework:dev-main [5] * 13.4: Require typo3/testing-framework:9.1.2 [3] * 12.4: Require typo3/testing-framework:8.2.7 [4] Used command(s): > composer update typo3/testing-framework Removing of temporary solution and duplicated code will be handled with dedicated followup changes. [1] https://github.com/TYPO3/testing-framework/releases/tag/9.1.2 [2] https://github.com/TYPO3/testing-framework/releases/tag/8.2.7 [3] TYPO3/testing-framework#663 [4] TYPO3/testing-framework#664 [5] TYPO3/testing-framework@e9c3bc4 Resolves: #105775 Related: #103297 Releases: main, 13.4, 12.4 Change-Id: I07b8cb50fae5967d6726c43c489ea1abd6fbea49 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/87383 Tested-by: Benni Mack <benni@typo3.org> Tested-by: Andreas Kienast <akienast@scripting-base.de> Reviewed-by: Garvin Hicking <gh@faktor-e.de> Tested-by: Stefan Bürk <stefan@buerk.tech> Reviewed-by: Stefan Bürk <stefan@buerk.tech> Tested-by: core-ci <typo3@b13.com> Tested-by: Garvin Hicking <gh@faktor-e.de> Reviewed-by: Benni Mack <benni@typo3.org> Reviewed-by: Andreas Kienast <akienast@scripting-base.de>
reviewtypo3org
pushed a commit
to TYPO3/typo3
that referenced
this pull request
Dec 6, 2024
Update `typo3/testing-framework` to ensure having latest
changes available and prepare for removing a temporary
solution added with #103297 and remove duplicated code
from codeception environment setup class which is now
provided with the new `typo3/testing-framework` releases
[1][2] containing [3][4][5].
Following updates are made depending on TYPO3 branch:
* main: update typo3/testing-framework:dev-main [5]
* 13.4: Require typo3/testing-framework:9.1.2 [3]
* 12.4: Require typo3/testing-framework:8.2.7 [4]
Used command(s):
> sed -i 's/typo3\/testing-framework:^8.2.4/typo3\/testing-framework:^8.2.7/g' \
Build/Scripts/setupAcceptanceComposer.sh
> composer require --no-update \
-d Build/tests/packages/dataset_import \
typo3/testing-framework:^8.2.7
> composer require --dev typo3/testing-framework:^8.2.7
Removing of temporary solution and duplicated code will
be handled with dedicated followup changes.
[1] https://github.com/TYPO3/testing-framework/releases/tag/9.1.2
[2] https://github.com/TYPO3/testing-framework/releases/tag/8.2.7
[3] TYPO3/testing-framework#663
[4] TYPO3/testing-framework#664
[5] TYPO3/testing-framework@e9c3bc4
Resolves: #105775
Related: #103297
Releases: main, 13.4, 12.4
Change-Id: I07b8cb50fae5967d6726c43c489ea1abd6fbea49
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/87385
Tested-by: core-ci <typo3@b13.com>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Garvin Hicking <gh@faktor-e.de>
Tested-by: Garvin Hicking <gh@faktor-e.de>
Tested-by: Stefan Bürk <stefan@buerk.tech>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[TASK] Allow defining test instance files copy for acceptance tests
Running acceptance tests with codeception on a created
test instance with a real
Apache2webserver requiresto have the
.htaccessfiles in place, otherwise therequired rewriting to the endpoints will not work.
Since TYPO3 v13 with droppend backend entrypoint this
grows to a even higher requirement.
TYPO3 monorepo implemented that directly within the
extended
BackendEnvironmentclass.To make the live for developers easier using the
typo3/testing-frameworkfor project or extensionacceptance testing a new tooling is now added based
on the direct monorepo implementation.
Following
BackendEnvironment::$config[]options arenow available:
'copyInstanceFiles' => [],(array<string, string[]>)to copy the soureFile to all listed target paths.
'copyInstanceFilesCreateTargetPath' => true,toconfigure if target folders should be created when
missing or throw a excetion.
BackendEnvironmentapplies default files to copy based onavailable core extensions:
EXT:backendsource.: 'typo3/sysext/backend/Resources/Public/Icons/favicon.ico'
targets:
EXT:installsource.: 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/root-htaccess'
targets:
source.: 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/fileadmin-temp-htaccess'
targets:
source.: 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/fileadmin-temp-index.html'
targets:
source.: 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/typo3temp-var-htaccess'
targets:
. 'typo3temp/var/.htaccess',
That way, additional files could be defined and configured
instead of implementing custom code in the extended class.
Note that files are always provided, which does not hurt
when not using
Apache2as acceptance instance webserver.Releases: main, 8
Related: #663