use of com.google.copybara.testing.SkylarkTestExecutor in project copybara by google.
the class SubmodulesInDestinationTest method setup.
@Before
public void setup() throws Exception {
repoGitDir = Files.createTempDirectory("SubmodulesInDestinationTest-repoGitDir");
workdir = Files.createTempDirectory("workdir");
git("init", "--bare", repoGitDir.toString());
console = new TestingConsole();
options = new OptionsBuilder().setConsole(console).setOutputRootToTmpDir();
options.gitDestination.committerEmail = "commiter@email";
options.gitDestination.committerName = "Bara Kopi";
destinationFiles = Glob.createGlob(ImmutableList.of("**"));
url = "file://" + repoGitDir;
skylark = new SkylarkTestExecutor(options);
submodule = GitRepository.newBareRepo(Files.createTempDirectory("gitdir"), getGitEnv(), /*verbose=*/
true, DEFAULT_TIMEOUT, /*noVerify=*/
false).withWorkTree(Files.createTempDirectory("worktree")).init();
primaryBranch = submodule.getPrimaryBranch();
Files.write(submodule.getWorkTree().resolve("foo"), new byte[] { 1 });
submodule.add().files("foo").run();
submodule.simpleCommand("commit", "-m", "dummy commit");
}
use of com.google.copybara.testing.SkylarkTestExecutor in project copybara by google.
the class LatestVersionSelectorTest method setup.
@Before
public void setup() throws Exception {
options = new OptionsBuilder();
TestingConsole console = new TestingConsole();
options = new OptionsBuilder().setConsole(console).setOutputRootToTmpDir();
skylark = new SkylarkTestExecutor(options);
// Pass custom HOME directory so that we run an hermetic test and we
// can add custom configuration to $HOME/.gitconfig.
Path userHomeForTest = Files.createTempDirectory("home");
options.setEnvironment(GitTestUtil.getGitEnv().getEnvironment());
options.setHomeDir(userHomeForTest.toString());
createTestRepo(Files.createTempDirectory("remote"));
url = "file://" + remote.toFile().getAbsolutePath();
writeFile(remote, "test.txt", "some content");
repo.add().files("test.txt").run();
git("commit", "-m", "first file", "--date", COMMIT_TIME);
cliReference = "foo";
}
use of com.google.copybara.testing.SkylarkTestExecutor in project copybara by google.
the class CopyOrMoveTest method setup.
@Before
public void setup() throws IOException {
FileSystem fs = Jimfs.newFileSystem();
checkoutDir = fs.getPath("/test-checkoutDir");
Files.createDirectories(checkoutDir);
console = new TestingConsole();
options = new OptionsBuilder().setConsole(console);
skylark = new SkylarkTestExecutor(options);
}
use of com.google.copybara.testing.SkylarkTestExecutor in project copybara by google.
the class SkylarkTransformationTest method setup.
@Before
public void setup() throws IOException {
FileSystem fs = Jimfs.newFileSystem();
checkoutDir = fs.getPath("/test-checkoutDir");
Files.createDirectories(checkoutDir);
console = new TestingConsole();
options = new OptionsBuilder().setConsole(console);
skylark = new SkylarkTestExecutor(options);
transformWork = TransformWorks.of(checkoutDir, "testmsg", console);
}
use of com.google.copybara.testing.SkylarkTestExecutor in project copybara by google.
the class VerifyMatchTest method setup.
@Before
public void setup() throws IOException {
FileSystem fs = Jimfs.newFileSystem();
checkoutDir = fs.getPath("/");
Files.createDirectories(checkoutDir);
console = new TestingConsole();
options = new OptionsBuilder().setConsole(console);
skylark = new SkylarkTestExecutor(options);
}
Aggregations