Skip to content

[tests] dont sign commits in tests #1563

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 19, 2024
Merged
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
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 "[email protected]" && 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 "[email protected]" && 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 "[email protected]" && 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