Skip to content

Commit

Permalink
[TASK] runTest.sh: Version check docker-compose v2
Browse files Browse the repository at this point in the history
Docker for Mac (and Windows?) currently misuses their
users as canary testers by actively activating an
"experimental" feature toggle which then ships
a docker-compose v2 rc release.

docker-composer v2's yaml parsing however is broken
(you had ONE job!): It does not properly detect strings
as strings and mumbles about this, and worse, it transforms
shell "don't linebreak!" '\' operator into linebreaks. This
breaks our carefully crafted and formatted testing related
docker-compose.yml configuration.

The situation persists for weeks already, there is no
solution except manually disabling this docker for mac
experimental feature toggle.

The patch makes runTests.sh detect docker-composer v2,
exits out with an error message telling the version
is not supported and how to disable it. ddev went with
a similar approach recently.

Resolves: #95057
Releases: master, 10.4, 9.5
Change-Id: Iee1e6fd28d876262f00aba769a7e047c14db903c
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/70845
Tested-by: core-ci <typo3@b13.com>
Tested-by: Benni Mack <benni@typo3.org>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
ochorocho authored and lolli42 committed Sep 2, 2021
1 parent 61d4f9a commit 3c00759
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Build/Scripts/runTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,16 @@ if ! type "docker-compose" > /dev/null; then
exit 1
fi

# docker-compose v2 is enabled by docker for mac as experimental feature without
# asking the user. v2 is currently broken. Detect the version and error out.
DOCKER_COMPOSE_VERSION=`docker-compose version --short`
DOCKER_COMPOSE_MAJOR=`echo $DOCKER_COMPOSE_VERSION | cut -d'.' -f1 | tr -d 'v'`
if [[ "$DOCKER_COMPOSE_MAJOR" -gt "1" ]]; then
echo "docker-compose $DOCKER_COMPOSE_VERSION is currently broken and not supported by runTests.sh."
echo "If you are running Docker Desktop for MacOS/Windows disable 'Use Docker Compose V2 release candidate' (Settings > Experimental Features)"
exit 1
fi

# Go to the directory this script is located, so everything else is relative
# to this dir, no matter from where this script is called.
THIS_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
Expand Down

0 comments on commit 3c00759

Please sign in to comment.