Skip to content

Commit

Permalink
minor symfony#1563 [tests] dont sign commits in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jrushlow authored May 19, 2024
1 parent 4e41461 commit 9060cd1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Test/MakerTestEnvironment.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
*/
final class MakerTestEnvironment
{
// Config used for creating tmp flex project and test app's
private const GIT_CONFIG = 'git config user.name "symfony" && git config user.email "test@symfony.com" && git config commit.gpgsign false && git config user.signingkey false';

public const GENERATED_FILES_REGEX = '#(?:created|updated):\s(?:.*\\\\)*(.*\.[a-z]{3,4}).*(?:\\\\n)?#ui';
private Filesystem $fs;
Expand Down Expand Up @@ -173,7 +176,7 @@ public function prepareDirectory(): void

file_put_contents($this->path.'/.gitignore', "var/cache/\nvendor/\n");

MakerTestProcess::create('git diff --quiet || ( git config user.name "symfony" && git config user.email "test@symfony.com" && git add . && git commit -a -m "second commit" )',
MakerTestProcess::create(sprintf('git diff --quiet || ( %s && git add . && git commit -a -m "second commit" )', self::GIT_CONFIG),
$this->path
)->run();
} catch (\Exception $e) {
Expand Down Expand Up @@ -291,7 +294,7 @@ private function buildFlexSkeleton(): void
file_put_contents($this->flexPath.'/.gitignore', "var/cache/\n");

// Force adding vendor/ dir to Git repo in case users exclude it in global .gitignore
MakerTestProcess::create('git init && git config user.name "symfony" && git config user.email "test@symfony.com" && git add . && git add vendor/ -f && git commit -a -m "first commit"',
MakerTestProcess::create(sprintf('git init && %s && git add . && git add vendor/ -f && git commit -a -m "first commit"', self::GIT_CONFIG),
$this->flexPath
)->run();
}
Expand Down

0 comments on commit 9060cd1

Please sign in to comment.