You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "xiedeyantu (via GitHub)" <gi...@apache.org> on 2025/04/16 10:59:47 UTC
[PR] [CALCITE-6957] The RelOptRulesTest tests should fail if the xml file contains tests that do not exist in Java [calcite]
xiedeyantu opened a new pull request, #4312:
URL: https://github.com/apache/calcite/pull/4312
(no comment)
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-6957] The RelOptRulesTest tests should fail if the xml file contains tests that do not exist in Java [calcite]
Posted by "NobiGo (via GitHub)" <gi...@apache.org>.
NobiGo commented on PR #4312:
URL: https://github.com/apache/calcite/pull/4312#issuecomment-2815884004
@asolimando @xiedeyantu @mihaibudiu Based on my idea and this PR, I have resubmitted a new PR. Please review it again.
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-6957] The RelOptRulesTest tests should fail if the xml file contains tests that do not exist in Java [calcite]
Posted by "asolimando (via GitHub)" <gi...@apache.org>.
asolimando commented on PR #4312:
URL: https://github.com/apache/calcite/pull/4312#issuecomment-2813260972
> @NobiGo I refactored the code, please see if this is acceptable?
@xiedeyantu checkstyle is failing, can you check locally and fix the problems?
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-6957] The RelOptRulesTest tests should fail if the xml file contains tests that do not exist in Java [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on code in PR #4312:
URL: https://github.com/apache/calcite/pull/4312#discussion_r2046953846
##########
core/src/test/resources/org/apache/calcite/test/RelOptRulesTest.xml:
##########
@@ -586,62 +586,6 @@ LogicalAggregate(group=[{7, 10}])
LogicalJoin(condition=[=($7, $9)], joinType=[left])
LogicalTableScan(table=[[CATALOG, SALES, EMP]])
LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
-]]>
Review Comment:
Yes, I actually overlooked this problem. @NobiGo spotted it when reviewing my code, so I tried to fix it.
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-6957] The RelOptRulesTest tests should fail if the xml file contains tests that do not exist in Java [calcite]
Posted by "NobiGo (via GitHub)" <gi...@apache.org>.
NobiGo commented on PR #4312:
URL: https://github.com/apache/calcite/pull/4312#issuecomment-2811583894
> > Have you reviewed the DiffRepository test method? Can we improve this method? Currently, any new files that need testing must be added manually.
>
> I reviewed this and noticed that it also requires explicit class name, such as:
>
> ```
> @Override RelOptFixture fixture() {
> RelOptFixture fixture = super.fixture()
> .withDiffRepos(DiffRepository.lookup(RelOptRulesTest.class));
> diffRepos = fixture.diffRepos();
> return fixture;
> }
> ```
>
> Additionally, I have a concern. Currently, all XML files are located under `core/src/test/resources/org/apache/calcite/test/`, alongside `.csv` files. Would it be appropriate for me to scan all XML files under this path programmatically, or should we keep explicitly specifying the files?
Yes. This is the way the test cases are used. When developers apply this for verification, I hope that the corresponding verification procedures have already been included in it.
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-6957] The RelOptRulesTest tests should fail if the xml file contains tests that do not exist in Java [calcite]
Posted by "asolimando (via GitHub)" <gi...@apache.org>.
asolimando commented on code in PR #4312:
URL: https://github.com/apache/calcite/pull/4312#discussion_r2046892882
##########
core/src/test/resources/org/apache/calcite/test/RelOptRulesTest.xml:
##########
@@ -586,62 +586,6 @@ LogicalAggregate(group=[{7, 10}])
LogicalJoin(condition=[=($7, $9)], joinType=[left])
LogicalTableScan(table=[[CATALOG, SALES, EMP]])
LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
-]]>
Review Comment:
We can clearly see that such a check was long due
##########
core/src/test/java/org/apache/calcite/test/JavaXmlConsistencyChecker.java:
##########
@@ -0,0 +1,143 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.calcite.test;
+
+import org.junit.jupiter.api.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import java.io.File;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+/**
+ * This class provides utility methods to validate the consistency between
+ * test cases defined in the XML file and the corresponding test methods
+ * implemented in the Java file. It ensures that all test cases in the XML
+ * file have matching test methods in the Java class.
+ */
+public class JavaXmlConsistencyChecker {
+ final String javaFilePrefix = "src/test/java/org/apache/calcite/test/";
+ final String xmlFilePrefix = "src/test/resources/org/apache/calcite/test/";
+
+ private static Set<String> parseTestCaseNamesFromXml(String filePath) throws Exception {
+ Set<String> testCaseNames = new HashSet<>();
+ File xmlFile = new File(filePath);
+
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ Document document = builder.parse(xmlFile);
+
+ NodeList testCaseNodes = document.getElementsByTagName("TestCase");
+ for (int i = 0; i < testCaseNodes.getLength(); i++) {
+ Element testCaseElement = (Element) testCaseNodes.item(i);
+ String name = testCaseElement.getAttribute("name");
+ if (!name.isEmpty()) {
+ testCaseNames.add(name);
+ }
+ }
+ return testCaseNames;
+ }
+
+ private static Set<String> parseMethodNamesFromJava(String filePath) throws Exception {
+ Set<String> methodNames = new HashSet<>();
+ final String content = Files.readAllLines(Paths.get(filePath)).toString();
+
+ Pattern pattern = Pattern.compile("@Test\\s+(?:public\\s+)?void\\s+(\\w+)\\s*\\(");
+ Matcher matcher = pattern.matcher(content);
+
+ while (matcher.find()) {
+ methodNames.add(matcher.group(1));
+ }
+ return methodNames;
+ }
+
+ private static void check(String testName, String xmlFilePath, String javaFilePath)
+ throws Exception {
+ Set<String> testCaseNames = parseTestCaseNamesFromXml(xmlFilePath);
+ Set<String> javaMethodNames = parseMethodNamesFromJava(javaFilePath);
+
+ List<String> missingMethods = new ArrayList<>();
+ for (String testCase : testCaseNames) {
+ if (!javaMethodNames.contains(testCase)) {
+ missingMethods.add(testCase);
+ }
+ }
+
+ if (!missingMethods.isEmpty()) {
Review Comment:
At the moment, if you have a method in Java and no corresponding XML element, what happens?
If it fails, then it's OK to check the way you propose. If not, maybe we should check that the two set of names is identical.
Can you please try and update here?
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-6957] The RelOptRulesTest tests should fail if the xml file contains tests that do not exist in Java [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on PR #4312:
URL: https://github.com/apache/calcite/pull/4312#issuecomment-2810316564
This looks fine, but I don't understand the last comment in the Jira, so I will wait to merge this.
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-6957] The RelOptRulesTest tests should fail if the xml file contains tests that do not exist in Java [calcite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #4312:
URL: https://github.com/apache/calcite/pull/4312#issuecomment-2813329234
## [](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4312) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4312&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4312&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=4312&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4312&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4312&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4312)
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-6957] The RelOptRulesTest tests should fail if the xml file contains tests that do not exist in Java [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on PR #4312:
URL: https://github.com/apache/calcite/pull/4312#issuecomment-2816392751
@NobiGo has a better implement, so I close this PR to support that.
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-6957] The RelOptRulesTest tests should fail if the xml file contains tests that do not exist in Java [calcite]
Posted by "NobiGo (via GitHub)" <gi...@apache.org>.
NobiGo commented on PR #4312:
URL: https://github.com/apache/calcite/pull/4312#issuecomment-2814294670
I will check this PR carefully. It will take some time.
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-6957] The RelOptRulesTest tests should fail if the xml file contains tests that do not exist in Java [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on PR #4312:
URL: https://github.com/apache/calcite/pull/4312#issuecomment-2811477616
> Have you reviewed the DiffRepository test method? Can we improve this method? Currently, any new files that need testing must be added manually.
I reviewed this and noticed that it also requires explicit class name, such as:
```
@Override RelOptFixture fixture() {
RelOptFixture fixture = super.fixture()
.withDiffRepos(DiffRepository.lookup(RelOptRulesTest.class));
diffRepos = fixture.diffRepos();
return fixture;
}
```
Additionally, I have a concern. Currently, all XML files are located under `core/src/test/resources/org/apache/calcite/test/`, alongside `.csv` files. Would it be appropriate for me to scan all XML files under this path programmatically, or should we keep explicitly specifying the files?
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-6957] The RelOptRulesTest tests should fail if the xml file contains tests that do not exist in Java [calcite]
Posted by "asolimando (via GitHub)" <gi...@apache.org>.
asolimando commented on code in PR #4312:
URL: https://github.com/apache/calcite/pull/4312#discussion_r2046952124
##########
core/src/test/java/org/apache/calcite/test/JavaXmlConsistencyChecker.java:
##########
@@ -0,0 +1,143 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.calcite.test;
+
+import org.junit.jupiter.api.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import java.io.File;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+/**
+ * This class provides utility methods to validate the consistency between
+ * test cases defined in the XML file and the corresponding test methods
+ * implemented in the Java file. It ensures that all test cases in the XML
+ * file have matching test methods in the Java class.
+ */
+public class JavaXmlConsistencyChecker {
+ final String javaFilePrefix = "src/test/java/org/apache/calcite/test/";
+ final String xmlFilePrefix = "src/test/resources/org/apache/calcite/test/";
+
+ private static Set<String> parseTestCaseNamesFromXml(String filePath) throws Exception {
+ Set<String> testCaseNames = new HashSet<>();
+ File xmlFile = new File(filePath);
+
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ Document document = builder.parse(xmlFile);
+
+ NodeList testCaseNodes = document.getElementsByTagName("TestCase");
+ for (int i = 0; i < testCaseNodes.getLength(); i++) {
+ Element testCaseElement = (Element) testCaseNodes.item(i);
+ String name = testCaseElement.getAttribute("name");
+ if (!name.isEmpty()) {
+ testCaseNames.add(name);
+ }
+ }
+ return testCaseNames;
+ }
+
+ private static Set<String> parseMethodNamesFromJava(String filePath) throws Exception {
+ Set<String> methodNames = new HashSet<>();
+ final String content = Files.readAllLines(Paths.get(filePath)).toString();
+
+ Pattern pattern = Pattern.compile("@Test\\s+(?:public\\s+)?void\\s+(\\w+)\\s*\\(");
+ Matcher matcher = pattern.matcher(content);
+
+ while (matcher.find()) {
+ methodNames.add(matcher.group(1));
+ }
+ return methodNames;
+ }
+
+ private static void check(String testName, String xmlFilePath, String javaFilePath)
+ throws Exception {
+ Set<String> testCaseNames = parseTestCaseNamesFromXml(xmlFilePath);
+ Set<String> javaMethodNames = parseMethodNamesFromJava(javaFilePath);
+
+ List<String> missingMethods = new ArrayList<>();
+ for (String testCase : testCaseNames) {
+ if (!javaMethodNames.contains(testCase)) {
+ missingMethods.add(testCase);
+ }
+ }
+
+ if (!missingMethods.isEmpty()) {
Review Comment:
OK great, so adding a Java method which is missing the XML counterpart doesn't fail silently, then I am fine with the current proposal, and it's great it applies to all XML-based test suites.
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-6957] The RelOptRulesTest tests should fail if the xml file contains tests that do not exist in Java [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu closed pull request #4312: [CALCITE-6957] The RelOptRulesTest tests should fail if the xml file contains tests that do not exist in Java
URL: https://github.com/apache/calcite/pull/4312
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-6957] The RelOptRulesTest tests should fail if the xml file contains tests that do not exist in Java [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on PR #4312:
URL: https://github.com/apache/calcite/pull/4312#issuecomment-2813278758
> > @NobiGo I refactored the code, please see if this is acceptable?
>
> @xiedeyantu checkstyle is failing, can you check locally and fix the problems?
Fixed, Thanks!
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-6957] The RelOptRulesTest tests should fail if the xml file contains tests that do not exist in Java [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on code in PR #4312:
URL: https://github.com/apache/calcite/pull/4312#discussion_r2046948244
##########
core/src/test/java/org/apache/calcite/test/JavaXmlConsistencyChecker.java:
##########
@@ -0,0 +1,143 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.calcite.test;
+
+import org.junit.jupiter.api.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import java.io.File;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+/**
+ * This class provides utility methods to validate the consistency between
+ * test cases defined in the XML file and the corresponding test methods
+ * implemented in the Java file. It ensures that all test cases in the XML
+ * file have matching test methods in the Java class.
+ */
+public class JavaXmlConsistencyChecker {
+ final String javaFilePrefix = "src/test/java/org/apache/calcite/test/";
+ final String xmlFilePrefix = "src/test/resources/org/apache/calcite/test/";
+
+ private static Set<String> parseTestCaseNamesFromXml(String filePath) throws Exception {
+ Set<String> testCaseNames = new HashSet<>();
+ File xmlFile = new File(filePath);
+
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ Document document = builder.parse(xmlFile);
+
+ NodeList testCaseNodes = document.getElementsByTagName("TestCase");
+ for (int i = 0; i < testCaseNodes.getLength(); i++) {
+ Element testCaseElement = (Element) testCaseNodes.item(i);
+ String name = testCaseElement.getAttribute("name");
+ if (!name.isEmpty()) {
+ testCaseNames.add(name);
+ }
+ }
+ return testCaseNames;
+ }
+
+ private static Set<String> parseMethodNamesFromJava(String filePath) throws Exception {
+ Set<String> methodNames = new HashSet<>();
+ final String content = Files.readAllLines(Paths.get(filePath)).toString();
+
+ Pattern pattern = Pattern.compile("@Test\\s+(?:public\\s+)?void\\s+(\\w+)\\s*\\(");
+ Matcher matcher = pattern.matcher(content);
+
+ while (matcher.find()) {
+ methodNames.add(matcher.group(1));
+ }
+ return methodNames;
+ }
+
+ private static void check(String testName, String xmlFilePath, String javaFilePath)
+ throws Exception {
+ Set<String> testCaseNames = parseTestCaseNamesFromXml(xmlFilePath);
+ Set<String> javaMethodNames = parseMethodNamesFromJava(javaFilePath);
+
+ List<String> missingMethods = new ArrayList<>();
+ for (String testCase : testCaseNames) {
+ if (!javaMethodNames.contains(testCase)) {
+ missingMethods.add(testCase);
+ }
+ }
+
+ if (!missingMethods.isEmpty()) {
Review Comment:
Thanks for your review! The current strategy is that if there is a `testXxx` method in the java file, it will definitely try to compare the result set of `<TestCase name="testXxx">` in the xml. On the contrary, it will not. Therefore, there will be many residual invalid result sets in the xml. When I was solving the problem of RelOptRulesTest.xml, I found that there were many similar xml files, so I handled them together.
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-6957] The RelOptRulesTest tests should fail if the xml file contains tests that do not exist in Java [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on PR #4312:
URL: https://github.com/apache/calcite/pull/4312#issuecomment-2813242345
@NobiGo I refactored the code, please see if this is acceptable?
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-6957] The RelOptRulesTest tests should fail if the xml file contains tests that do not exist in Java [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on PR #4312:
URL: https://github.com/apache/calcite/pull/4312#issuecomment-2814295725
> I will check this PR carefully. It will take some time.
Thanks!
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-6957] The RelOptRulesTest tests should fail if the xml file contains tests that do not exist in Java [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on PR #4312:
URL: https://github.com/apache/calcite/pull/4312#issuecomment-2810791747
> This looks fine, but I don't understand the last comment in the Jira, so I will wait to merge this.
I just want to give an example to explain the problem more specifically. If there is any ambiguity, I can delete it.
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-6957] The RelOptRulesTest tests should fail if the xml file contains tests that do not exist in Java [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on PR #4312:
URL: https://github.com/apache/calcite/pull/4312#issuecomment-2811594695
> > > Have you reviewed the DiffRepository test method? Can we improve this method? Currently, any new files that need testing must be added manually.
> >
> >
> > I reviewed this and noticed that it also requires explicit class name, such as:
> > ```
> > @Override RelOptFixture fixture() {
> > RelOptFixture fixture = super.fixture()
> > .withDiffRepos(DiffRepository.lookup(RelOptRulesTest.class));
> > diffRepos = fixture.diffRepos();
> > return fixture;
> > }
> > ```
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Additionally, I have a concern. Currently, all XML files are located under `core/src/test/resources/org/apache/calcite/test/`, alongside `.csv` files. Would it be appropriate for me to scan all XML files under this path programmatically, or should we keep explicitly specifying the files?
>
> Yes. This is the way the test cases are used. When developers apply this for verification, I hope that the corresponding verification procedures have already been included in it.
I didn't fully understand your description. But I seem to understand what you mean, you want to be smarter. Maybe I still haven't been able to solve my confusion. DiffRepository also requires specified input to tell it what the file is. I don't know which Java files need to be compared with which XML files. All I can think of is to explicitly specify them.
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-6957] The RelOptRulesTest tests should fail if the xml file contains tests that do not exist in Java [calcite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #4312:
URL: https://github.com/apache/calcite/pull/4312#issuecomment-2809266266
## [](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4312) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4312&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4312&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=4312&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4312&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4312&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4312)
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org