Commit a2537436 authored by Stefan Bürk's avatar Stefan Bürk Committed by Christian Kuhn
Browse files

[TASK] Integrate sqlite acceptance testing

Add support for sqlite acceptance testing to
'Build/Scripts/runTests.sh'.

Run acceptance/sqlite testing with PHP 8.1 in nightly
as a first execution implementation, which could be
reshuffled when minimum PHP requirements have
been decided.

Furthermore two acceptance tests are marked as skipped
when executed with sqlite, which should be fixed in
dedicated patches:

* MaintenanceCest.php->analyzeDatabaseStructureWorks()
  Skipped, as database compare is never clean and ends
  in endless loop with sqlite, when ext:indexed_search is
  installed. This is a general issue, existing at least
  since v10.4. Needs investigation and a dedicated patch.

* UpgradeCest.php->seeUpgradeWizard()
  Skipped, as utf-8 charset upgrade wizard is not visible
  for sqlite dbms backend, thus rendering this test obsolete
  with sqlite. Needs another update wizard test and possibly
  a dedicated patch.

Resolves: #96340
Releases: main
Change-Id: I74c8f1156d98a5419309e110ed761e3de21fa37a
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72446


Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 1f9235cf
......@@ -438,6 +438,11 @@ case ${TEST_SUITE} in
docker-compose run acceptance_application_postgres
SUITE_EXIT_CODE=$?
;;
sqlite)
docker-compose run prepare_acceptance_application_sqlite
docker-compose run acceptance_application_sqlite
SUITE_EXIT_CODE=$?
;;
*)
echo "Acceptance tests don't run with DBMS ${DBMS}" >&2
echo >&2
......
......@@ -150,3 +150,54 @@ acceptance application mariadb php 8.1 min:
script:
- Build/Scripts/runTests.sh -s composerInstallMin -p 8.1
- Build/Scripts/runTests.sh -s acceptance -d mariadb -i 10.3 -p 8.1 -c $CI_NODE_INDEX/$CI_NODE_TOTAL
acceptance application sqlite php 8.1 locked:
stage: acceptance
needs: []
only:
- schedules
artifacts:
when: on_failure
paths:
- typo3temp/var/tests/acceptance/typo3temp/var/log
- typo3temp/var/tests/AcceptanceReports
parallel: 8
script:
- Build/Scripts/runTests.sh -s composerInstall -p 8.1
- Build/Scripts/runTests.sh -s acceptance -d sqlite -p 8.1 -c $CI_NODE_INDEX/$CI_NODE_TOTAL
acceptance application sqlite php 8.1 max:
stage: acceptance
needs: []
only:
- schedules
cache:
key: main-composer-max
paths:
- .cache
artifacts:
when: on_failure
paths:
- typo3temp/var/tests/acceptance/typo3temp/var/log
- typo3temp/var/tests/AcceptanceReports
parallel: 8
script:
- Build/Scripts/runTests.sh -s composerInstallMax -p 8.1
- Build/Scripts/runTests.sh -s acceptance -d sqlite -p 8.1 -c $CI_NODE_INDEX/$CI_NODE_TOTAL
acceptance application sqlite php 8.1 min:
stage: acceptance
needs: []
only:
- schedules
cache:
key: main-composer-min
paths:
- .cache
artifacts:
when: on_failure
paths:
- typo3temp/var/tests/acceptance/typo3temp/var/log
- typo3temp/var/tests/AcceptanceReports
parallel: 8
script:
- Build/Scripts/runTests.sh -s composerInstallMin -p 8.1
- Build/Scripts/runTests.sh -s acceptance -d sqlite -p 8.1 -c $CI_NODE_INDEX/$CI_NODE_TOTAL
......@@ -234,6 +234,52 @@ services:
fi
"
prepare_acceptance_application_sqlite:
image: alpine:3.8
links:
- chrome
- web
command: >
/bin/sh -c "
sleep 1;
"
acceptance_application_sqlite:
image: typo3/core-testing-${DOCKER_PHP_IMAGE}:latest
user: "${HOST_UID}"
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
working_dir: ${CORE_ROOT}
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
typo3DatabaseDriver: pdo_sqlite
typo3TestingRedisHost: redis4
typo3TestingMemcachedHost: memcached1-5
command: >
/bin/sh -c "
if [ ${SCRIPT_VERBOSE} -eq 1 ]; then
set -x
fi
php -v | grep '^PHP'
if [ ${CHUNKS} -gt 0 ]; then
echo \"Running chunk ${THISCHUNK}\"
COMMAND=\"bin/codecept run Application -d -g AcceptanceTests-Job-${THISCHUNK} -c typo3/sysext/core/Tests/codeception.yml ${EXTRA_TEST_OPTIONS} ${TEST_FILE} --xml reports.xml --html reports.html\"
else
COMMAND=\"bin/codecept run Application -d -c typo3/sysext/core/Tests/codeception.yml ${EXTRA_TEST_OPTIONS} ${TEST_FILE} --xml reports.xml --html reports.html\"
fi
mkdir -p typo3temp/var/tests/
if [ ${PHP_XDEBUG_ON} -eq 0 ]; then
XDEBUG_MODE=\"off\" \
$${COMMAND};
else
XDEBUG_MODE=\"debug,develop\" \
XDEBUG_TRIGGER=\"foo\" \
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=host.docker.internal\" \
$${COMMAND};
fi
"
prepare_acceptance_install_mysql:
image: alpine:3.8
links:
......
......@@ -41,16 +41,22 @@ class MaintenanceCest extends AbstractCest
/**
* @throws \Exception
* @todo Marked as skipped for sqlite, as database compare is not clean with ext:indexed_search installed
* and sqlite database backend. Fix related issue and reactivate test afterwards.
*/
public function analyzeDatabaseStructureWorks(ApplicationTester $I): void
{
$I->click('Analyze database');
$I->waitForElementVisible('.modal-dialog');
$I->see('Analyze Database Structure', '.modal-dialog h4');
$I->waitForElementVisible('.callout-success');
$I->see('Database schema is up to date. Good job!', '.callout-success h4');
$I->click('.t3js-modal-close');
$I->waitForElementNotVisible('.modal-dialog');
if ((string)getenv('typo3DatabaseDriver') !== 'pdo_sqlite') {
$I->click('Analyze database');
$I->waitForElementVisible('.modal-dialog');
$I->see('Analyze Database Structure', '.modal-dialog h4');
$I->waitForElementVisible('.callout-success');
$I->see('Database schema is up to date. Good job!', '.callout-success h4');
$I->click('.t3js-modal-close');
$I->waitForElementNotVisible('.modal-dialog');
} else {
$I->markTestSkipped('Skipped. Database compare on sqlite is not clean with ext:indexed_search installed.');
}
}
/**
......
......@@ -50,16 +50,20 @@ class UpgradeCest extends AbstractCest
*/
public function seeUpgradeWizard(ApplicationTester $I, ModalDialog $modalDialog): void
{
$I->click('Run Upgrade Wizard');
$modalDialog->canSeeDialog();
$I->amGoingTo('open the upgrade wizard and set charset to utf8');
$I->see('Upgrade Wizard', ModalDialog::$openedModalSelector);
$I->click('Set default charset to utf8', ModalDialog::$openedModalSelector);
$I->waitForText('Default connection database has been set to utf8', 5, ModalDialog::$openedModalSelector);
$I->see('No wizards are marked as done', ModalDialog::$openedModalSelector);
$I->click('.t3js-modal-close');
if ((string)getenv('typo3DatabaseDriver') !== 'pdo_sqlite') {
$I->click('Run Upgrade Wizard');
$modalDialog->canSeeDialog();
$I->amGoingTo('open the upgrade wizard and set charset to utf8');
$I->see('Upgrade Wizard', ModalDialog::$openedModalSelector);
$I->click('Set default charset to utf8', ModalDialog::$openedModalSelector);
$I->waitForText('Default connection database has been set to utf8', 5, ModalDialog::$openedModalSelector);
$I->see('No wizards are marked as done', ModalDialog::$openedModalSelector);
$I->click('.t3js-modal-close');
} else {
$I->markTestSkipped('Skipped for sqlite. Need another check as utf-8 wizard is not possible for sqlite');
}
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment