Skip to content

Commit

Permalink
qa: ensure we set git author before committing in tests
Browse files Browse the repository at this point in the history
Prevents env issues during CI.

Signed-off-by: Matthew Weier O'Phinney <matthew@weierophinney.net>
  • Loading branch information
weierophinney committed Aug 12, 2020
1 parent 600b3ae commit f67d56a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ private function createMockChangelog(): string
file_put_contents($changelogFile, self::CHANGELOG_STUB);

(new Process(['git', 'init', '.'], $repo))->mustRun();
(new Process(['git', 'config', 'user.email', 'me@example.com'], $repo))->mustRun();
(new Process(['git', 'config', 'user.name', 'Just Me'], $repo))->mustRun();
(new Process(['git', 'add', '.'], $repo))->mustRun();
(new Process(['git', 'commit', '-m', 'Initial import'], $repo))->mustRun();
(new Process(['git', 'switch', '-c', '1.0.x'], $repo))->mustRun();
Expand Down
2 changes: 2 additions & 0 deletions test/unit/Changelog/ChangelogExistsViaConsoleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ private function createMockRepositoryWithChangelog(): string
);

(new Process(['git', 'init', '.'], $repo))->mustRun();
(new Process(['git', 'config', 'user.email', 'me@example.com'], $repo))->mustRun();
(new Process(['git', 'config', 'user.name', 'Just Me'], $repo))->mustRun();
(new Process(['git', 'add', '.'], $repo))->mustRun();
(new Process(['git', 'commit', '-m', 'Initial import'], $repo))->mustRun();
(new Process(['git', 'switch', '-c', '1.0.x'], $repo))->mustRun();
Expand Down
2 changes: 2 additions & 0 deletions test/unit/Changelog/ReleaseChangelogViaKeepAChangelogTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ private function createMockRepositoryWithChangelog(
);

(new Process(['git', 'init', '.'], $repo))->mustRun();
(new Process(['git', 'config', 'user.email', 'me@example.com'], $repo))->mustRun();
(new Process(['git', 'config', 'user.name', 'Just Me'], $repo))->mustRun();
(new Process(['git', 'add', '.'], $repo))->mustRun();
(new Process(['git', 'commit', '-m', 'Initial import'], $repo))->mustRun();
(new Process(['git', 'switch', '-c', '1.0.x'], $repo))->mustRun();
Expand Down
2 changes: 2 additions & 0 deletions test/unit/Github/CreateReleaseTextViaKeepAChangelogTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ private function createMockRepositoryWithChangelog(

(new Process(['git', 'init', '.'], $repo))->mustRun();
(new Process(['git', 'add', '.'], $repo))->mustRun();
(new Process(['git', 'config', 'user.email', 'me@example.com'], $repo))->mustRun();
(new Process(['git', 'config', 'user.name', 'Just Me'], $repo))->mustRun();
(new Process(['git', 'commit', '-m', 'Initial import'], $repo))->mustRun();
(new Process(['git', 'switch', '-c', '1.0.x'], $repo))->mustRun();

Expand Down

0 comments on commit f67d56a

Please sign in to comment.