Commit a104a8d9 authored by Anja Leichsenring's avatar Anja Leichsenring Committed by Andreas Fernandez
Browse files

[TASK] Provide acceptance test suite for stand alone Install Tool

The acceptance tests folder 'InstallTool' holds tests that ensure
the proper display of options in the stand alone Install Tool.
A brand new test suite takes care of execution.

Resolves: #89489
Releases: master, 10.4
Change-Id: Iaeedfd5a2db26d4ba111855dc3137f2e8ca8fa27
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64547


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
parent 237f4950
......@@ -65,6 +65,7 @@ Options:
Specifies which test suite to run
- acceptance: backend acceptance tests
- acceptancePagetree: backend acceptance tests for page tree
- acceptanceInstallTool: acceptance tests for stand alone install tool
- buildCss: execute scss to css builder
- buildJavascript: execute typescript to javascript builder
- cglGit: test and fix latest committed patch for CGL compliance
......@@ -289,6 +290,13 @@ case ${TEST_SUITE} in
SUITE_EXIT_CODE=$?
docker-compose down
;;
acceptanceInstallTool)
setUpDockerComposeDotEnv
docker-compose run prepare_acceptance_installtool_mariadb10
docker-compose run acceptance_installtool_mariadb10
SUITE_EXIT_CODE=$?
docker-compose down
;;
buildCss)
setUpDockerComposeDotEnv
docker-compose run build_css
......
......@@ -338,7 +338,7 @@ abstract class AbstractCoreSpec {
this.getTaskStopDanglingContainers(),
composerTask,
this.getTaskPrepareAcceptanceTest(),
this.getTaskDockerDependenciesAcceptanceInstallPostgres10(),
this.getTaskDockerDependenciesAcceptancePostgres10(),
new ScriptTask()
.description("Install TYPO3 on postgresql 10")
.interpreter(ScriptTaskProperties.Interpreter.BINSH_OR_CMDEXE)
......@@ -574,6 +574,63 @@ abstract class AbstractCoreSpec {
return jobs;
}
ArrayList<Job> getJobsAcceptanceTestsInstallToolMysql(int stageNumber, String requirementIdentifier, Task composerTask, Boolean isSecurity) {
String name = getTaskNamePartForComposer(stageNumber);
ArrayList<Job> jobs = new ArrayList<Job>();
jobs.add(new Job("Accept InstallTool my " + name + " " + requirementIdentifier, new BambooKey("ACITMY" + stageNumber + requirementIdentifier))
.description("Run acceptance tests for install tool " + requirementIdentifier)
.pluginConfigurations(this.getDefaultJobPluginConfiguration())
.tasks(
this.getTaskGitCloneRepository(),
this.getTaskGitCherryPick(isSecurity),
this.getTaskStopDanglingContainers(),
composerTask,
this.getTaskPrepareAcceptanceTest(),
this.getTaskDockerDependenciesAcceptanceBackendMariadb10(),
new ScriptTask()
.description("Execute codeception acceptance test for standalone install tool.")
.interpreter(ScriptTaskProperties.Interpreter.BINSH_OR_CMDEXE)
.inlineBody(
this.getScriptTaskBashInlineBody() +
"function codecept() {\n" +
" docker run \\\n" +
" -u ${HOST_UID} \\\n" +
" -v /bamboo-data/${BAMBOO_COMPOSE_PROJECT_NAME}/passwd:/etc/passwd \\\n" +
" -v ${BAMBOO_COMPOSE_PROJECT_NAME}_bamboo-data:/srv/bamboo/xml-data/build-dir/ \\\n" +
" -e typo3DatabaseName=func_test \\\n" +
" -e typo3DatabaseUsername=root \\\n" +
" -e typo3DatabasePassword=funcp \\\n" +
" -e typo3DatabaseHost=mariadb10 \\\n" +
" --name ${BAMBOO_COMPOSE_PROJECT_NAME}sib_adhoc \\\n" +
" --network ${BAMBOO_COMPOSE_PROJECT_NAME}_test \\\n" +
" --rm \\\n" +
" typo3gmbh/" + requirementIdentifier.toLowerCase() + ":latest \\\n" +
" bin/bash -c \"cd ${PWD}; ./bin/codecept $*\"\n" +
"}\n" +
"\n" +
"codecept run InstallTool -d -c typo3/sysext/core/Tests/codeception.yml --env=mysql --xml reports.xml --html reports.html\n"
)
)
.finalTasks(
this.getTaskStopDockerDependencies(),
new TestParserTask(TestParserTaskProperties.TestType.JUNIT)
.resultDirectories("typo3temp/var/tests/AcceptanceReports/reports.xml")
)
.artifacts(new Artifact()
.name("Test Report")
.copyPattern("typo3temp/var/tests/AcceptanceReports/")
.shared(false)
)
.requirements(
this.getRequirementDocker10()
)
.cleanWorkingDirectory(true)
);
return jobs;
}
/**
* Jobs for mysql based functional tests with driver mysqli
*/
......@@ -1744,7 +1801,7 @@ abstract class AbstractCoreSpec {
/**
* Start docker sibling containers to execute acceptance install tests on postgres
*/
private Task getTaskDockerDependenciesAcceptanceInstallPostgres10() {
private Task getTaskDockerDependenciesAcceptancePostgres10() {
return new ScriptTask()
.description("Start docker siblings for acceptance test install postgres")
.interpreter(ScriptTaskProperties.Interpreter.BINSH_OR_CMDEXE)
......
......@@ -55,6 +55,7 @@ abstract class AbstractPreMergeSpec extends AbstractCoreSpec {
jobsMainStage.addAll(this.getJobsAcceptanceTestsBackendMysql(0, numberOfAcceptanceTestJobs, phpVersions[1], this.getTaskComposerInstall(phpVersions[1]), isSecurity));
jobsMainStage.addAll(this.getJobsAcceptanceTestsPageTreeMysql(0, phpVersions[1], this.getTaskComposerInstall(phpVersions[1]), isSecurity));
jobsMainStage.addAll(this.getJobsAcceptanceTestsInstallToolMysql(0, phpVersions[1], this.getTaskComposerInstall(phpVersions[1]), isSecurity));
jobsMainStage.add(this.getJobIntegrationPhpStan(phpVersions[0], this.getTaskComposerInstall(phpVersions[0]), isSecurity));
jobsMainStage.add(this.getJobIntegrationDocBlocks(phpVersions[0], this.getTaskComposerInstall(phpVersions[0]), isSecurity));
......
......@@ -327,14 +327,17 @@ public class NightlySpec extends AbstractCoreSpec {
String phpVersion = "PHP72";
Task composerTask = getComposerTaskByStageNumber(phpVersion, COMPOSER_MIN);
jobs.add(this.getJobAcceptanceTestInstallPgsql(COMPOSER_MIN, phpVersion, composerTask, false));
jobs.addAll(this.getJobsAcceptanceTestsInstallToolMysql(COMPOSER_MIN, phpVersion, composerTask, false));
phpVersion = "PHP73";
composerTask = getComposerTaskByStageNumber(phpVersion, COMPOSER_DEFAULT);
jobs.add(this.getJobAcceptanceTestInstallPgsql(COMPOSER_DEFAULT, phpVersion, composerTask, false));
jobs.addAll(this.getJobsAcceptanceTestsInstallToolMysql(COMPOSER_DEFAULT, phpVersion, composerTask, false));
phpVersion = "PHP74";
composerTask = getComposerTaskByStageNumber(phpVersion, COMPOSER_MAX);
jobs.add(this.getJobAcceptanceTestInstallPgsql(COMPOSER_MAX, phpVersion, composerTask, false));
jobs.addAll(this.getJobsAcceptanceTestsInstallToolMysql(COMPOSER_MAX, phpVersion, composerTask, false));
stages.add(new Stage("Acceptance pgsql").jobs(jobs.toArray(new Job[0])));
return stages;
......
......@@ -129,6 +129,46 @@ services:
&& ./bin/codecept run PageTree -d -c typo3/sysext/core/Tests/codeception.yml ${TEST_FILE} --html reports.html
"
prepare_acceptance_installtool_mariadb10:
image: alpine:3.8
links:
- mariadb10
- chrome
- web
command: >
/bin/sh -c "
if [ ${SCRIPT_VERBOSE} -eq 1 ]; then
set -x
fi
echo Waiting for database start...;
while ! nc -z mariadb10 3306; do
sleep 1;
done;
echo Database is up;
"
acceptance_installtool_mariadb10:
image: typo3gmbh/${DOCKER_PHP_IMAGE}:latest
user: ${HOST_UID}
environment:
typo3DatabaseName: func_test
typo3DatabaseUsername: root
typo3DatabasePassword: funcp
typo3DatabaseHost: mariadb10
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}
command: >
/bin/sh -c "
if [ ${SCRIPT_VERBOSE} -eq 1 ]; then
set -x
fi
mkdir -p typo3temp/var/tests/ \
&& ./bin/codecept run InstallTool -d -c typo3/sysext/core/Tests/codeception.yml ${TEST_FILE} --html reports.html
"
prepare_acceptance_install_mariadb10:
image: alpine:3.8
links:
......
class_name: BackendTester
modules:
enabled:
- WebDriver:
url: http://web:8000/typo3temp/var/tests/acceptance
browser: chrome
wait: 1
host: chrome
- \TYPO3\TestingFramework\Core\Acceptance\Helper\Acceptance
- Asserts
extensions:
enabled:
- TYPO3\CMS\Core\Tests\Acceptance\Support\Extension\BackendCoreEnvironment
......@@ -21,6 +21,9 @@ use TYPO3\CMS\Core\Tests\Acceptance\Support\BackendTester;
class LoginCest extends AbstractCest
{
/**
* @param BackendTester $I
*/
public function installToolLogin(BackendTester $I)
{
$I->amGoingTo('assert the install tool is locked in the first place');
......
......@@ -28,6 +28,11 @@ class MaintenanceCest extends AbstractCest
$I->click('Maintenance');
$I->see('Maintenance', 'h1');
}
/**
* @param BackendTester $I
* @throws \Exception
*/
public function flushCacheWorks(BackendTester $I)
{
$I->click('Flush cache');
......@@ -35,6 +40,10 @@ class MaintenanceCest extends AbstractCest
$I->see('Caches cleared', '.alert-success h4');
}
/**
* @param BackendTester $I
* @throws \Exception
*/
public function analyzeDatabaseStructureWorks(BackendTester $I)
{
$I->click('Analyze database');
......@@ -46,6 +55,10 @@ class MaintenanceCest extends AbstractCest
$I->waitForElementNotVisible('.modal-dialog');
}
/**
* @param BackendTester $I
* @throws \Exception
*/
public function removeTemporaryAssetsWorks(BackendTester $I)
{
$I->click('Scan temporary files');
......@@ -55,6 +68,10 @@ class MaintenanceCest extends AbstractCest
$I->waitForElementNotVisible('.modal-dialog');
}
/**
* @param BackendTester $I
* @throws \Exception
*/
public function dumpAutoloadWorks(BackendTester $I)
{
$I->click('Dump autoload');
......@@ -62,6 +79,10 @@ class MaintenanceCest extends AbstractCest
$I->see('Successfully dumped class loading information for extensions.', '.alert-success h4');
}
/**
* @param BackendTester $I
* @throws \Exception
*/
public function clearPersistentTablesWorks(BackendTester $I)
{
$I->click('Scan tables');
......@@ -71,6 +92,10 @@ class MaintenanceCest extends AbstractCest
$I->waitForElementNotVisible('.modal-dialog');
}
/**
* @param BackendTester $I
* @throws \Exception
*/
public function createAdminUserWorks(BackendTester $I)
{
$I->click('Create Administrator');
......@@ -80,6 +105,10 @@ class MaintenanceCest extends AbstractCest
$I->waitForElementNotVisible('.modal-dialog');
}
/**
* @param BackendTester $I
* @throws \Exception
*/
public function resetBackendUserPreferencesWorks(BackendTester $I)
{
$I->click('Reset backend user preferences');
......@@ -88,12 +117,16 @@ class MaintenanceCest extends AbstractCest
$I->see('Preferences of all backend users have been reset', '.alert-success p');
}
/**
* @param BackendTester $I
* @throws \Exception
*/
public function manageLanguagePacksWorks(BackendTester $I)
{
$I->click('Manage languages');
$I->waitForElementVisible('.modal-dialog');
$I->see('Manage Language Packs', '.modal-dialog h4');
$I->see('Active Languages', '.modal-dialog h3');
$I->waitForText('Active languages', 30, '.modal-dialog h3');
$I->click('.t3js-modal-close');
$I->waitForElementNotVisible('.modal-dialog');
}
......
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