-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Improvement][Test] Remove dependency of powermock #11405
Comments
Thank you for your feedback, we have received your issue, Please wait patiently for a reply.
|
FYI here is a list of UT files which uses Found Occurrences in Directory dolphinscheduler with mask '*.java' (192 usages found)
Unclassified (192 usages found)
dolphinscheduler-alert-server (1 usage found)
org.apache.dolphinscheduler.alert (1 usage found)
AlertServerTest.java (1 usage found)
dolphinscheduler-api (27 usages found)
org.apache.dolphinscheduler.api.controller (5 usages found)
DataAnalysisControllerTest.java (1 usage found)
ProcessInstanceControllerTest.java (1 usage found)
ProcessTaskRelationControllerTest.java (1 usage found)
ResourcesControllerTest.java (1 usage found)
WorkerGroupControllerTest.java (1 usage found)
org.apache.dolphinscheduler.api.interceptor (2 usages found)
RateLimitInterceptorTest.java (2 usages found)
org.apache.dolphinscheduler.api.service (20 usages found)
BaseServiceTest.java (3 usages found)
DataAnalysisServiceTest.java (2 usages found)
DataSourceServiceTest.java (4 usages found)
LoggerServiceTest.java (1 usage found)
ResourcesServiceTest.java (4 usages found)
SchedulerServiceTest.java (2 usages found)
TenantServiceTest.java (1 usage found)
UdfFuncServiceTest.java (3 usages found)
dolphinscheduler-common (10 usages found)
org.apache.dolphinscheduler.common.utils (10 usages found)
CommonUtilsTest.java (2 usages found)
FileUtilsTest.java (3 usages found)
HadoopUtilsTest.java (4 usages found)
NetUtilsTest.java (1 usage found)
dolphinscheduler-datasource-api (9 usages found)
org.apache.dolphinscheduler.plugin.datasource.api.client (4 usages found)
CommonDataSourceClientTest.java (4 usages found)
org.apache.dolphinscheduler.plugin.datasource.api.utils (5 usages found)
CommonUtilsTest.java (5 usages found)
dolphinscheduler-datasource-clickhouse (4 usages found)
org.apache.dolphinscheduler.plugin.datasource.clickhouse (4 usages found)
ClickHouseDataSourceChannelTest.java (4 usages found)
dolphinscheduler-datasource-db2 (7 usages found)
org.apache.dolphinscheduler.plugin.datasource.db2 (4 usages found)
DB2DataSourceChannelTest.java (4 usages found)
org.apache.dolphinscheduler.plugin.datasource.db2.param (3 usages found)
Db2DataSourceProcessorTest.java (3 usages found)
dolphinscheduler-datasource-hive (7 usages found)
org.apache.dolphinscheduler.plugin.datasource.hive (4 usages found)
HiveDataSourceChannelTest.java (4 usages found)
org.apache.dolphinscheduler.plugin.datasource.hive.param (3 usages found)
HiveDataSourceProcessorTest.java (3 usages found)
dolphinscheduler-datasource-mysql (14 usages found)
org.apache.dolphinscheduler.plugin.datasource.mysql (4 usages found)
MySQLDataSourceChannelTest.java (4 usages found)
org.apache.dolphinscheduler.plugin.datasource.mysql.param (3 usages found)
MySQLDataSourceProcessorTest.java (3 usages found)
org.apache.dolphinscheduler.plugin.datasource.mysql.provider (3 usages found)
JDBCDataSourceProviderTest.java (3 usages found)
org.apache.dolphinscheduler.plugin.datasource.mysql.utils (4 usages found)
DataSourceUtilsTest.java (4 usages found)
dolphinscheduler-datasource-oracle (7 usages found)
org.apache.dolphinscheduler.plugin.datasource.oracle (4 usages found)
OracleDataSourceChannelTest.java (4 usages found)
org.apache.dolphinscheduler.plugin.datasource.oracle.param (3 usages found)
OracleDataSourceProcessorTest.java (3 usages found)
dolphinscheduler-datasource-postgresql (7 usages found)
org.apache.dolphinscheduler.plugin.datasource.postgresql (4 usages found)
PostgreSQLDataSourceChannelTest.java (4 usages found)
org.apache.dolphinscheduler.plugin.datasource.postgresql.param (3 usages found)
PostgreSQLDataSourceProcessorTest.java (3 usages found)
dolphinscheduler-datasource-presto (7 usages found)
org.apache.dolphinscheduler.plugin.datasource.presto (4 usages found)
PrestoDataSourceChannelTest.java (4 usages found)
org.apache.dolphinscheduler.plugin.datasource.presto.param (3 usages found)
PrestoDataSourceProcessorTest.java (3 usages found)
dolphinscheduler-datasource-redshift (3 usages found)
org.apache.dolphinscheduler.plugin.datasource.redshift.param (3 usages found)
RedshiftDataSourceProcessorTest.java (3 usages found)
dolphinscheduler-datasource-spark (7 usages found)
org.apache.dolphinscheduler.plugin.datasource.spark (4 usages found)
SparkDataSourceChannelTest.java (4 usages found)
org.apache.dolphinscheduler.plugin.datasource.spark.param (3 usages found)
SparkDataSourceProcessorTest.java (3 usages found)
dolphinscheduler-datasource-sqlserver (7 usages found)
org.apache.dolphinscheduler.plugin.datasource.sqlserver (4 usages found)
SQLServerDataSourceChannelTest.java (4 usages found)
org.apache.dolphinscheduler.plugin.datasource.sqlserver.param (3 usages found)
SQLServerDataSourceProcessorTest.java (3 usages found)
dolphinscheduler-log-server (3 usages found)
org.apache.dolphinscheduler.server.log (3 usages found)
LoggerRequestProcessorTest.java (3 usages found)
dolphinscheduler-master (18 usages found)
org.apache.dolphinscheduler.server.master (3 usages found)
SubProcessTaskTest.java (3 usages found)
org.apache.dolphinscheduler.server.master.processor (5 usages found)
CacheProcessorTest.java (1 usage found)
TaskAckProcessorTest.java (3 usages found)
TaskKillResponseProcessorTest.java (1 usage found)
org.apache.dolphinscheduler.server.master.registry (3 usages found)
MasterRegistryClientTest.java (3 usages found)
org.apache.dolphinscheduler.server.master.runner (4 usages found)
MasterTaskExecThreadTest.java (1 usage found)
WorkflowExecuteRunnableTest.java (3 usages found)
org.apache.dolphinscheduler.server.master.service (3 usages found)
FailoverServiceTest.java (3 usages found)
dolphinscheduler-server (4 usages found)
org.apache.dolphinscheduler.server.utils (4 usages found)
ProcessUtilsTest.java (4 usages found)
dolphinscheduler-service (8 usages found)
org.apache.dolphinscheduler.service.alert (4 usages found)
AlertClientServiceTest.java (3 usages found)
ProcessAlertManagerTest.java (1 usage found)
org.apache.dolphinscheduler.service.log (3 usages found)
LogClientServiceTest.java (3 usages found)
org.apache.dolphinscheduler.service.process (1 usage found)
ProcessServiceTest.java (1 usage found)
dolphinscheduler-task-dvc (5 usages found)
org.apache.dolphinscheduler.plugin.task.dvc (5 usages found)
DvcTaskTest.java (5 usages found)
dolphinscheduler-task-emr (8 usages found)
org.apache.dolphinscheduler.plugin.task.emr (8 usages found)
EmrAddStepsTaskTest.java (4 usages found)
EmrJobFlowTaskTest.java (4 usages found)
dolphinscheduler-task-jupyter (5 usages found)
org.apache.dolphinscheduler.plugin.task.jupyter (5 usages found)
JupyterTaskTest.java (5 usages found)
dolphinscheduler-task-mlflow (5 usages found)
org.apache.dolphinler.plugin.task.mlflow (5 usages found)
MlflowTaskTest.java (5 usages found)
dolphinscheduler-task-openmldb (1 usage found)
org.apache.dolphinscheduler.plugin.task.openmldb (1 usage found)
OpenmldbTaskTest.java (1 usage found)
dolphinscheduler-task-python (1 usage found)
org.apache.dolphinscheduler.plugin.task.python (1 usage found)
PythonTaskTest.java (1 usage found)
dolphinscheduler-task-sagemaker (5 usages found)
org.apache.dolphinscheduler.plugin.task.sagemaker (5 usages found)
SagemakerTaskTest.java (5 usages found)
dolphinscheduler-task-spark (4 usages found)
org.apache.dolphinscheduler.plugin.task.spark (4 usages found)
SparkTaskTest.java (4 usages found)
dolphinscheduler-task-zeppelin (4 usages found)
org.apache.dolphinscheduler.plugin.task.zeppelin (4 usages found)
ZeppelinTaskTest.java (4 usages found)
dolphinscheduler-worker (4 usages found)
org.apache.dolphinscheduler.server.worker.processor (3 usages found)
TaskDispatchProcessorTest.java (3 usages found)
org.apache.dolphinscheduler.server.worker.runner (1 usage found)
TaskExecuteThreadTest.java (1 usage found)
|
I will try to finish all the sub-tasks in Sept. and Oct. However, anyone interested and willing to help are very welcome to pick those sub-tasks. To help with this issue, just create a new issue for the sub-task you want to pick and comment with the issue link below. |
Are you fixing the dolphinscheduler-common module @EricGao888 |
Yes, I will take care of the rest ones. |
Search before asking
Description
Powermock
does not and will not supportjUnit 5
. We need to remove the dependency onPowermock
.Mockito
to mockstatic
method, see: https://wttech.blog/blog/2020/mocking-static-methods-made-possible-in-mockito-3.4.0/Spotless
to block the usage ofPowermock
. [Improvement][Test] Block the usage ofPowermock
#11637Sub-Tasks
I have split the task into six sub-tasks by workload:
Powermock
indolphinscheduler-api
[Improvement][Test] Remove Powermock in dolphinscheduler-api #12144Powermock
indolphinscheduler-datasource-plugin
[Improvement][Test] Remove powermock in datasource-plugin module #12179Powermock
indolphinscheduler-master
[Improvement][Test] RemovePowermock
indolphinscheduler-master
#12124Powermock
indolphinscheduler-common
,dolphinscheduler-alert
,dolphinscheduler-log-server
,dolphinscheduler-spi
,dolphinscheduler-worker
[Improvement][Test] Remove powermock in common, alert, worker, etc. modules #12208Powermock
indolphinscheduler-service
,dolphinscheduler-server
[Improvement][Test] Remove Powermock in dolphinscheduler-service and dolphinscheduler-server #12155Powermock
indolphinscheduler-task-plugin
[Improvement][Test] Remove Powermock in dolphinscheduler-task-plugin #12150Examples
Currently we have several typical scenarios where we heavily rely on
Powermock
Static Initialization Error
... (to be continued)
I will give some examples and corresponding solutions for these scenarios respectively as follows:
mockito-inline
and useMockito.mockStatic
as an alternative.Mockito.mockStatic
will causeStatic Initialization Error
. For these special cases, we need to refactor the origin class with some tricks to decouple the usage of static method.private
method toprotected
For examples, see: #11588
Are you willing to submit a PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: