Skip to content

Commit 1df7d7e

Browse files
authored
Revert "all: let interop test use shaded dependency correctly (#6780)"
This reverts commit c5f48b8. (#6780) Revert because caused a regression in the ALTS tests. https://source.cloud.google.com/results/invocations/691d9965-fea1-487d-b606-352a5234039e/targets/grpc%2Fcore%2Fpull_request%2Flinux%2Fgrpc_interop_toprod/log 2020-03-01 20:02:12,491 Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lang3/SystemUtils at io.grpc.alts.CheckGcpEnvironment.isRunningOnGcp(CheckGcpEnvironment.java:69) at io.grpc.alts.CheckGcpEnvironment.isOnGcp(CheckGcpEnvironment.java:44) at io.grpc.alts.ComputeEngineChannelBuilder.(ComputeEngineChannelBuilder.java:62) at io.grpc.alts.ComputeEngineChannelBuilder.forTarget(ComputeEngineChannelBuilder.java:72) at io.grpc.alts.ComputeEngineChannelBuilder.forAddress(ComputeEngineChannelBuilder.java:77) at io.grpc.testing.integration.TestServiceClient$Tester.createChannel(TestServiceClient.java:399) at io.grpc.testing.integration.AbstractInteropTest.setUp(AbstractInteropTest.java:309) at io.grpc.testing.integration.TestServiceClient.setUp(TestServiceClient.java:198) at io.grpc.testing.integration.TestServiceClient.main(TestServiceClient.java:56) Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang3.SystemUtils at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 9 more
1 parent 6a7e47b commit 1df7d7e

File tree

5 files changed

+19
-22
lines changed

5 files changed

+19
-22
lines changed

alts/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ dependencies {
3838
libraries.truth
3939
testRuntime libraries.netty_tcnative,
4040
libraries.netty_epoll
41-
shadow project(path: ':grpc-netty-shaded', configuration: 'shadow')
4241
signature 'org.codehaus.mojo.signature:java17:1.0@signature'
4342
}
4443

gae-interop-testing/gae-jdk8/build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ dependencies {
5050
compile project(":grpc-okhttp")
5151
compile project(":grpc-protobuf")
5252
compile project(":grpc-stub")
53-
compile (project(":grpc-interop-testing")) {
54-
exclude group: "io.grpc", module: "grpc-netty-shaded"
55-
}
53+
compile project(":grpc-interop-testing")
5654
compile libraries.netty_tcnative
5755
}
5856

interop-testing/build.gradle

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ configurations {
1616
evaluationDependsOn(project(':grpc-context').path)
1717

1818
dependencies {
19-
compile project(path: ':grpc-alts', configuration: 'shadow'),
19+
compile project(':grpc-alts'),
2020
project(':grpc-auth'),
2121
project(':grpc-census'),
2222
project(':grpc-core'),
@@ -113,13 +113,21 @@ task grpclb_long_lived_affinity_test_client(type: CreateStartScripts) {
113113
}
114114

115115
task xds_test_client(type: CreateStartScripts) {
116+
// Use task dependsOn instead of depending on project(':grpc-xds') in configurations because
117+
// grpc-xds is not published yet and we don't want grpc-interop-testin to depend on it in maven.
118+
dependsOn ':grpc-xds:shadowJar'
119+
// Add all other dependencies that grpc-xds needs.
120+
dependencies { compile project(':grpc-services'), libraries.netty_epoll }
116121
mainClassName = "io.grpc.testing.integration.XdsTestClient"
117122
applicationName = "xds-test-client"
118-
dependencies {
119-
runtime project(path: ':grpc-xds', configuration: 'shadow')
120-
}
121123
outputDir = new File(project.buildDir, 'tmp')
122-
classpath = startScripts.classpath
124+
classpath = startScripts.classpath + fileTree("${project(':grpc-xds').buildDir}/libs")
125+
doLast {
126+
unixScript.text = unixScript.text.replace(
127+
'\$APP_HOME/lib/grpc-xds', "${project(':grpc-xds').buildDir}/libs/grpc-xds")
128+
windowsScript.text = windowsScript.text.replace(
129+
'%APP_HOME%\\lib\\grpc-xds', "${project(':grpc-xds').buildDir}\\libs\\grpc-xds")
130+
}
123131
}
124132

125133
task xds_test_server(type: CreateStartScripts) {

interop-testing/src/test/java/io/grpc/ChannelAndServerBuilderTest.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,7 @@ public static Collection<Object[]> params() throws Exception {
5959
}
6060
List<Object[]> classes = new ArrayList<>();
6161
for (ClassInfo classInfo : classInfos) {
62-
String className = classInfo.getName();
63-
if (className.contains("io.grpc.netty.shaded.io.netty")) {
64-
continue;
65-
}
66-
Class<?> clazz = Class.forName(className, false /*initialize*/, loader);
62+
Class<?> clazz = Class.forName(classInfo.getName(), false /*initialize*/, loader);
6763
if (ServerBuilder.class.isAssignableFrom(clazz) && clazz != ServerBuilder.class) {
6864
classes.add(new Object[]{clazz});
6965
} else if (ManagedChannelBuilder.class.isAssignableFrom(clazz)

xds/build.gradle

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ dependencies {
2424
project(':grpc-core'),
2525
project(':grpc-netty'),
2626
project(':grpc-services'),
27-
project(path: ':grpc-alts', configuration: 'shadow')
27+
project(':grpc-alts'),
28+
libraries.netty_epoll
2829

2930
compile (libraries.pgv) {
3031
// PGV depends on com.google.protobuf:protobuf-java 3.6.1 conflicting with :grpc-protobuf
@@ -38,16 +39,11 @@ dependencies {
3839

3940
testCompile project(':grpc-core').sourceSets.test.output
4041

41-
compileOnly libraries.javax_annotation,
42-
// At runtime use the epoll included in grpc-netty-shaded
43-
libraries.netty_epoll
42+
compileOnly libraries.javax_annotation
4443

4544
testCompile project(':grpc-testing'),
4645
project(':grpc-testing-proto'),
47-
libraries.guava_testlib,
48-
libraries.netty_epoll
49-
50-
shadow project(path: ':grpc-netty-shaded', configuration: 'shadow')
46+
libraries.guava_testlib
5147
signature "org.codehaus.mojo.signature:java17:1.0@signature"
5248
testRuntime libraries.netty_tcnative
5349
}

0 commit comments

Comments
 (0)