diff --git a/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/fixtures/AbstractGradleFuncTest.groovy b/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/fixtures/AbstractGradleFuncTest.groovy index 90734ac4fef..69658330127 100644 --- a/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/fixtures/AbstractGradleFuncTest.groovy +++ b/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/fixtures/AbstractGradleFuncTest.groovy @@ -112,8 +112,19 @@ abstract class AbstractGradleFuncTest extends Specification { } void setupLocalGitRepo() { - "git init".execute(Collections.emptyList(), testProjectDir.root).waitFor() - "git add .".execute(Collections.emptyList(), testProjectDir.root).waitFor() - 'git commit -m "Initial"'.execute(Collections.emptyList(), testProjectDir.root).waitFor() + execute("git init") + execute('git config user.email "build-tool@elastic.co"') + execute('git config user.name "Build tool"') + execute("git add .") + execute('git commit -m "Initial"') + } + + void execute(String command, File workingDir = testProjectDir.root) { + def proc = command.execute(Collections.emptyList(), workingDir) + proc.waitFor() + if(proc.exitValue()) { + println "Error running command ${command}:" + println "Syserr: " + proc.errorStream.text + } } } diff --git a/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/internal/InternalDistributionBwcSetupPluginFuncTest.groovy b/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/internal/InternalDistributionBwcSetupPluginFuncTest.groovy index 295d3a38f32..3b4132eaec5 100644 --- a/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/internal/InternalDistributionBwcSetupPluginFuncTest.groovy +++ b/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/internal/InternalDistributionBwcSetupPluginFuncTest.groovy @@ -142,10 +142,12 @@ class InternalDistributionBwcSetupPluginFuncTest extends AbstractGradleFuncTest FileUtils.copyDirectory(new File(fakeRemote.file), workingRemoteGit) fakeRemote.file + "/.git" gradleRunner(workingRemoteGit, "wrapper").build() - "git init".execute(Collections.emptyList(), workingRemoteGit).waitFor() - "git add .".execute(Collections.emptyList(), workingRemoteGit).waitFor() - 'git commit -m"Initial"'.execute(Collections.emptyList(), workingRemoteGit).waitFor() - "git checkout -b origin/8.0".execute(Collections.emptyList(), workingRemoteGit).waitFor() + execute("git init", workingRemoteGit) + execute('git config user.email "build-tool@elastic.co"', workingRemoteGit) + execute('git config user.name "Build tool"', workingRemoteGit) + execute("git add .", workingRemoteGit) + execute('git commit -m"Initial"', workingRemoteGit) + execute("git checkout -b origin/8.0", workingRemoteGit) return workingRemoteGit; } }