use of com.google.copybara.util.console.testing.TestingConsole in project copybara by google.
the class BuildifierFormatTest method setup.
@Before
public void setup() throws IOException {
console = new TestingConsole();
options = new OptionsBuilder();
options.setConsole(console);
File buildifier = Paths.get(System.getenv("TEST_SRCDIR")).resolve(System.getenv("TEST_WORKSPACE")).resolve("javatests/com/google/copybara/format").resolve("buildifier").toFile();
options.buildifier.buildifierBin = buildifier.getAbsolutePath();
checkoutDir = Files.createTempDirectory("BuildifierFormatTest");
skylark = new SkylarkTestExecutor(options);
}
use of com.google.copybara.util.console.testing.TestingConsole in project copybara by google.
the class AuthoringTest method setUp.
@Before
public void setUp() throws Exception {
OptionsBuilder options = new OptionsBuilder();
console = new TestingConsole();
options.setConsole(console);
skylark = new SkylarkTestExecutor(options);
}
use of com.google.copybara.util.console.testing.TestingConsole in project copybara by google.
the class BuildozerModifyTest method setup.
@Before
public void setup() throws IOException {
console = new TestingConsole();
options = new OptionsBuilder();
options.setConsole(console);
BuildozerTesting.enable(options);
checkoutDir = Files.createTempDirectory("BuildozerModifyTest");
skylark = new SkylarkTestExecutor(options);
}
use of com.google.copybara.util.console.testing.TestingConsole in project copybara by google.
the class GerritEndpointTest method setup.
@Before
public void setup() throws Exception {
workdir = Jimfs.newFileSystem().getPath("/");
TestingConsole console = new TestingConsole();
OptionsBuilder options = new OptionsBuilder();
options.setConsole(console).setOutputRootToTmpDir();
dummyTrigger = new DummyTrigger();
options.testingOptions.feedbackTrigger = dummyTrigger;
options.testingOptions.checker = new DummyChecker(ImmutableSet.of("badword"));
gitUtil = new GitTestUtil(options);
Path credentialsFile = Files.createTempFile("credentials", "test");
Files.write(credentialsFile, BASE_URL.getBytes(UTF_8));
GitRepository repo = newBareRepo(Files.createTempDirectory("test_repo"), getGitEnv(), /*verbose=*/
true, DEFAULT_TIMEOUT, /*noVerify=*/
false).init().withCredentialHelper("store --file=" + credentialsFile);
gitUtil.mockRemoteGitRepos(new Validator(), repo);
url = BASE_URL + "/foo/bar";
options.general.starlarkMode = "STRICT";
skylark = new SkylarkTestExecutor(options);
}
use of com.google.copybara.util.console.testing.TestingConsole in project copybara by google.
the class GitDestinationReaderTest method setup.
@Before
public void setup() throws Exception {
destinationPath = Files.createTempDirectory("destination");
gitDir = Files.createTempDirectory("gitDir");
console = new TestingConsole();
options = new OptionsBuilder().setConsole(console);
options.setHomeDir(Files.createTempDirectory("home").toString());
origin = new DummyOrigin();
options.testingOptions.origin = origin;
repo = GitRepository.newBareRepo(destinationPath, getGitEnv(), /*verbose=*/
true, DEFAULT_TIMEOUT, /*noVerify=*/
false).withWorkTree(gitDir).init();
primaryBranch = repo.getPrimaryBranch();
options.gitDestination.committerEmail = "commiter@email";
options.gitDestination.committerName = "Bara Kopi";
workDir = Files.createTempDirectory("workdir");
options.setWorkdirToRealTempDir(workDir.toString());
skylark = new SkylarkTestExecutor(options);
origin.singleFileChange(1580341755, "first", "foo/origin.txt", "AAAA").singleFileChange(1580341795, "second", "foo/origin.txt", "BBBB");
}
Aggregations