xiedeyantu commented on code in PR #4641:
URL: https://github.com/apache/calcite/pull/4641#discussion_r2539870465


##########
core/src/test/java/org/apache/calcite/test/RelNodeVisitCoverageTest.java:
##########
@@ -0,0 +1,75 @@
+package org.apache.calcite.test;
+
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import io.github.classgraph.ClassGraph;
+import io.github.classgraph.ClassInfo;
+import io.github.classgraph.ScanResult;
+
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.RelShuttle;
+
+import org.junit.jupiter.api.Test;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.stream.Collectors;
+
+/**
+ * Discovers every concrete {@link RelNode} implementation on the classpath and
+ * verifies {@link RelShuttle} declares a compatible {@code visit} method.
+ */
+class RelNodeVisitCoverageTest {
+
+  @Test void relShuttleCoversAllRelNodes() {

Review Comment:
   This is a work in progress. The current logic can obtain the set of all 
classes that inherit from RelNode, as well as the set of all classes visited in 
RelShuttle. The current test only compares whether these two sets are equal. We 
might also need a criterion to determine which classes should be included in 
the visit and which classes should be excluded.



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