use of com.google.copybara.testing.SkylarkTestExecutor in project copybara by google.
the class GitOriginTest method setup.
@Before
public void setup() throws Exception {
options = new OptionsBuilder();
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"));
checkoutDir = Files.createTempDirectory("checkout");
url = "file://" + remote.toFile().getAbsolutePath();
ref = "other";
moreOriginArgs = "";
origin = origin();
writeFile(remote, "test.txt", "some content");
defaultBranch = repo.simpleCommand("symbolic-ref", "--short", "HEAD").getStdout().trim();
repo.add().files("test.txt").run();
git("commit", "-m", "first file", "--date", COMMIT_TIME);
firstCommitRef = repo.parseRef("HEAD");
originFiles = Glob.ALL_FILES;
}
use of com.google.copybara.testing.SkylarkTestExecutor in project copybara by google.
the class CommandLineGuideTest method setUp.
@Before
public void setUp() throws Exception {
optionsBuilder.general.enableEventMonitor("just testing", eventMonitor);
temp = Files.createTempDirectory("temp");
skylark = new SkylarkTestExecutor(optionsBuilder);
}
use of com.google.copybara.testing.SkylarkTestExecutor in project copybara by google.
the class OnboardCmdTest method setUp.
@Before
public void setUp() throws Exception {
optionsBuilder.general.enableEventMonitor("just testing", eventMonitor);
temp = Files.createTempDirectory("temp");
skylark = new SkylarkTestExecutor(optionsBuilder);
}
use of com.google.copybara.testing.SkylarkTestExecutor in project copybara by google.
the class HgOriginTest method setup.
@Before
public void setup() throws Exception {
options = new OptionsBuilder().setOutputRootToTmpDir();
skylark = new SkylarkTestExecutor(options);
originFiles = Glob.ALL_FILES;
remotePath = Files.createTempDirectory("remote");
url = remotePath.toAbsolutePath().toString();
configRef = "tip";
origin = origin();
repository = new HgRepository(remotePath, /*verbose*/
false, CommandRunner.DEFAULT_TIMEOUT);
repository.init();
}
use of com.google.copybara.testing.SkylarkTestExecutor in project copybara by google.
the class RemoveTest 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);
}
Aggregations