Commit f74cf58c authored by Christian Kuhn's avatar Christian Kuhn Committed by Anja Leichsenring
Browse files

[TASK] Update to phpunit 7.5

Updating to latest v7 branch of phpunit is blocked by
codeception which relies on phpunit-mock-objects, so
we need to update this first from 2.4 to 2.5:

composer require --dev codeception/codeception:^2.5.4

Updating its dependencies then drops phpunit-mock-objects
and fetches phpunit 7.5:

composer update --with-dependencies codeception/codeception

Younger phpunit now has a random-order built in, the currently
used plugin can be removed:

composer remove --dev fiunchinho/phpunit-randomizer

typo3/testing-framework needs a raise to prevent a lower
phpunit version that would break the randomizer again:

composer require --dev typo3/testing-framework:~5.0.6

runTests.sh and its docker-compose file need some adaptions
so the unit test randomizer can be used, example calls:

Build/Scripts/runTests.sh -s unitRandom

Build/Scripts/runTests.sh -s unitRandom -o 1551445682

bamboo also needs some adaptions to now use built in phpunit
random functionality instead of phpunit-randomizer.

Change-Id: I0acfebdcb1f4da785845c8397ad23b7bb8174505
Resolves: #87107
Releases: master, 9.5
Reviewed-on: https://review.typo3.org/c/59823


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
parent 672290f8
......@@ -174,7 +174,7 @@ PHP_XDEBUG_ON=0
PHP_XDEBUG_PORT=9000
EXTRA_TEST_OPTIONS=""
SCRIPT_VERBOSE=0
PHPUNIT_RANDOM="--order rand"
PHPUNIT_RANDOM=""
CGLCHECK_DRY_RUN=""
# Option parsing
......@@ -204,7 +204,7 @@ while getopts ":s:d:p:e:xy:o:nhuv" OPT; do
PHP_XDEBUG_PORT=${OPTARG}
;;
o)
PHPUNIT_RANDOM="--order :${OPTARG}"
PHPUNIT_RANDOM="--random-order-seed=${OPTARG}"
;;
n)
CGLCHECK_DRY_RUN="-n"
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>com.atlassian.bamboo</groupId>
<artifactId>bamboo-specs-parent</artifactId>
<version>6.6.2</version>
<version>6.7.2</version>
<relativePath/>
</parent>
......
......@@ -1317,11 +1317,11 @@ abstract public class AbstractCoreSpec {
this.getTaskStopDanglingContainers(),
composerTask,
new ScriptTask()
.description("Run phpunit-randomizer")
.description("Run phpunit random order")
.interpreter(ScriptTaskProperties.Interpreter.BINSH_OR_CMDEXE)
.inlineBody(
this.getScriptTaskBashInlineBody() +
"function phpunitRandomizer() {\n" +
"function phpunit() {\n" +
" docker run \\\n" +
" -u ${HOST_UID} \\\n" +
" -v /bamboo-data/${BAMBOO_COMPOSE_PROJECT_NAME}/passwd:/etc/passwd \\\n" +
......@@ -1330,10 +1330,10 @@ abstract public class AbstractCoreSpec {
" --network ${BAMBOO_COMPOSE_PROJECT_NAME}_test \\\n" +
" --rm \\\n" +
" typo3gmbh/" + requirementIdentifier.toLowerCase() + ":latest \\\n" +
" bin/bash -c \"cd ${PWD}; php -n -c /etc/php/cli-no-xdebug/php.ini bin/phpunit-randomizer $*\"\n" +
" bin/bash -c \"cd ${PWD}; php -n -c /etc/php/cli-no-xdebug/php.ini bin/phpunit $*\"\n" +
"}\n" +
"\n" +
"phpunitRandomizer --log-junit test-reports/phpunit.xml -c " + this.testingFrameworkBuildPath + "UnitTests.xml --order rand"
"phpunit --log-junit test-reports/phpunit.xml -c " + this.testingFrameworkBuildPath + "UnitTests.xml --order-by=random"
)
)
.finalTasks(
......
......@@ -163,8 +163,8 @@ public class NightlySpec extends AbstractCoreSpec {
jobsComposerMaxStage.add(this.getJobUnitDeprecatedPhp(1, "PHP73", this.getTaskComposerUpdateMax("PHP73")));
// Disabled for now since young phpunit with built-in randomizer collides with this one. Needs investigation.
//jobsComposerMaxStage.addAll(this.getJobUnitPhpRandom(1, this.numberOfUnitRandomOrderJobs, "PHP72", this.getTaskComposerUpdateMax("PHP72")));
//jobsComposerMaxStage.addAll(this.getJobUnitPhpRandom(1, this.numberOfUnitRandomOrderJobs, "PHP73", this.getTaskComposerUpdateMax("PHP73")));
jobsComposerMaxStage.addAll(this.getJobUnitPhpRandom(1, this.numberOfUnitRandomOrderJobs, "PHP72", this.getTaskComposerUpdateMax("PHP72")));
jobsComposerMaxStage.addAll(this.getJobUnitPhpRandom(1, this.numberOfUnitRandomOrderJobs, "PHP73", this.getTaskComposerUpdateMax("PHP73")));
Stage stageComposerMaxStage = new Stage("Composer update max")
.jobs(jobsComposerMaxStage.toArray(new Job[jobsComposerMaxStage.size()]));
......
......@@ -817,10 +817,10 @@ services:
php -v | grep '^PHP'
if [ ${PHP_XDEBUG_ON} -eq 0 ]; then
php -n -c /etc/php/cli-no-xdebug/php.ini \
vendor/phpunit/phpunit/phpunit-randomizer -c vendor/typo3/testing-framework/Resources/Core/Build/UnitTests.xml ${EXTRA_TEST_OPTIONS} ${PHPUNIT_RANDOM} ${TEST_FILE};
vendor/phpunit/phpunit/phpunit -c vendor/typo3/testing-framework/Resources/Core/Build/UnitTests.xml --order-by=random ${EXTRA_TEST_OPTIONS} ${PHPUNIT_RANDOM} ${TEST_FILE};
else
DOCKER_HOST=`route -n | awk '/^0.0.0.0/ { print $$2 }'`
XDEBUG_CONFIG=\"remote_port=${PHP_XDEBUG_PORT} remote_enable=1 remote_host=$${DOCKER_HOST}\" \
vendor/phpunit/phpunit/phpunit-randomizer -c vendor/typo3/testing-framework/Resources/Core/Build/UnitTests.xml ${EXTRA_TEST_OPTIONS} ${PHPUNIT_RANDOM} ${TEST_FILE};
vendor/phpunit/phpunit/phpunit -c vendor/typo3/testing-framework/Resources/Core/Build/UnitTests.xml --order-by=random ${EXTRA_TEST_OPTIONS} ${PHPUNIT_RANDOM} ${TEST_FILE};
fi
"
......@@ -68,12 +68,11 @@
"webmozart/assert": "^1.0"
},
"require-dev": {
"codeception/codeception": "^2.4.5",
"fiunchinho/phpunit-randomizer": "^4.0",
"codeception/codeception": "^2.5.4",
"friendsofphp/php-cs-fixer": "^2.12.2",
"phpspec/prophecy": "^1.7.5",
"typo3/cms-styleguide": "~10.0.2",
"typo3/testing-framework": "~5.0.5"
"typo3/testing-framework": "~5.0.6"
},
"suggest": {
"ext-gd": "GDlib/Freetype is required for building images with text (GIFBUILDER) and can also be used to scale images",
......
This diff is collapsed.
......@@ -47,12 +47,11 @@
"typo3fluid/fluid": "^2.6.0"
},
"require-dev": {
"codeception/codeception": "^2.4.5",
"fiunchinho/phpunit-randomizer": "^4.0",
"codeception/codeception": "^2.5.4",
"friendsofphp/php-cs-fixer": "^2.12.2",
"phpspec/prophecy": "^1.7.5",
"typo3/cms-styleguide": "~10.0.2",
"typo3/testing-framework": "~5.0.5"
"typo3/testing-framework": "~5.0.6"
},
"suggest": {
"ext-fileinfo": "Used for proper file type detection in the file abstraction layer",
......
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