use of com.google.copybara.config.Config in project copybara by google.
the class WorkflowTest method customIdentity_customPathIncluded.
@Test
public void customIdentity_customPathIncluded() throws Exception {
options.workflowOptions.initHistory = true;
byte[] cfgContent = ("" + "core.workflow(\n" + " name = 'default',\n" + " authoring = " + authoring + "\n," + " origin = testing.origin(),\n" + " destination = testing.destination(),\n" + " change_identity = '${copybara_config_path}foo${label:some_label}',\n" + " mode = 'ITERATIVE',\n" + ")\n\n" + "").getBytes(UTF_8);
Config config1 = skylark.loadConfig(new MapConfigFile(ImmutableMap.of("foo/copy.bara.sky", cfgContent), "foo/copy.bara.sky"));
Config config2 = skylark.loadConfig(new MapConfigFile(ImmutableMap.of("bar/copy.bara.sky", cfgContent), "bar/copy.bara.sky"));
origin.addSimpleChange(1, "change\n\nsome_label=a");
config1.getMigration("default").run(workdir, ImmutableList.of());
ImmutableList<String> oneResult = destination.processed.stream().map(ProcessedChange::getChangeIdentity).collect(ImmutableList.toImmutableList());
destination.processed.clear();
config2.getMigration("default").run(workdir, ImmutableList.of());
ImmutableList<String> twoResult = destination.processed.stream().map(ProcessedChange::getChangeIdentity).collect(ImmutableList.toImmutableList());
assertThat(oneResult).isNotEqualTo(twoResult);
}
use of com.google.copybara.config.Config in project copybara by google.
the class MetadataModuleTest method createWorkflow.
private Workflow<?, ?> createWorkflow(WorkflowMode mode, String... transforms) throws IOException, ValidationException {
passThruAuthoring();
Config config = loadConfig("" + "core.workflow(\n" + " name = 'default',\n" + " origin = testing.origin(),\n" + " authoring = " + authoring + "\n," + " destination = testing.destination(),\n" + " mode = '" + mode + "',\n" + " transformations = [" + Joiner.on(", ").join(transforms) + "]\n" + ")\n");
return (Workflow) config.getMigration("default");
}
Aggregations