use of com.google.rpc.PreconditionFailure.Violation in project bazel-buildfarm by bazelbuild.
the class AbstractServerInstanceTest method nestedOutputDirectoriesAreInvalid.
@Test
public void nestedOutputDirectoriesAreInvalid() {
PreconditionFailure.Builder preconditionFailureBuilder = PreconditionFailure.newBuilder();
AbstractServerInstance.validateOutputs(ImmutableSet.of(), ImmutableSet.of(), ImmutableSet.of(), ImmutableSet.of("foo", "foo/bar"), preconditionFailureBuilder);
PreconditionFailure preconditionFailure = preconditionFailureBuilder.build();
assertThat(preconditionFailure.getViolationsCount()).isEqualTo(1);
Violation violation = preconditionFailure.getViolationsList().get(0);
assertThat(violation.getType()).isEqualTo(VIOLATION_TYPE_INVALID);
assertThat(violation.getSubject()).isEqualTo("foo");
assertThat(violation.getDescription()).isEqualTo(OUTPUT_DIRECTORY_IS_OUTPUT_ANCESTOR);
}
use of com.google.rpc.PreconditionFailure.Violation in project bazel-buildfarm by bazelbuild.
the class AbstractServerInstanceTest method outputDirectoriesContainingOutputFilesAreInvalid.
@Test
public void outputDirectoriesContainingOutputFilesAreInvalid() {
PreconditionFailure.Builder preconditionFailureBuilder = PreconditionFailure.newBuilder();
AbstractServerInstance.validateOutputs(ImmutableSet.of(), ImmutableSet.of(), ImmutableSet.of("foo/bar"), ImmutableSet.of("foo"), preconditionFailureBuilder);
PreconditionFailure preconditionFailure = preconditionFailureBuilder.build();
assertThat(preconditionFailure.getViolationsCount()).isEqualTo(1);
Violation violation = preconditionFailure.getViolationsList().get(0);
assertThat(violation.getType()).isEqualTo(VIOLATION_TYPE_INVALID);
assertThat(violation.getSubject()).isEqualTo("foo");
assertThat(violation.getDescription()).isEqualTo(OUTPUT_DIRECTORY_IS_OUTPUT_ANCESTOR);
}
Aggregations