[ 
https://issues.apache.org/jira/browse/BEAM-4402?focusedWorklogId=107298&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-107298
 ]

ASF GitHub Bot logged work on BEAM-4402:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 30/May/18 18:16
            Start Date: 30/May/18 18:16
    Worklog Time Spent: 10m 
      Work Description: lukecwik closed pull request #5471: [BEAM-4402] Test 
shadowJar everywhere
URL: https://github.com/apache/beam/pull/5471
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/build_rules.gradle b/build_rules.gradle
index 94f02d47f0b..6f38a84bca9 100644
--- a/build_rules.gradle
+++ b/build_rules.gradle
@@ -632,6 +632,21 @@ artifactId=${project.name}
     }
     artifacts.archives javadocJar
 
+    // Use a configuration and dependency set which represents the execution 
classpath using shaded artifacts for tests.
+    configurations {
+      shadowTestRuntimeClasspath
+    }
+
+    dependencies {
+      shadowTestRuntimeClasspath project(path: project.path, configuration: 
"shadowTest")
+      shadowTestRuntimeClasspath project(path: project.path, configuration: 
"provided")
+      shadowTestRuntimeClasspath project(path: project.path, configuration: 
"runtime")
+    }
+
+    test {
+      classpath = configurations.shadowTestRuntimeClasspath
+    }
+
     // Only sign artifacts if we are performing a release
     if (isRelease()) {
       apply plugin: "signing"
diff --git a/runners/direct-java/build.gradle b/runners/direct-java/build.gradle
index 893f21149b5..509108e6bb3 100644
--- a/runners/direct-java/build.gradle
+++ b/runners/direct-java/build.gradle
@@ -23,15 +23,19 @@ applyJavaNature(shadowClosure: DEFAULT_SHADOW_CLOSURE << {
   dependencies {
     include(dependency(library.java.protobuf_java))
     include(dependency(library.java.protobuf_java_util))
+    include(dependency("io.grpc:.*"))
     include(project(path: ":beam-model-pipeline", configuration: "shadow"))
+    include(project(path: ":beam-model-fn-execution", configuration: "shadow"))
     include(project(path: ":beam-runners-core-construction-java", 
configuration: "shadow"))
     include(project(path: ":beam-runners-core-java", configuration: "shadow"))
+    include(project(path: ":beam-runners-java-fn-execution", configuration: 
"shadow"))
     include(project(path: ":beam-runners-local-java-core", configuration: 
"shadow"))
   }
-  relocate "org.apache.beam.runners.core", getJavaRelocatedPath("runners.core")
-  relocate "org.apache.beam.model", getJavaRelocatedPath("model")
   relocate "com.google.protobuf", getJavaRelocatedPath("com.google.protobuf")
-  relocate "javax.annotation", getJavaRelocatedPath("javax.annotation")
+  relocate "io.grpc", getJavaRelocatedPath("io.grpc")
+  relocate "org.apache.beam.model", getJavaRelocatedPath("model")
+  relocate "org.apache.beam.runners.core", getJavaRelocatedPath("runners.core")
+  relocate "org.apache.beam.runners.fnexecution", 
getJavaRelocatedPath("runners.fnexecution")
 })
 
 description = "Apache Beam :: Runners :: Direct Java"
@@ -55,10 +59,10 @@ dependencies {
   compile project(path: ":beam-model-pipeline", configuration: "shadow")
   compile project(path: ":beam-runners-core-construction-java", configuration: 
"shadow")
   compile project(path: ":beam-runners-core-java", configuration: "shadow")
-  compile project(path: ":beam-runners-local-java-core", configuration: 
"shadow")
   compile project(path: ":beam-runners-java-fn-execution", configuration: 
"shadow")
-  compile project(path: ":beam-sdks-java-fn-execution", configuration: 
"shadow")
+  compile project(path: ":beam-runners-local-java-core", configuration: 
"shadow")
   shadow project(path: ":beam-sdks-java-core", configuration: "shadow")
+  shadow project(path: ":beam-sdks-java-fn-execution", configuration: "shadow")
   shadow library.java.joda_time
   shadow library.java.findbugs_jsr305
   shadow library.java.slf4j_api
diff --git a/sdks/java/extensions/sql/build.gradle 
b/sdks/java/extensions/sql/build.gradle
index 51d2f78c7ea..44441442944 100644
--- a/sdks/java/extensions/sql/build.gradle
+++ b/sdks/java/extensions/sql/build.gradle
@@ -49,9 +49,6 @@ configurations {
   // TODO: Migrate to a FMPP plugin once one exists
   fmppTask
   fmppTemplates
-
-  // Run tests from shaded jar
-  shadowTestRuntimeClasspath
 }
 
 def calcite_version = "1.16.0"
@@ -85,12 +82,6 @@ dependencies {
   shadowTest library.java.hamcrest_core
   shadowTest library.java.mockito_core
   shadowTest library.java.quickcheck_core
-  shadowTestRuntimeClasspath project(path: project.path, configuration: 
"shadowTest")
-  shadowTestRuntimeClasspath project(path: project.path, configuration: 
"provided")
-}
-
-test {
-  classpath = configurations.shadowTestRuntimeClasspath
 }
 
 // Copy Caclcite templates and our own template into the build directory
diff --git a/sdks/java/io/kinesis/build.gradle 
b/sdks/java/io/kinesis/build.gradle
index 4df04a26efa..87f6e865cab 100644
--- a/sdks/java/io/kinesis/build.gradle
+++ b/sdks/java/io/kinesis/build.gradle
@@ -32,9 +32,9 @@ test {
 def aws_version = "1.11.255"
 
 dependencies {
-  compile library.java.guava
   compileOnly library.java.findbugs_annotations
   shadow project(path: ":beam-sdks-java-core", configuration: "shadow")
+  shadow library.java.guava
   shadow library.java.slf4j_api
   shadow library.java.joda_time
   shadow library.java.findbugs_jsr305


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 107298)
    Time Spent: 2.5h  (was: 2h 20m)

> Run tests against shaded JAR
> ----------------------------
>
>                 Key: BEAM-4402
>                 URL: https://issues.apache.org/jira/browse/BEAM-4402
>             Project: Beam
>          Issue Type: New Feature
>          Components: build-system
>            Reporter: Andrew Pilloud
>            Assignee: Andrew Pilloud
>            Priority: Major
>          Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> We should run our tests against shaded jars.
> SeeĀ https://github.com/apache/beam/pull/5471



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to