Skip to content

Commit

Permalink
Fix handling of test protos
Browse files Browse the repository at this point in the history
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=243851753
  • Loading branch information
cushon authored and ronshapiro committed Apr 18, 2019
1 parent 12ba9de commit c6370e8
Show file tree
Hide file tree
Showing 16 changed files with 25 additions and 39 deletions.
11 changes: 11 additions & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,13 @@
<version>${truth.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<!-- Apache 2.0 -->
<groupId>com.google.truth.extensions</groupId>
<artifactId>truth-proto-extension</artifactId>
<version>${truth.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<!-- Apache 2.0 -->
<groupId>com.google.inject</groupId>
Expand Down Expand Up @@ -390,6 +397,8 @@
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.5.1</version>
<configuration>
<protoSourceRoot>src/main/proto</protoSourceRoot>
<protoTestSourceRoot>src/test/proto</protoTestSourceRoot>
<protocArtifact>com.google.protobuf:protoc:3.4.0:exe:${os.detected.classifier}</protocArtifact>
<pluginId>grpc-java</pluginId>
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.0.1:exe:${os.detected.classifier}</pluginArtifact>
Expand All @@ -399,6 +408,8 @@
<goals>
<goal>compile</goal>
<goal>compile-custom</goal>
<goal>test-compile</goal>
<goal>test-compile-custom</goal>
</goals>
</execution>
</executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,11 @@
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import org.junit.Ignore;

/**
* Tests for {@link MixedDescriptors} bugpattern.
*
* @author [email protected] (Graeme Morgan)
*/
@Ignore("b/74365407 test proto sources are broken")
@RunWith(JUnit4.class)
public final class MixedDescriptorsTest {
private final CompilationTestHelper compilationHelper =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import org.junit.Ignore;

/**
* Tests for {@link ModifiedButNotUsed} bugpattern.
*
Expand Down Expand Up @@ -203,7 +201,7 @@ public void negativeAfterReassignment() {
}

@Test
@Ignore("b/74365407 test proto sources are broken")

public void proto() {
compilationHelper
.addSourceLines(
Expand All @@ -227,7 +225,7 @@ public void proto() {
}

@Test
@Ignore("b/74365407 test proto sources are broken")

public void protoSideEffects() {
refactoringHelper
.addInputLines(
Expand Down Expand Up @@ -258,7 +256,7 @@ public void protoSideEffects() {
}

@Test
@Ignore("b/74365407 test proto sources are broken")

public void protoNegative() {
compilationHelper
.addSourceLines(
Expand Down Expand Up @@ -294,7 +292,7 @@ public void immutableCollection() {
}

@Test
@Ignore("b/74365407 test proto sources are broken")

public void protoUnusedExpression() {
compilationHelper
.addSourceLines(
Expand All @@ -313,7 +311,7 @@ public void protoUnusedExpression() {
}

@Test
@Ignore("b/74365407 test proto sources are broken")

public void protoUnusedButNotModified() {
compilationHelper
.addSourceLines(
Expand All @@ -330,7 +328,7 @@ public void protoUnusedButNotModified() {
}

@Test
@Ignore("b/74365407 test proto sources are broken")

public void protoUnusedExpressionViaBuilderGetter() {
compilationHelper
.addSourceLines(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import org.junit.Ignore;

/** @author [email protected] (Felix Berger) */
@Ignore("b/74365407 test proto sources are broken")
@RunWith(JUnit4.class)
public final class ProtoFieldNullComparisonTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,11 @@
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import org.junit.Ignore;

/**
* Tests for {@link ProtoRedundantSet} bugpattern.
*
* @author [email protected] (Graeme Morgan)
*/
@Ignore("b/74365407 test proto sources are broken")
@RunWith(JUnit4.class)
public final class ProtoRedundantSetTest {
private final CompilationTestHelper compilationHelper =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,11 @@
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import org.junit.Ignore;

/**
* Tests for {@link ProtoTruthMixedDescriptors} bugpattern.
*
* @author [email protected] (Graeme Morgan)
*/
@Ignore("b/74365407 test proto sources are broken")
@RunWith(JUnit4.class)
public final class ProtoTruthMixedDescriptorsTest {
private final CompilationTestHelper compilationHelper =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,11 @@
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import org.junit.Ignore;

/**
* Tests for {@link ProtocolBufferOrdinal}.
*
* @author [email protected] (Sumit Bhagwani)
*/
@Ignore("b/74365407 test proto sources are broken")
@RunWith(JUnit4.class)
public class ProtocolBufferOrdinalTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import org.junit.Ignore;

/** {@link ReferenceEquality}Test */
@RunWith(JUnit4.class)
public class ReferenceEqualityTest {
Expand All @@ -33,7 +31,7 @@ public class ReferenceEqualityTest {
private final BugCheckerRefactoringTestHelper refactoringTestHelper =
BugCheckerRefactoringTestHelper.newInstance(new ReferenceEquality(), getClass());

@Ignore("b/74365407 test proto sources are broken")

@Test
public void protoGetter_nonnull() {
compilationHelper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import org.junit.Ignore;

/** Unit tests for {@link com.google.errorprone.bugpatterns.SizeGreaterThanOrEqualsZero} */
@Ignore("b/74365407 test proto sources are broken")
@RunWith(JUnit4.class)
public class SizeGreaterThanOrEqualsZeroTest {
CompilationTestHelper compilationHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,11 @@
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import org.junit.Ignore;

/**
* Tests for {@link ProtoDurationGetSecondsGetNano}.
*
* @author [email protected] (Kurt Alfred Kluever)
*/
@Ignore("b/74365407 test proto sources are broken")
@RunWith(JUnit4.class)
public class ProtoDurationGetSecondsGetNanoTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,11 @@
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import org.junit.Ignore;

/**
* Tests for {@link ProtoTimestampGetSecondsGetNano}.
*
* @author [email protected] (Kurt Alfred Kluever)
*/
@Ignore("b/74365407 test proto sources are broken")
@RunWith(JUnit4.class)
public class ProtoTimestampGetSecondsGetNanoTest {

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,7 @@ message TestProtoMessage {
extensions 100 to 199;
}

enum TestEnum { TEST_ENUM_VAL = 1; }
enum TestEnum {
UNSPECIFIED = 0;
TEST_ENUM_VAL = 1;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ syntax = "proto2";
package test;

option java_package = "com.google.errorprone.testdata.proto";
option java_mutable_api = true;
option java_enable_dual_generate_mutable_api = true;
option java_mutable_api = true; // MOE:strip_line
option java_enable_dual_generate_mutable_api = true; // MOE:strip_line

message User {
optional string name = 1;
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<guava.version>27.0.1-jre</guava.version>
<gwt.version>2.8.2</gwt.version>
<truth.version>0.36</truth.version>
<truth.version>0.42</truth.version>
<javac.version>9+181-r4173-1</javac.version>
<autovalue.version>1.5.3</autovalue.version>
<junit.version>4.13-beta-1</junit.version>
Expand Down

0 comments on commit c6370e8

Please sign in to comment.