HildoYe opened a new pull request #6773:
URL: https://github.com/apache/dolphinscheduler/pull/6773


   <!--Thanks very much for contributing to Apache DolphinScheduler. Please 
review 
https://dolphinscheduler.apache.org/en-us/community/development/pull-request.html
 before opening a pull request.-->
   
   
   ## Purpose of the pull request
   
   The test `PluginParamsTransferTest#testGetParamsJson` is flaky. It tries to 
compare a Json file with a hardcoded string. Parsing Json is not 
order-consistent and it will result flakiness.
   
   While trying to fix the problem, 
`PluginParamsTransfer.transferJsonToParamsList()` in the same file become 
interesting. It is supposed to parse the Json to in to `PluginParams` type, but 
the type is polymorphic, and the function does not deal with its property due 
to the incorrect implementation in `PluginParams`.
   
   This PR sets the parent type `PluginParams` as abstract type, and utilizes 
`PluginParamsTransfer.transferJsonToParamsList()` to check the Json content.
   
   ## Brief change log
   
   - Make `PluginParams` abstract.
   - Adjust the subclass of `PluginParams` according to the abstract property 
of the parent class.
   - Override `equals` method of `ParamsOptions`
   - Use `PluginParamsTransfer.transferJsonToParamsList()` to check Json 
content instead of comparing with a hardcoded string
   - Change the order of 2 tests in `PluginParamsTransferTest` so ideally it 
will first test`PluginParamsTransfer.transferJsonToParamsList()`
   
   ## Verify this pull request
   
   This change modifies one test:
   `PluginParamsTransferTest#testGetParamsJson` 
   - Manually verified the change by testing locally.
   - The flakiness test command is `mvn -pl dolphinscheduler-spi 
edu.illinois:nondex-maven-plugin:1.1.2:nondex 
-Dtest=org.apache.dolphinscheduler.spi.params.PluginParamsTransferTest#testGetParamsJson`
   
   This change is partially covered by existing test:
   `PluginParamsTransferTest#testGetPluginParams` 
   


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