Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Ensure package dependencies in functional/acceptance tests
This change uses the dependency ordering service in the method `\TYPO3\TestingFramework\Core\Testbase::setUpPackageStates` for test scenarios in functional and acceptance tests. Besides that the following changes were applied: * remove invalid dependency in fixture ext:test_configoverride_second * add `PackageStatesTest` to keep track of extension dependencies * add dependency to ext:frontend in ext:form, since it overrides TCA for the tables tt_content and sys_template (which would result in different ext:impexp results due to table field orderings) * recreate IRRE related XML fixtures for ext:impexp since fixture extensions are now ordered alphabetically (and due to #100734) Resolves: #101809 Releases: main, 12.4 Change-Id: I1f91a75ac8aec9db0291b0f5c8bcf7162d5b0082 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/81093 Tested-by: core-ci <typo3@b13.com> Reviewed-by: Stefan Bürk <stefan@buerk.tech> Tested-by: Stefan Bürk <stefan@buerk.tech>
- Loading branch information
Showing
8 changed files
with
1,094 additions
and
937 deletions.
There are no files selected for viewing
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
154 changes: 154 additions & 0 deletions
154
typo3/sysext/core/Tests/Functional/Package/PackageStatesTest.php
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the TYPO3 CMS project. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
namespace TYPO3\CMS\Core\Tests\Functional\Package; | ||
|
||
use TYPO3\CMS\Core\Cache\Backend\NullBackend; | ||
use TYPO3\CMS\Core\Package\PackageManager; | ||
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; | ||
|
||
/** | ||
* Tests the package states and order of packages in functional tests. | ||
* Thus, this is a test case for functional tests. | ||
*/ | ||
final class PackageStatesTest extends FunctionalTestCase | ||
{ | ||
// @todo how to automatically fetch all available TYPO3 system extensions? | ||
private const CORE_EXTENSION_TO_LOAD = [ | ||
'adminpanel', | ||
'backend', | ||
'belog', | ||
'beuser', | ||
'dashboard', | ||
'extbase', | ||
'extensionmanager', | ||
'felogin', | ||
'filelist', | ||
'filemetadata', | ||
'fluid', | ||
'fluid_styled_content', | ||
'form', | ||
'frontend', | ||
'impexp', | ||
'indexed_search', | ||
'info', | ||
'install', | ||
'linkvalidator', | ||
'lowlevel', | ||
'opendocs', | ||
'reactions', | ||
'recycler', | ||
'redirects', | ||
'reports', | ||
'rte_ckeditor', | ||
'scheduler', | ||
'seo', | ||
'setup', | ||
'sys_note', | ||
't3editor', | ||
'tstemplate', | ||
'viewpage', | ||
'webhooks', | ||
'workspaces', | ||
]; | ||
|
||
protected array $configurationToUseInTestInstance = [ | ||
'SYS' => [ | ||
'caching' => [ | ||
'cacheConfigurations' => [ | ||
// disables caching of package states | ||
'core' => [ | ||
'backend' => NullBackend::class, | ||
], | ||
], | ||
], | ||
], | ||
]; | ||
|
||
protected function setUp(): void | ||
{ | ||
$this->coreExtensionsToLoad = self::CORE_EXTENSION_TO_LOAD; | ||
shuffle($this->coreExtensionsToLoad); | ||
parent::setUp(); | ||
} | ||
|
||
/** | ||
* This test cannot test the complete scenario, since the dependency | ||
* ordering service can only adjust order base on available information. | ||
* | ||
* The "sorting constraints" are a combination of static prioritized packages, the | ||
* corresponding dependencies from `ext_emconf.php` and finally as a fall-back, | ||
* an alphabetic order - which just ensures that the sequence stays the same. | ||
* | ||
* @test | ||
*/ | ||
public function activePackagesAreOrderedByPrioritizedPackageKeysOrPackageDependenciesOrAlphabetically(): void | ||
{ | ||
$packageManager = $this->get(PackageManager::class); | ||
$activePackages = $packageManager->getActivePackages(); | ||
// @todo this list is still incorrect and requires consolidated `ext_emconf.php` constraints | ||
$expectedKeys = [ | ||
'core', | ||
'scheduler', | ||
'extbase', | ||
'fluid', | ||
'frontend', | ||
'fluid_styled_content', | ||
'filelist', | ||
'impexp', | ||
'form', | ||
'install', | ||
'info', | ||
'linkvalidator', | ||
'reports', | ||
'redirects', | ||
'indexed_search', | ||
'recycler', | ||
'setup', | ||
'rte_ckeditor', | ||
'adminpanel', | ||
'backend', | ||
'belog', | ||
'beuser', | ||
'dashboard', | ||
'extensionmanager', | ||
'felogin', | ||
'filemetadata', | ||
'lowlevel', | ||
'opendocs', | ||
'reactions', | ||
'seo', | ||
'sys_note', | ||
't3editor', | ||
'tstemplate', | ||
'viewpage', | ||
'webhooks', | ||
'workspaces', | ||
]; | ||
|
||
self::assertSame( | ||
$expectedKeys, | ||
// use the order of `$activePackages`, but only pass those values of `$expectedKeys` | ||
array_values( | ||
array_intersect( | ||
array_keys($activePackages), | ||
$expectedKeys | ||
) | ||
), | ||
); | ||
} | ||
} |
This file contains 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
This file contains 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
Oops, something went wrong.