terrymanu opened a new issue, #16383:
URL: https://github.com/apache/shardingsphere/issues/16383

   The current SQL parser test case for unsupported SQL is 
`org.apache.shardingsphere.test.sql.parser.parameterized.engine.UnsupportedSQLParserParameterizedTest`.
 
   The test data is in `src/main/resources/sql/unsupported/unsupported.xml` 
which composed by static and dynamic.
   
   
![image](https://user-images.githubusercontent.com/5516298/160160614-edbc3aa8-09dc-4b5a-9872-855453694013.png)
   
   We need to keep the static test cases in 
`UnsupportedSQLParserParameterizedTest` and create a new class, which name 
maybe `DynamicLoadingSQLParserParameterizedTest`.
   
   The class should load SQL cases from official test cases from MySQL[1] and 
PostgreSQL[2]. 
   The step of `DynamicLoadingSQLParserParameterizedTest`:
   
   1. Load official test cases from GitHub
   2. Generate to arrays by parameterized test
   3. Run `SQLParserEngine.parse()` try to parse SQL
   4. Assert result as `SQLStatement`
   5. Catch `SQLParserException` for unsupported SQL
   6. Catch `CastException` for parse error
   7. Record and print exception number, the final objective is zero exception, 
please do not assert fail if exception number is not zero, just let the test 
cases can be done.
   8. Please define the test case as IT, it is better to run it in GitHub 
Action only, the normal `mvn install` should not depend on network environment.
   
   [1] https://github.com/mysql/mysql-server/tree/8.0/mysql-test/t
   [2] https://github.com/postgres/postgres/tree/master/src/test/regress/sql


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