kennknowles commented on code in PR #30193:
URL: https://github.com/apache/beam/pull/30193#discussion_r1476252384


##########
sdks/java/harness/build.gradle:
##########
@@ -91,7 +91,7 @@ dependencies {
   testImplementation library.java.junit
   testImplementation library.java.mockito_core
   shadowTestRuntimeClasspath project(path: ":sdks:java:core", configuration: 
"shadowTest")
-  testImplementation project(path: ":sdks:java:fn-execution", configuration: 
"testRuntimeMigration")
+  testImplementation project(path: ":sdks:java:core", configuration: 
"testRuntimeMigration")

Review Comment:
   Removing either one causes errors.
   
   Remove `shadowTestRuntimeClasspath project(path: ":sdks:java:core", 
configuration: "shadowTest")` and the errors are (from a few different tests)
   
   ```
   java.lang.NoClassDefFoundError: 
Lorg/apache/beam/sdk/testing/ResetDateTimeProvider;
   ```
   
   ```
   java.lang.NoClassDefFoundError: 
org/apache/beam/sdk/fn/stream/PrefetchableIteratorsTest$ReadyAfterPrefetch
   ```
   
   ```
   java.lang.NoClassDefFoundError: Lorg/apache/beam/sdk/testing/ExpectedLogs;
   ```
   
   I think this is caused by us putting actual logic code in the 
`src/main/test` directory so it is in the `-tests` jar. That is essentially 
always wrong to do. That jar should never be used for shared code between 
modules/dependencies. There have been some tickets filed about it. (the only OK 
use of tests jar for sharing is if you want to run someone's tests, like how we 
do validates runner, otherwise it is not OK).
   
   And if we remove `testImplementation project(path: ":sdks:java:core", 
configuration: "testRuntimeMigration")` it doesn't compile, since 
`shadowTestRuntimeClasspath` doesn't put it on the compilation classpath.
   
   Using just `shadowTest` seems to work. Pushing that delta and hopefully 
everything else is still happy.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to