You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/11/04 13:50:34 UTC

[GitHub] [shardingsphere] Jacob953 opened a new pull request, #21966: Dynamic load SQL parser test cases from MySQL and PostgreSQL

Jacob953 opened a new pull request, #21966:
URL: https://github.com/apache/shardingsphere/pull/21966

   Fixes #16383.
   
   Changes proposed in this pull request:
     - Accessing files using jsonpath
     - Remove duplicate test cases that can be automatically overwritten
   
   ---
   
   Before committing this PR, I'm sure that I have checked the following options:
   - [x] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
   - [x] I have self-reviewed the commit code.
   - [x] I have (or in comment I request) added corresponding labels for the pull request.
   - [x] I have passed maven check locally : `mvn clean install -B -T2C -DskipTests -Dmaven.javadoc.skip=true -e`.
   - [ ] I have made corresponding changes to the documentation.
   - [ ] I have added corresponding unit tests for my changes.
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] terrymanu merged pull request #21966: Dynamic load SQL parser test cases from MySQL and PostgreSQL

Posted by GitBox <gi...@apache.org>.
terrymanu merged PR #21966:
URL: https://github.com/apache/shardingsphere/pull/21966


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] Jacob953 commented on a diff in pull request #21966: Dynamic load SQL parser test cases from MySQL and PostgreSQL

Posted by GitBox <gi...@apache.org>.
Jacob953 commented on code in PR #21966:
URL: https://github.com/apache/shardingsphere/pull/21966#discussion_r1014146582


##########
pom.xml:
##########
@@ -726,6 +727,12 @@
                 <artifactId>caffeine</artifactId>
                 <version>${caffeine.version}</version>
             </dependency>
+            
+            <dependency>
+                <groupId>com.jayway.jsonpath</groupId>
+                <artifactId>json-path</artifactId>
+                <version>${json-path.version}</version>

Review Comment:
   fixed



-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] terrymanu commented on a diff in pull request #21966: Dynamic load SQL parser test cases from MySQL and PostgreSQL

Posted by GitBox <gi...@apache.org>.
terrymanu commented on code in PR #21966:
URL: https://github.com/apache/shardingsphere/pull/21966#discussion_r1014089380


##########
test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/engine/DynamicLoadingSQLParserParameterizedTest.java:
##########
@@ -61,16 +64,11 @@ private static Collection<Map<String, String>> getResponse(final String sqlCaseU
         String casesRepo = patches[4];
         String casesDirectory = patches[7];
         String casesGitHubApiURL = "https://api.github.com/repos/" + casesOwner + "/" + casesRepo + "/contents/" + casesDirectory;
-        String[] lines = getContent(casesGitHubApiURL).split("\\,");
-        String nameItem = null;
-        for (String each : lines) {
-            if (each.contains("name")) {
-                nameItem = each.split("\"")[3];
-            } else if (each.contains("download_url")) {
-                String downloadURLItem = each.split("\"")[3];
-                result.add(ImmutableMap.of("name", nameItem, "download_url", downloadURLItem));
-            }
-        }
+        String casesGitHubApoContent = getContent(casesGitHubApiURL);

Review Comment:
   what's mean of `apo` ?



-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] Jacob953 commented on a diff in pull request #21966: Dynamic load SQL parser test cases from MySQL and PostgreSQL

Posted by GitBox <gi...@apache.org>.
Jacob953 commented on code in PR #21966:
URL: https://github.com/apache/shardingsphere/pull/21966#discussion_r1014147225


##########
test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/engine/DynamicLoadingSQLParserParameterizedTest.java:
##########
@@ -61,16 +64,11 @@ private static Collection<Map<String, String>> getResponse(final String sqlCaseU
         String casesRepo = patches[4];
         String casesDirectory = patches[7];
         String casesGitHubApiURL = "https://api.github.com/repos/" + casesOwner + "/" + casesRepo + "/contents/" + casesDirectory;
-        String[] lines = getContent(casesGitHubApiURL).split("\\,");
-        String nameItem = null;
-        for (String each : lines) {
-            if (each.contains("name")) {
-                nameItem = each.split("\"")[3];
-            } else if (each.contains("download_url")) {
-                String downloadURLItem = each.split("\"")[3];
-                result.add(ImmutableMap.of("name", nameItem, "download_url", downloadURLItem));
-            }
-        }
+        String casesGitHubApoContent = getContent(casesGitHubApiURL);

Review Comment:
   fixed



-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] Jacob953 commented on a diff in pull request #21966: Dynamic load SQL parser test cases from MySQL and PostgreSQL

Posted by GitBox <gi...@apache.org>.
Jacob953 commented on code in PR #21966:
URL: https://github.com/apache/shardingsphere/pull/21966#discussion_r1014098409


##########
test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/engine/DynamicLoadingSQLParserParameterizedTest.java:
##########
@@ -61,16 +64,11 @@ private static Collection<Map<String, String>> getResponse(final String sqlCaseU
         String casesRepo = patches[4];
         String casesDirectory = patches[7];
         String casesGitHubApiURL = "https://api.github.com/repos/" + casesOwner + "/" + casesRepo + "/contents/" + casesDirectory;
-        String[] lines = getContent(casesGitHubApiURL).split("\\,");
-        String nameItem = null;
-        for (String each : lines) {
-            if (each.contains("name")) {
-                nameItem = each.split("\"")[3];
-            } else if (each.contains("download_url")) {
-                String downloadURLItem = each.split("\"")[3];
-                result.add(ImmutableMap.of("name", nameItem, "download_url", downloadURLItem));
-            }
-        }
+        String casesGitHubApoContent = getContent(casesGitHubApiURL);

Review Comment:
   Sorry about that. It should be `Api`.



-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] terrymanu commented on a diff in pull request #21966: Dynamic load SQL parser test cases from MySQL and PostgreSQL

Posted by GitBox <gi...@apache.org>.
terrymanu commented on code in PR #21966:
URL: https://github.com/apache/shardingsphere/pull/21966#discussion_r1014108140


##########
pom.xml:
##########
@@ -726,6 +727,12 @@
                 <artifactId>caffeine</artifactId>
                 <version>${caffeine.version}</version>
             </dependency>
+            
+            <dependency>
+                <groupId>com.jayway.jsonpath</groupId>
+                <artifactId>json-path</artifactId>
+                <version>${json-path.version}</version>

Review Comment:
   Please add test scope



-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org