Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] Ensure working codeception tests with TYPO3 v13 #566

Merged
merged 5 commits into from
Dec 5, 2024

Conversation

sbuerk
Copy link
Contributor

@sbuerk sbuerk commented Dec 5, 2024

  • [TASK] Adjust typo3/testing-framework constraint
    The composer package version constraint for the
    typo3/testing-framework is adjusted to ensure
    latest version for each required major versions.

    Used command(s):

    composer require --dev --no-update \
      'typo3/testing-framework':'^7.1.1 || ^8.2.7'

    [1] https://github.com/TYPO3/testing-framework/releases/tag/8.2.7

  • [TASK] Remove providing backend entrypoint for TYPO3 v13 in test 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] [TASK] Allow defining test instance files copy for acceptance tests TYPO3/testing-framework#663
    [2] [TASK] Allow defining test instance files copy for acceptance tests 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

  • [TASK] Use composer package names for acceptance extension configuration
    typo3/testing-framework allows to use composer package names
    instead of classic mode references as extension to load for
    functional and codeception acceptance test instance creation.

    Use composer package names for acceptance test extensions to
    load now.

  • [TASK] Adopt codeception helper login page check from testing-framework
    For the codeception acceptance tests a custom codeception helper
    is used to verify the login state, using /typo3/index.php to
    check for backend login mask page.

    Using the full endpoint is not reasonable and breaks with TYPO3
    v13.0 and newer which removed that endpoint completly and this
    change modifes the check to use /typo3 path instead, adopting
    from provided typo3/testing-framework helper which is fully
    backwards compatible.

  • [TASK] Use apache2 and PHP-FPM for acceptance tests for TYPO3 v13
    TYPO3 Core development switched codeception based acceptance
    testing using apache2 and PHP-FPM instead if the internal
    PHP cli webserver due to rewrite rules required to operate
    TYPO3 properly, special with removed backend entrypoint since
    TYPO3 v13.

    This change adopts required changes within Build/Scripts/runTests.sh
    to make the switch and be in line with core development regarding
    acceptance testing for TYPO3 v13 only, keeping the PHP internal
    webserver for older TYPO3 core and testing-framework versions.

The composer package version constraint for the
`typo3/testing-framework` is adjusted to ensure
latest version for each required major versions.

Used command(s):

```shell
composer require --dev --no-update \
  'typo3/testing-framework':'^7.1.1 || ^8.2.7'
```

[1] https://github.com/TYPO3/testing-framework/releases/tag/8.2.7
…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
`typo3/testing-framework` allows to use composer package names
instead of classic mode references as extension to load for
functional and codeception acceptance test instance creation.

Use composer package names for acceptance test extensions to
load now.
For the codeception acceptance tests a custom codeception helper
is used to verify the login state, using `/typo3/index.php` to
check for backend login mask page.

Using the full endpoint is not reasonable and breaks with TYPO3
v13.0 and newer which removed that endpoint completly and this
change modifes the check to use `/typo3` path instead, adopting
from provided `typo3/testing-framework` helper which is fully
backwards compatible.
TYPO3 Core development switched codeception based acceptance
testing using `apache2` and `PHP-FPM` instead if the internal
PHP cli webserver due to rewrite rules required to operate
TYPO3 properly, special with removed backend entrypoint since
TYPO3 v13.

This change adopts required changes within `Build/Scripts/runTests.sh`
to make the switch and be in line with core development regarding
acceptance testing for TYPO3 v13 only, keeping the PHP internal
webserver for older TYPO3 core and testing-framework versions.
@sbuerk sbuerk force-pushed the fix-acceptance-tests branch from ebc91f3 to e8b73ae Compare December 5, 2024 16:06
Copy link
Contributor

@achimfritz achimfritz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thanks a lot

@achimfritz achimfritz merged commit 89a603b into b13:master Dec 5, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants