JingGe commented on a change in pull request #18333:
URL: https://github.com/apache/flink/pull/18333#discussion_r783963067



##########
File path: 
flink-architecture-tests/src/test/java/org/apache/flink/architecture/ArchitectureTest.java
##########
@@ -78,4 +79,36 @@ public boolean includes(Location location) {
             return !location.matches(SHADED);
         }
     }
+
+    /**
+     * Exclude locations that contains test classes.
+     *
+     * <p>Note: classes e.g. within jars under flink-test-utils-parent pom 
module are located as
+     * production code and should be excluded as test classes. Please see 
{@link
+     * ImportOption.Predefined#DO_NOT_INCLUDE_TESTS}
+     */
+    static class ExcludeTestJarsImportOption implements ImportOption {
+        private static final Pattern TEST = 
Pattern.compile(".*-test.*\\.jar.*");

Review comment:
       This is the weird and hard part and took me long time to figure it out. 
Maven provided two 
options(https://maven.apache.org/plugins/maven-jar-plugin/examples/create-test-jar.html)
 to develop and build test classes. It is recommended to use only one of them.  
Flink used, unfortunately, both of them mixed. There are test classes 
considered as production code, if only use ".*-test\\.jar.*", e.g. 
flink-test-utils




-- 
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