Closed sypets closed 3 years ago
Alternatively, it might make more sense to do composer install
via runTests too for local testing, e.g.
Build/Scripts/runTests.sh -p 7.3 -s composerInstallMin
but that deviates from the description in https://docs.typo3.org/m/typo3/reference-coreapi/10.4/en-us/Testing/ExtensionTesting.html#preparing-composer-json
Thanks for your input, Sybille. styleguide has a runTests.sh -s composerInstall already, i'll add the same to enetcache. Other things mentioned in the issues seem to be related to core-docs, seems some have been adapted there already. It seems there isn't too much that can be done here, but feel free to add patches to specific things if we missed something. I hope it's ok to close here for now since I don't see much that can be done here at the moment.
Note: I'll keep php 7.2 & 7.3 compatible versions in testing until enetcache is branched to drop v10 support. current version supports both v10 and v11.
@lolli42 Thank you.
I recently noticed that the extension testing documentation in "TYPO3 Explained" differs from the methods in the "tea" example (which do not use runTests.sh):
("tea" should be the "best practice" example for CI and Extbase / Fluid)
So if and before you put too much effort into this from the docs perspective, you may want to talk with Olli Klee.
As a side note:it is sometimes difficult for me to figure out a "best practice" for myself, also how to run the tests - e.g. via the "project" repo and include the extensions in the project as a mono repo or separately. Currently I have both. I am transitioning, this is all a work in progress. The resources I found help but it makes it more difficult if there are several ways to do it - especially in the official stuff but also in external blogs and git repos.)
I opened an issue for tea month ago with https://github.com/TYPO3-Documentation/tea/issues/94 runTests.sh is best practice from core view. it is (at the time of this writing) documented as such in the 'coredocs'. testing-framework actively supports extension testing. tea should be adapted from core point of view.
ah cool. Didn't see that issue before. I think we are on the same page. Not sure if everyone else is though.
I used the documentation https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/Testing/ExtensionTesting.html# to setup testing with typo3/testing-framework in my extension and I found the documentation very helpful. :thumbsup: What I especially like is that you have basically the same / similar scripts and workflow and framework for core and extension testing. Also, everything is explained very well in a step by step way which makes it easy to get started - even as beginner.
That being said, there are some minor inconsistencies:
I followed the instructions on https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/Testing/ExtensionTesting.html#. The docs refer to this extension or more specifically the runTests.sh and docker-compose.yml scripts.
I ran into difficulties with PHP version conflicts. These can be fixed easily (see https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-CoreApi/pull/1368), but I think it would be best if this works out-of-the-box.
using PHP 7.4 locally and proceeding as described on the "Extension testing" docs page:
Fresh clone and running unit tests results in error:
This can be prevented by either changing the default PHP version in runTests.sh or supplying it on the command line, e.g. Build/Scripts/runTests.sh -p 7.4
OR
changing the dependencies. It would probably also be good to add version constraints for PHP to composer.json.
and
This extension does not follow this recommendation: it has a composer.json which supports 11 and 10 (in master).
As said, these are some minor inconsistencies which may pose difficulties. (My own personal experience is that not having everything working smoothly from the start actually helps because you learn more and can then cope with difficulties further on down the road).