From e24938437500b610576971aace43514309dce2c2 Mon Sep 17 00:00:00 2001 From: Thomas Groh Date: Thu, 12 May 2016 17:56:17 -0700 Subject: [PATCH] Run RunnableOnServiceTests with the InProcessPipelineRunner --- sdk/pom.xml | 27 +++++++++++++++++++ .../sdk/testing/DataflowAssertTest.java | 4 ++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/sdk/pom.xml b/sdk/pom.xml index 40d9c5cf98..11b836b3fd 100644 --- a/sdk/pom.xml +++ b/sdk/pom.xml @@ -141,6 +141,33 @@ maven-compiler-plugin + + org.apache.maven.plugins + maven-surefire-plugin + + + InProcessPipelineRunnerTests + integration-test + + test + + + com.google.cloud.dataflow.sdk.testing.RunnableOnService + none + true + + false + + [ + "--runner=InProcessPipelineRunner" + ] + + + + + + + org.apache.maven.plugins maven-dependency-plugin diff --git a/sdk/src/test/java/com/google/cloud/dataflow/sdk/testing/DataflowAssertTest.java b/sdk/src/test/java/com/google/cloud/dataflow/sdk/testing/DataflowAssertTest.java index 2cd3014b11..0380bb6be8 100644 --- a/sdk/src/test/java/com/google/cloud/dataflow/sdk/testing/DataflowAssertTest.java +++ b/sdk/src/test/java/com/google/cloud/dataflow/sdk/testing/DataflowAssertTest.java @@ -27,6 +27,7 @@ import com.google.cloud.dataflow.sdk.coders.AtomicCoder; import com.google.cloud.dataflow.sdk.coders.CoderException; import com.google.cloud.dataflow.sdk.runners.DirectPipelineRunner; +import com.google.cloud.dataflow.sdk.runners.inprocess.InProcessPipelineRunner; import com.google.cloud.dataflow.sdk.transforms.Create; import com.google.cloud.dataflow.sdk.transforms.SerializableFunction; import com.google.cloud.dataflow.sdk.util.common.ElementByteSizeObserver; @@ -302,7 +303,8 @@ public void testContainsInAnyOrderFalse() throws Exception { private static Throwable runExpectingAssertionFailure(Pipeline pipeline) { // Even though this test will succeed or fail adequately whether local or on the service, // it results in a different exception depending on the runner. - if (pipeline.getRunner() instanceof DirectPipelineRunner) { + if (pipeline.getRunner() instanceof DirectPipelineRunner + || pipeline.getRunner() instanceof InProcessPipelineRunner) { // We cannot use thrown.expect(AssertionError.class) because the AssertionError // is first caught by JUnit and causes a test failure. try {