From 4cb4b09a81ebd291bdad0b70e5aea19e46b29905 Mon Sep 17 00:00:00 2001 From: Toon Verwerft Date: Fri, 25 Sep 2026 07:56:33 +0200 Subject: [PATCH 1/2] Fix E2E failures on v2.x and with git 2.47+ The E2E tests fail for two unrelated reasons. On the v2.x branch, every test that installs composer fails, locally and in CI. The generated test project required phpro/grumphp as `dev-@dev`, but composer reads a version-like branch such as `v2.x` as `2.x-dev`, so the constraint never matched. PR builds run on a detached HEAD and fell back to the commit sha, which is why they kept passing. I replaced the constraint with `*@dev`. The path repository is canonical for phpro/grumphp, so this always resolves to the local checkout. The random failures on the macOS runners come from git 2.47+. There, a commit starts a detached auto maintenance process that creates and removes `.git/objects/maintenance.lock` after the commit has returned, and that races the recursive chmod in the test cleanup. `phpunit.xml.dist` now disables `maintenance.auto` through the `GIT_CONFIG_COUNT`/`KEY`/`VALUE` environment variables, which every git process spawned by the tests inherits. I could not reproduce this one locally on git 2.39, so CI is the real check. --- phpunit.xml.dist | 7 +++++++ test/E2E/AbstractE2ETestCase.php | 34 +------------------------------- 2 files changed, 8 insertions(+), 33 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 8bf2cef52..bda185a31 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -9,6 +9,13 @@ > + + + + diff --git a/test/E2E/AbstractE2ETestCase.php b/test/E2E/AbstractE2ETestCase.php index 6f093604c..ac7d25c97 100644 --- a/test/E2E/AbstractE2ETestCase.php +++ b/test/E2E/AbstractE2ETestCase.php @@ -121,7 +121,7 @@ protected function initializeComposer(string $path): string '--name=grumphp/testsuite'.$this->hash, '--type=library', '--require=php:*', - '--require-dev=phpro/grumphp:'.$this->detectCurrentGrumphpGitBranchForComposerWithFallback(), + '--require-dev=phpro/grumphp:*@dev', '--require-dev=phpunit/phpunit:*', '--author=GrumPHP Testsuite', '--repository='.json_encode([ @@ -156,38 +156,6 @@ protected function initializeComposer(string $path): string return $composerFile; } - private function detectCurrentGrumphpGitBranchForComposerWithFallback(): string - { - $gitExecutable = $this->executableFinder->find('git'); - $process = new Process([$gitExecutable, 'rev-parse', '--abbrev-ref', 'HEAD']); - $process->run(); - - if (!$process->isSuccessful()) { - return '*'; - } - - // Detached HEAD (for CI) - $version = trim($process->getOutput()); - if ('HEAD' === $version) { - // Check if current commit matches a tag: - $process = new Process([$gitExecutable, 'describe', '--exact-match']); - $process->run(); - if ($process->isSuccessful()) { - return trim($process->getOutput()); - } - - // Load the sha hash instead - $process = new Process([$gitExecutable, 'rev-parse', '--verify', 'HEAD']); - $process->run(); - if (!$process->isSuccessful()) { - return '*'; - } - $version = trim($process->getOutput()); - } - - return 'dev-'.$version.'@dev'; - } - protected function mergeComposerConfig(string $composerFile, array $config, $recursive = true) { $this->assertFileExists($composerFile); From b6c7a4a62d73dbe3c1511f9ab629ecc3fa0a9d3d Mon Sep 17 00:00:00 2001 From: Toon Verwerft Date: Fri, 25 Sep 2026 08:26:07 +0200 Subject: [PATCH 2/2] Run AppVeyor on the Visual Studio 2022 image Without an image, AppVeyor uses Windows Server 2012 R2. There, choco install vcredist140 (needed for PHP 8.4+) regularly fails the TLS handshake with download.visualstudio.microsoft.com ("Could not create SSL/TLS secure channel"), while the same URL downloads fine in other jobs. The Visual Studio 2022 image runs on Windows Server 2019, which has a newer TLS stack. --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index 0a6461ab4..e194bf79c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,5 @@ build: false +image: Visual Studio 2022 clone_folder: c:\projects\grumphp clone_depth: 1 shallow_clone: false