TYPO3CMS-Reference-CoreApi icon indicating copy to clipboard operation
TYPO3CMS-Reference-CoreApi copied to clipboard

Update Extension Testing page for newer versions

Open sypets opened this issue 2 years ago • 2 comments

https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/Testing/ExtensionTesting.html

Current behavior

There is a note that some stuff is outdated.

Expected behavior/output

The changes should be made on:

changes:

  • [ ] (1) remove reference to ExtensionTestEnvironment::prepare from composer.json

TYPO3 versions: >= 11.5

"scripts": {
    "post-autoload-dump": [
      "TYPO3\\TestingFramework\\Composer\\ExtensionTestEnvironment::prepare"
    ]
  }, 

should be removed since v11

TYPO3\TestingFramework\Composer\ExtensionTestEnvironment::prepare
ExtensionTestEnvironment is not required any more for TYPO3 11.5 LTS

see message in source code (version 6): https://github.com/TYPO3/testing-framework/blob/02d1afaf97c6f5de928c51ee88288decdc7591c8/Classes/Composer/ExtensionTestEnvironment.php#L59


  • [ ] (2) remove replace / self.version

TYPO3 versions: ?, at least >= 11.5

"replace": {
    "enetcache": "self.version",
    "typo3-ter/enetcache": "self.version"
  },

is no longer used since ? ...

https://docs.typo3.org/m/typo3/reference-coreapi/11.5/en-us/ExtensionArchitecture/FileStructure/ComposerJson.html#replace-with-typo3-ter-vendor-name


  • [ ] (3) remove cms-package-dir

TYPO3 versions: >= 9.5

"cms-package-dir": "{$vendor-dir}/typo3/cms",

is no longer used since subtree split (TYPO3 v9)

https://docs.typo3.org/m/typo3/guide-installation/main/en-us/MigrateToComposer/MigrationSteps.html#install-extension-from-version-control-system-e-g-github-gitlab


  • [ ] (4) Remove ignore-as-root

TYPO3 versions: >= 11.5

"typo3/cms": {
          "ignore-as-root": false,


* [ ] (5) Use composerUpdate instead of composerInstall

styleguide as well as enetcache use compserUpdate (composer update) instead of the core composerInstall (composer install) as this makes more sense for extensions where the composer.lock is not set to a fixed state. This will update packages, if a composer.lock already exists (e.g. locally). 

Links

TYPO3 versions

main, v12, v11 ...

Possible Solution

See above, will work on PR

sypets avatar May 05 '23 15:05 sypets

The Resources/Public folder must exist in the extension, otherwise it will not be installed into .Build/Web/typo3conf/ext (even if the ExtensionTestEnvironment::prepare snippet is in composer.json)

See https://review.typo3.org/c/Packages/TYPO3.CMS/+/78953/2..3/typo3/sysext/core/Documentation/Changelog/11.4/Feature-94996-ConsiderAllComposerInstalledExtensionsAsActive.rst#b130 for an explanation

helhum avatar May 08 '23 07:05 helhum

I have removed "The Resources/Public folder must exist in the extension, ... " above. We had a longer discussion in the core patch and Slack. That is not what should be communicated.

In this issue I would like to focus only on the 3 points listed above.

About the Resources/Public folder - my takeaway is:

  • that the extension was installed at all in .Build/Web/typo3conf/ext/ was a workaround and not intended as long term solution. Should not be relied on since v11
  • in newer versions of runTests.sh & related scripts in exentions we no longer rely on this path, see e.g. "main" branch in styleguide, we use a path such as Build/FunctionalTests.xml relative to extension dir (see https://github.com/TYPO3/styleguide/blob/main/Build/testing-docker/docker-compose.yml)
  • since typo3/cms-package-installers 4.0.0-RC1:

All files from extensions, that require to be accessed by the web server directly MUST reside inside the Resources/Public folder. https://github.com/TYPO3/CmsComposerInstallers/releases/tag/v4.0.0-RC1

  • I have been advised to recommend TF 7 (typo3/testing-framework) with v11 (though I have not fully understood why).

see https://review.typo3.org/c/Packages/TYPO3.CMS/+/71029/7/typo3/sysext/core/Documentation/Changelog/11.4/Feature-94996-ConsiderAllComposerInstalledExtensionsAsActive.rst#70

sypets avatar May 12 '23 14:05 sypets

This was already done a while ago.

I checked off the checkboxes above (all changes had been made for 11.5, 12.4, main): ExtensionTestEnvironment::prepare, self.version, cms-package-dir, ignore-as-root

sypets avatar May 19 '24 11:05 sypets