use of com.google.copybara.TransformationStatus in project copybara by google.
the class CopyOrMoveTest method testDoesntExistMover.
@Test
public void testDoesntExistMover() throws Exception {
CopyOrMove mover = skylark.eval("m", "" + "m = core.move(before = 'blablabla', after = 'other')\n");
TransformationStatus status = transform(mover);
assertThat(status.isNoop()).isTrue();
assertThat(status.getMessage()).contains("Error moving 'blablabla'. It doesn't exist");
}
use of com.google.copybara.TransformationStatus in project copybara by google.
the class CopyOrMoveTest method testDoesntExistAsWarning.
@Test
public void testDoesntExistAsWarning() throws Exception {
options.workflowOptions.ignoreNoop = true;
CopyOrMove mover = skylark.eval("m", "" + "m = core.move(before = 'blablabla', after = 'other')\n");
TransformationStatus status = transform(mover);
assertThat(status.isNoop()).isTrue();
assertThat(status.getMessage()).matches(".*blablabla.*doesn't exist.*");
}
use of com.google.copybara.TransformationStatus in project copybara by google.
the class SequenceTest method testSequence_noopIfAllNoop_someChildNoops.
@Test
public void testSequence_noopIfAllNoop_someChildNoops() throws Exception {
TransformWork work = uncachedTreeStateTransformWork();
MockTransform t1 = new MockTransform("t1");
MockTransform t2 = new MockTransform("t2").setNoop(true);
MockTransform t3 = new MockTransform("t3");
Transformation t = sequence(Sequence.NoopBehavior.NOOP_IF_ALL_NOOP, t1, t2, t3);
TransformationStatus status = t.transform(work);
assertThat(t1.wasRun).isTrue();
assertThat(t2.wasRun).isTrue();
assertThat(t3.wasRun).isTrue();
assertThat(status.isSuccess()).isTrue();
}
use of com.google.copybara.TransformationStatus in project copybara by google.
the class SequenceTest method testSequence_ignoreNoop_someChildNoops.
@Test
public void testSequence_ignoreNoop_someChildNoops() throws Exception {
TransformWork work = uncachedTreeStateTransformWork();
MockTransform t1 = new MockTransform("t1");
MockTransform t2 = new MockTransform("t2").setNoop(true);
MockTransform t3 = new MockTransform("t3");
Transformation t = sequence(Sequence.NoopBehavior.IGNORE_NOOP, t1, t2, t3);
TransformationStatus status = t.transform(work);
assertThat(t1.wasRun).isTrue();
assertThat(t2.wasRun).isTrue();
assertThat(t3.wasRun).isTrue();
assertThat(status.isSuccess()).isTrue();
}
use of com.google.copybara.TransformationStatus in project copybara by google.
the class SequenceTest method testSequence_ignoreNoop_insideFailIfAnyNoop.
@Test
public void testSequence_ignoreNoop_insideFailIfAnyNoop() throws Exception {
TransformWork work = uncachedTreeStateTransformWork();
MockTransform t1 = new MockTransform("t1").setNoop(true);
Transformation t = sequence(Sequence.NoopBehavior.FAIL_IF_ANY_NOOP, sequence(Sequence.NoopBehavior.IGNORE_NOOP, t1));
TransformationStatus status = t.transform(work);
assertThat(t1.wasRun).isTrue();
assertThat(status.isSuccess()).isTrue();
}
Aggregations