You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@streampark.apache.org by "RocMarshal (via GitHub)" <gi...@apache.org> on 2023/02/04 05:00:39 UTC

[GitHub] [incubator-streampark] RocMarshal commented on issue #2014: [Improve] Enhance the tests of 'streampark-console' module.

RocMarshal commented on issue #2014:
URL: https://github.com/apache/incubator-streampark/issues/2014#issuecomment-1416662513

   I encountered two case have to solve to support the integration test enhancement.
   
   1. Error is reported when initializing app.home resources in the run `EnvInitializer#storageInitialize`.
   The main error is that the file does not exist and the target directory is empty when initializing the copy of `lib, plugins, client and other directories`.
   
   There are two solutions from me:
   
   1). copy the mock manually folders and files in the `resources` directory to the path set by `app.home` before the EnvInitializer class executes the` run` method
   
   2).  set a `System properties` to mark whether `EnvInitializer#run`  really need to  execute the logic of the method body
   
   Other try:  to use `mockito` to spy the `EnvInitializer#run`, but the idea  is not feasible due to the feature of ApplicationRunner.
   
   In the long item, if automated testing is carried out in as wide a range as possible, the files in `app.home` must not be implemented with mocks, but need a real `app.home` and its' resource, which is same as the production Env.
   
   In the short term, I prefer to mock, and support the rapid improvement of the test part.
   
   2. When integrating `test-containers`, it is intended to reuse the mysql sql file (but the current mysql sql file is not under `resources`, so it cannot be reused).
   
   Can the `sql scripts file` of `mysql&postgresql` be placed in the `resources folder`,  then we could change the  descriptions content of  `assembly` to reach the same packaging-effect with original implementation ?
   
   Looking forward to your suggestions. 
   CC @wolfboys @MonsterChenzhuo @1996fanrui 


-- 
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: issues-unsubscribe@streampark.apache.org

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