diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 3bf9683..dfc2480 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -1,5 +1,15 @@ name: documentation +# Every "runTests.sh" call below passes "-b docker". The script prefers podman +# whenever it is present and only falls back to docker, which is the right +# default for it -- but GitHub hosted runners ship both, and since 2026-07-29 +# their podman/crun combination aborts the first container start of a job with +# "OCI runtime error: crun: unknown version specified" (exit code 126). It is +# intermittent, hits any job, and was traced to neither the runner image nor +# the TYPO3 testing image changing. Selecting docker here avoids crun entirely +# and leaves the script default and local runs untouched. Drop the flag once +# GitHub stops producing the mismatch. + on: pull_request: @@ -27,7 +37,7 @@ jobs: comment-author: 'github-actions[bot]' - name: "Render documentation" - run: "Build/Scripts/runTests.sh -b podman -s renderDocumentation" + run: "Build/Scripts/runTests.sh -b docker -s renderDocumentation" - uses: actions/upload-artifact@v6 id: documentation-artifact diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4f4f83d..37e00ab 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,4 +1,15 @@ name: publish + +# Every "runTests.sh" call below passes "-b docker". The script prefers podman +# whenever it is present and only falls back to docker, which is the right +# default for it -- but GitHub hosted runners ship both, and since 2026-07-29 +# their podman/crun combination aborts the first container start of a job with +# "OCI runtime error: crun: unknown version specified" (exit code 126). It is +# intermittent, hits any job, and was traced to neither the runner image nor +# the TYPO3 testing image changing. Selecting docker here avoids crun entirely +# and leaves the script default and local runs untouched. Drop the flag once +# GitHub stops producing the mismatch. + on: push: tags: @@ -71,7 +82,7 @@ jobs: - name: "Render documentation" run: | - Build/Scripts/runTests.sh -s renderDocumentation + Build/Scripts/runTests.sh -b docker -s renderDocumentation mkdir -p tailor-version-artefact && \ cd Documentation-GENERATED-temp && \ zip -r ../tailor-version-artefact/${{ env.DETECTED_EXTENSION_KEY }}_${{ env.version }}-documentation.zip . diff --git a/.github/workflows/testcore13.yml b/.github/workflows/testcore13.yml index 04c17d7..c339aa0 100644 --- a/.github/workflows/testcore13.yml +++ b/.github/workflows/testcore13.yml @@ -1,5 +1,15 @@ name: tests core 13 +# Every "runTests.sh" call below passes "-b docker". The script prefers podman +# whenever it is present and only falls back to docker, which is the right +# default for it -- but GitHub hosted runners ship both, and since 2026-07-29 +# their podman/crun combination aborts the first container start of a job with +# "OCI runtime error: crun: unknown version specified" (exit code 126). It is +# intermittent, hits any job, and was traced to neither the runner image nor +# the TYPO3 testing image changing. Selecting docker here avoids crun entirely +# and leaves the script default and local runs untouched. Drop the flag once +# GitHub stops producing the mismatch. + on: pull_request: workflow_dispatch: @@ -17,34 +27,34 @@ jobs: uses: actions/checkout@v6 - name: "Prepare dependencies for TYPO3 v13" - run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s composerUpdate" + run: "Build/Scripts/runTests.sh -b docker -t 13 -p ${{ matrix.php-version }} -s composerUpdate" - name: "Run TypoScript lint" - run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s lintTypoScript" + run: "Build/Scripts/runTests.sh -b docker -t 13 -p ${{ matrix.php-version }} -s lintTypoScript" - name: "Run PHP lint" - run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s lintPhp" + run: "Build/Scripts/runTests.sh -b docker -t 13 -p ${{ matrix.php-version }} -s lintPhp" - name: "Validate CGL" - run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s cgl -n" + run: "Build/Scripts/runTests.sh -b docker -t 13 -p ${{ matrix.php-version }} -s cgl -n" - name: "Ensure tests methods do not start with \"test\"" - run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s checkTestMethodsPrefix" + run: "Build/Scripts/runTests.sh -b docker -t 13 -p ${{ matrix.php-version }} -s checkTestMethodsPrefix" - name: "Ensure UTF-8 files do not contain BOM" - run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s checkBom" + run: "Build/Scripts/runTests.sh -b docker -t 13 -p ${{ matrix.php-version }} -s checkBom" - name: "Verify bundled contrib library composer constraint and lock" - run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s checkContribComposer" + run: "Build/Scripts/runTests.sh -b docker -t 13 -p ${{ matrix.php-version }} -s checkContribComposer" # - name: "Test .rst files for integrity" -# run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s checkRst" +# run: "Build/Scripts/runTests.sh -b docker -t 13 -p ${{ matrix.php-version }} -s checkRst" - name: "Find duplicate exception codes" - run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s checkExceptionCodes" + run: "Build/Scripts/runTests.sh -b docker -t 13 -p ${{ matrix.php-version }} -s checkExceptionCodes" - name: "Run PHPStan" - run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s phpstan" + run: "Build/Scripts/runTests.sh -b docker -t 13 -p ${{ matrix.php-version }} -s phpstan" testsuite: name: all tests with core v13 @@ -59,28 +69,28 @@ jobs: uses: actions/checkout@v6 - name: "Run PHP lint" - run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s lintPhp" + run: "Build/Scripts/runTests.sh -b docker -t 13 -p ${{ matrix.php-version }} -s lintPhp" - name: "Prepare dependencies for TYPO3 v13" - run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s composerUpdate" + run: "Build/Scripts/runTests.sh -b docker -t 13 -p ${{ matrix.php-version }} -s composerUpdate" - name: "Unit" - run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s unit" + run: "Build/Scripts/runTests.sh -b docker -t 13 -p ${{ matrix.php-version }} -s unit" - name: "Functional SQLite" - run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s functional -d sqlite" + run: "Build/Scripts/runTests.sh -b docker -t 13 -p ${{ matrix.php-version }} -s functional -d sqlite" - name: "Functional MariaDB 10.5 mysqli" - run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s functional -d mariadb -a mysqli" + run: "Build/Scripts/runTests.sh -b docker -t 13 -p ${{ matrix.php-version }} -s functional -d mariadb -a mysqli" - name: "Functional MariaDB 10.5 pdo_mysql" - run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s functional -d mariadb -a pdo_mysql" + run: "Build/Scripts/runTests.sh -b docker -t 13 -p ${{ matrix.php-version }} -s functional -d mariadb -a pdo_mysql" - name: "Functional MySQL 8.0 mysqli" - run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s functional -d mariadb -a mysqli" + run: "Build/Scripts/runTests.sh -b docker -t 13 -p ${{ matrix.php-version }} -s functional -d mariadb -a mysqli" - name: "Functional MySQL 8.0 pdo_mysql" - run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s functional -d mariadb -a pdo_mysql" + run: "Build/Scripts/runTests.sh -b docker -t 13 -p ${{ matrix.php-version }} -s functional -d mariadb -a pdo_mysql" - name: "Functional PostgresSQL 10" - run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s functional -d postgres" + run: "Build/Scripts/runTests.sh -b docker -t 13 -p ${{ matrix.php-version }} -s functional -d postgres" diff --git a/.github/workflows/testcore14.yml b/.github/workflows/testcore14.yml index d67d7be..65500ac 100644 --- a/.github/workflows/testcore14.yml +++ b/.github/workflows/testcore14.yml @@ -1,5 +1,15 @@ name: tests core 14 +# Every "runTests.sh" call below passes "-b docker". The script prefers podman +# whenever it is present and only falls back to docker, which is the right +# default for it -- but GitHub hosted runners ship both, and since 2026-07-29 +# their podman/crun combination aborts the first container start of a job with +# "OCI runtime error: crun: unknown version specified" (exit code 126). It is +# intermittent, hits any job, and was traced to neither the runner image nor +# the TYPO3 testing image changing. Selecting docker here avoids crun entirely +# and leaves the script default and local runs untouched. Drop the flag once +# GitHub stops producing the mismatch. + on: pull_request: workflow_dispatch: @@ -17,31 +27,31 @@ jobs: uses: actions/checkout@v6 - name: "Prepare dependencies for TYPO3 v14" - run: "Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php-version }} -s composerUpdate" + run: "Build/Scripts/runTests.sh -b docker -t 14 -p ${{ matrix.php-version }} -s composerUpdate" - name: "Run TypoScript lint" - run: "Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php-version }} -s lintTypoScript" + run: "Build/Scripts/runTests.sh -b docker -t 14 -p ${{ matrix.php-version }} -s lintTypoScript" - name: "Run PHP lint" - run: "Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php-version }} -s lintPhp" + run: "Build/Scripts/runTests.sh -b docker -t 14 -p ${{ matrix.php-version }} -s lintPhp" - name: "Validate CGL" - run: "Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php-version }} -s cgl -n" + run: "Build/Scripts/runTests.sh -b docker -t 14 -p ${{ matrix.php-version }} -s cgl -n" - name: "Ensure tests methods do not start with \"test\"" - run: "Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php-version }} -s checkTestMethodsPrefix" + run: "Build/Scripts/runTests.sh -b docker -t 14 -p ${{ matrix.php-version }} -s checkTestMethodsPrefix" - name: "Ensure UTF-8 files do not contain BOM" - run: "Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php-version }} -s checkBom" + run: "Build/Scripts/runTests.sh -b docker -t 14 -p ${{ matrix.php-version }} -s checkBom" # - name: "Test .rst files for integrity" -# run: "Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php-version }} -s checkRst" +# run: "Build/Scripts/runTests.sh -b docker -t 14 -p ${{ matrix.php-version }} -s checkRst" - name: "Find duplicate exception codes" - run: "Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php-version }} -s checkExceptionCodes" + run: "Build/Scripts/runTests.sh -b docker -t 14 -p ${{ matrix.php-version }} -s checkExceptionCodes" - name: "Run PHPStan" - run: "Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php-version }} -s phpstan" + run: "Build/Scripts/runTests.sh -b docker -t 14 -p ${{ matrix.php-version }} -s phpstan" testsuite: name: all tests with core v14 @@ -56,28 +66,28 @@ jobs: uses: actions/checkout@v6 - name: "Run PHP lint" - run: "Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php-version }} -s lintPhp" + run: "Build/Scripts/runTests.sh -b docker -t 14 -p ${{ matrix.php-version }} -s lintPhp" - name: "Prepare dependencies for TYPO3 v14" - run: "Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php-version }} -s composerUpdate" + run: "Build/Scripts/runTests.sh -b docker -t 14 -p ${{ matrix.php-version }} -s composerUpdate" - name: "Unit" - run: "Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php-version }} -s unit" + run: "Build/Scripts/runTests.sh -b docker -t 14 -p ${{ matrix.php-version }} -s unit" - name: "Functional SQLite" - run: "Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php-version }} -s functional -d sqlite" + run: "Build/Scripts/runTests.sh -b docker -t 14 -p ${{ matrix.php-version }} -s functional -d sqlite" - name: "Functional MariaDB 10.5 mysqli" - run: "Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php-version }} -s functional -d mariadb -a mysqli" + run: "Build/Scripts/runTests.sh -b docker -t 14 -p ${{ matrix.php-version }} -s functional -d mariadb -a mysqli" - name: "Functional MariaDB 10.5 pdo_mysql" - run: "Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php-version }} -s functional -d mariadb -a pdo_mysql" + run: "Build/Scripts/runTests.sh -b docker -t 14 -p ${{ matrix.php-version }} -s functional -d mariadb -a pdo_mysql" - name: "Functional MySQL 8.0 mysqli" - run: "Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php-version }} -s functional -d mariadb -a mysqli" + run: "Build/Scripts/runTests.sh -b docker -t 14 -p ${{ matrix.php-version }} -s functional -d mariadb -a mysqli" - name: "Functional MySQL 8.0 pdo_mysql" - run: "Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php-version }} -s functional -d mariadb -a pdo_mysql" + run: "Build/Scripts/runTests.sh -b docker -t 14 -p ${{ matrix.php-version }} -s functional -d mariadb -a pdo_mysql" - name: "Functional PostgresSQL 10" - run: "Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php-version }} -s functional -d postgres" + run: "Build/Scripts/runTests.sh -b docker -t 14 -p ${{ matrix.php-version }} -s functional -d postgres" diff --git a/Build/Scripts/runTests.sh b/Build/Scripts/runTests.sh index 7c1d4b4..f47688a 100755 --- a/Build/Scripts/runTests.sh +++ b/Build/Scripts/runTests.sh @@ -10,10 +10,13 @@ fi waitFor() { local HOST=${1} local PORT=${2} + # 60 rather than 10 seconds: mysql:8.0 needs 12-13s under docker to + # initialise a fresh data directory, about twice as long as under podman, + # so an 11 second budget aborted the functional mysql suites at random. local TESTCOMMAND=" COUNT=0; while ! nc -z ${HOST} ${PORT}; do - if [ \"\${COUNT}\" -gt 10 ]; then + if [ \"\${COUNT}\" -gt 60 ]; then echo \"Can not connect to ${HOST} port ${PORT}. Aborting.\"; exit 1; fi; @@ -23,7 +26,11 @@ waitFor() { " ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name wait-for-${SUFFIX} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${IMAGE_PHP} /bin/sh -c "${TESTCOMMAND}" if [[ $? -gt 0 ]]; then - kill -SIGINT -$$ + # Not "kill -SIGINT -$$": the SIGINT trap is only installed when CI is + # not "true", so in CI the signal was a no-op, the run continued and the + # test suite connected to a database that was not listening. + cleanUp + exit 1 fi } @@ -555,7 +562,13 @@ case ${TEST_SUITE} in sqlite) # create sqlite tmpfs mount typo3temp/var/tests/functional-sqlite-dbs/ to avoid permission issues mkdir -p "${ROOT_DIR}/.Build/Web/typo3temp/var/tests/functional-sqlite-dbs/" - CONTAINERPARAMS="-e typo3DatabaseDriver=pdo_sqlite --tmpfs ${ROOT_DIR}/.Build/Web/typo3temp/var/tests/functional-sqlite-dbs/:rw,noexec,nosuid -e DEEPL_API_KEY=mock_server -e DEEPL_HOST=deepl-func-${SUFFIX} -e DEEPL_PORT=3000 -e DEEPL_SERVER_URL=deepl-func-${SUFFIX}:3000 -e DEEPL_MOCK_SERVER_PORT=3000 -e DEEPL_SCHEME=http -e DEEPL_MOCKSERVER_USED=1" + # "mode=1777" is required for docker and harmless for podman: docker runs + # the container as "--user $HOST_UID" with group 0, while the tmpfs comes + # up owned by root with mode 0755, so the test databases cannot be created + # and every test fails with "unable to open database file". Rootless podman + # passes no "--user" (it is root inside its user namespace), which is why + # this only shows with docker. + CONTAINERPARAMS="-e typo3DatabaseDriver=pdo_sqlite --tmpfs ${ROOT_DIR}/.Build/Web/typo3temp/var/tests/functional-sqlite-dbs/:rw,noexec,nosuid,mode=1777 -e DEEPL_API_KEY=mock_server -e DEEPL_HOST=deepl-func-${SUFFIX} -e DEEPL_PORT=3000 -e DEEPL_SERVER_URL=deepl-func-${SUFFIX}:3000 -e DEEPL_MOCK_SERVER_PORT=3000 -e DEEPL_SCHEME=http -e DEEPL_MOCKSERVER_USED=1" ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name functional-${SUFFIX} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${CONTAINERPARAMS} ${IMAGE_PHP} "${COMMAND[@]}" SUITE_EXIT_CODE=$? ;; @@ -572,7 +585,7 @@ case ${TEST_SUITE} in SUITE_EXIT_CODE=$? ;; renderDocumentation) - ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name rendering-documentation-${SUFFIX} --pull always -w /project -v ${ROOT_DIR}:/project -it ${IMAGE_RSTRENDERING} --fail-on-error --no-progress --config=Documentation Documentation + ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name rendering-documentation-${SUFFIX} --pull always -w /project -v ${ROOT_DIR}:/project ${IMAGE_RSTRENDERING} --fail-on-error --no-progress --config=Documentation Documentation SUITE_EXIT_CODE=$? ;; phpstan)