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



##########
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.*");
+
+        @Override
+        public boolean includes(Location location) {
+            return !location.matches(TEST);
+        }
+    }
+
+    /**
+     * Include test relevant classes.
+     *
+     * <p>Note: since the test should be work both when maven and Intellij. 
The pattern will be
+     * improved to be more precise continuously.
+     */
+    static class OnlyTestJarsImportOption implements ImportOption {

Review comment:
       Can we just use the inverse of the import option above?
   
   This pattern is a bit "dangerous", because it would easily find anything 
that contains "test" anywhere in the entire location, even as part of another 
word.




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