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

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

                Author: ASF GitHub Bot
            Created on: 30/May/18 20:44
            Start Date: 30/May/18 20:44
    Worklog Time Spent: 10m 
      Work Description: apilloud closed pull request #5518: [BEAM-4402] Run 
test on shadowJar only and always
URL: https://github.com/apache/beam/pull/5518
 
 
   

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 6f38a84bca9..219afe58bc5 100644
--- a/build_rules.gradle
+++ b/build_rules.gradle
@@ -344,6 +344,7 @@ class JavaNatureConfiguration {
 
   //TODO(https://issues.apache.org/jira/browse/BEAM-4394): Should this default 
to true?
   boolean enableSpotless = false // Controls whether spotless plugin enforces 
autoformat
+  boolean testShadowJar = false  // Controls whether tests are run with 
shadowJar
 
   // The shadowJar / shadowTestJar tasks execute the following closure to 
configure themselves.
   // Users can compose their closure with the default closure via:
@@ -581,6 +582,22 @@ ext.applyJavaNature = {
   artifacts.shadow shadowJar
   artifacts.shadowTest shadowTestJar
 
+  if (configuration.testShadowJar) {
+    // 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")
+    }
+
+    test {
+      classpath = configurations.shadowTestRuntimeClasspath
+    }
+  }
+
   if (isRelease() || project.hasProperty('publishing')) {
     apply plugin: "maven-publish"
 
@@ -632,21 +649,6 @@ 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/sdks/java/extensions/sql/build.gradle 
b/sdks/java/extensions/sql/build.gradle
index 44441442944..5cdf5fd74e2 100644
--- a/sdks/java/extensions/sql/build.gradle
+++ b/sdks/java/extensions/sql/build.gradle
@@ -19,7 +19,7 @@ import groovy.json.JsonOutput
  */
 
 apply from: project(":").file("build_rules.gradle")
-applyJavaNature(enableSpotless: true, shadowClosure: DEFAULT_SHADOW_CLOSURE << 
{
+applyJavaNature(enableSpotless: true, testShadowJar: true, shadowClosure: 
DEFAULT_SHADOW_CLOSURE << {
   dependencies {
     include(dependency(library.java.protobuf_java))
     include(dependency(library.java.protobuf_java_util))


 

----------------------------------------------------------------
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: 107373)
    Time Spent: 2h 50m  (was: 2h 40m)

> 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: 2h 50m
>  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