use of com.google.copybara.testing.git.GitTestUtil.CompleteRefValidator in project copybara by google.
the class GitHubPrDestinationTest method setup.
@Before
public void setup() throws Exception {
repoGitDir = Files.createTempDirectory("GitHubPrDestinationTest-repoGitDir");
workdir = Files.createTempDirectory("workdir");
git("init", "--bare", repoGitDir.toString());
console = new TestingConsole();
options = new OptionsBuilder().setConsole(console).setForce(true).setOutputRootToTmpDir();
gitUtil = new GitTestUtil(options);
gitUtil.mockRemoteGitRepos(new CompleteRefValidator());
Path credentialsFile = Files.createTempFile("credentials", "test");
Files.write(credentialsFile, "https://user:SECRET@github.com".getBytes(UTF_8));
options.git.credentialHelperStorePath = credentialsFile.toString();
options.gitDestination = new GitDestinationOptions(options.general, options.git);
options.gitDestination.committerEmail = "commiter@email";
options.gitDestination.committerName = "Bara Kopi";
skylark = new SkylarkTestExecutor(options);
primaryBranchMigration = "False";
}
use of com.google.copybara.testing.git.GitTestUtil.CompleteRefValidator in project copybara by google.
the class GitHubDestinationTest method setup.
@Before
public void setup() throws Exception {
console = new TestingConsole();
options = new OptionsBuilder().setConsole(console).setOutputRootToTmpDir();
options.testingOptions.checker = new DummyChecker(ImmutableSet.of("bad_word"));
workdir = Files.createTempDirectory("workdir");
destinationFiles = Glob.createGlob(ImmutableList.of("**"));
gitUtil = new GitTestUtil(options);
gitUtil.mockRemoteGitRepos(new CompleteRefValidator());
remote = gitUtil.mockRemoteRepo("github.com/foo");
primaryBranch = remote.getPrimaryBranch();
Path credentialsFile = Files.createTempFile("credentials", "test");
Files.write(credentialsFile, "https://user:SECRET@github.com".getBytes(UTF_8));
options.git.credentialHelperStorePath = credentialsFile.toString();
options.gitDestination = new GitDestinationOptions(options.general, options.git);
options.gitDestination.committerEmail = "commiter@email";
options.gitDestination.committerName = "Bara Kopi";
url = "https://github.com/foo";
force = false;
fetch = primaryBranch;
push = primaryBranch;
skylark = new SkylarkTestExecutor(options);
}
use of com.google.copybara.testing.git.GitTestUtil.CompleteRefValidator in project copybara by google.
the class GitHubPrOriginTest method setup.
@Before
public void setup() throws Exception {
repoGitDir = Files.createTempDirectory("GitHubPrDestinationTest-repoGitDir");
workdir = Files.createTempDirectory("workdir");
git("init", "--bare", repoGitDir.toString());
console = new TestingConsole();
options = new OptionsBuilder().setConsole(console).setOutputRootToTmpDir();
gitUtil = new GitTestUtil(options);
gitUtil.mockRemoteGitRepos(new CompleteRefValidator());
Path credentialsFile = Files.createTempFile("credentials", "test");
Files.write(credentialsFile, "https://user:SECRET@github.com".getBytes(UTF_8));
options.git.credentialHelperStorePath = credentialsFile.toString();
skylark = new SkylarkTestExecutor(options);
}
Aggregations