Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build: false
image: Visual Studio 2022
clone_folder: c:\projects\grumphp
clone_depth: 1
shallow_clone: false
Expand Down
7 changes: 7 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
>
<php>
<ini name="error_reporting" value="-1" />
<!--
Since git 2.47, commits spawn a detached auto maintenance process that keeps writing
.git/objects/maintenance.lock after the commit returns, racing the E2E cleanup of the test repos.
-->
<env name="GIT_CONFIG_COUNT" value="1" />
<env name="GIT_CONFIG_KEY_0" value="maintenance.auto" />
<env name="GIT_CONFIG_VALUE_0" value="false" />
</php>
<testsuites>
<testsuite name="Unit">
Expand Down
34 changes: 1 addition & 33 deletions test/E2E/AbstractE2ETestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down Expand Up @@ -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);
Expand Down
Loading