Fix build tools git tests on windows 7x (#63456)
* Add error logging for git commands in build-tools integTests * Explicitly set user and email in git related func tests
This commit is contained in:
parent
acbd48f834
commit
26f58c8bdb
|
@ -112,8 +112,19 @@ abstract class AbstractGradleFuncTest extends Specification {
|
||||||
}
|
}
|
||||||
|
|
||||||
void setupLocalGitRepo() {
|
void setupLocalGitRepo() {
|
||||||
"git init".execute(Collections.emptyList(), testProjectDir.root).waitFor()
|
execute("git init")
|
||||||
"git add .".execute(Collections.emptyList(), testProjectDir.root).waitFor()
|
execute('git config user.email "build-tool@elastic.co"')
|
||||||
'git commit -m "Initial"'.execute(Collections.emptyList(), testProjectDir.root).waitFor()
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,10 +142,12 @@ class InternalDistributionBwcSetupPluginFuncTest extends AbstractGradleFuncTest
|
||||||
FileUtils.copyDirectory(new File(fakeRemote.file), workingRemoteGit)
|
FileUtils.copyDirectory(new File(fakeRemote.file), workingRemoteGit)
|
||||||
fakeRemote.file + "/.git"
|
fakeRemote.file + "/.git"
|
||||||
gradleRunner(workingRemoteGit, "wrapper").build()
|
gradleRunner(workingRemoteGit, "wrapper").build()
|
||||||
"git init".execute(Collections.emptyList(), workingRemoteGit).waitFor()
|
execute("git init", workingRemoteGit)
|
||||||
"git add .".execute(Collections.emptyList(), workingRemoteGit).waitFor()
|
execute('git config user.email "build-tool@elastic.co"', workingRemoteGit)
|
||||||
'git commit -m"Initial"'.execute(Collections.emptyList(), workingRemoteGit).waitFor()
|
execute('git config user.name "Build tool"', workingRemoteGit)
|
||||||
"git checkout -b origin/8.0".execute(Collections.emptyList(), workingRemoteGit).waitFor()
|
execute("git add .", workingRemoteGit)
|
||||||
|
execute('git commit -m"Initial"', workingRemoteGit)
|
||||||
|
execute("git checkout -b origin/8.0", workingRemoteGit)
|
||||||
return workingRemoteGit;
|
return workingRemoteGit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue