dinky icon indicating copy to clipboard operation
dinky copied to clipboard

[Optimization-1646][metadata] Optimize units test add assertion

Open mymmyy opened this issue 2 years ago • 3 comments

Purpose of the pull request

Optimize units test add assertion #1646

Brief change log

  • dinky-metadata units test add assertion

Verify this pull request

This change added tests and can be verified as follows:

  • Added dinky-metadata tests assertion.

mymmyy avatar Feb 16 '23 08:02 mymmyy

How do you think it is more appropriate to assert?

aiwenmo avatar Feb 20 '23 15:02 aiwenmo

How do you think it is more appropriate to assert?

Now it seems that the submitted test class with assertion should not be necessary to add assertion, because the test class of dinky-metadata is to test the validity of the connected code of various external data sources. the test class of dinky-core is to test the validity of the FlinkRest code. It is only convenient for developers in the development phase and not helpful when compiling and packaging. The addition of Assertion in the case of logging only enriches the means of checking the test results, and does not have a very obvious optimization to improve code performance.

I don't think it is very necessary to add assert to these test classes. Maybe I didn't consider a more suitable assert method, can you give some suggestions?

mymmyy avatar Feb 21 '23 08:02 mymmyy

Sorry. At present, I can't think of how to do it. Maybe you can refer to other open source projects. thx

aiwenmo avatar Feb 21 '23 14:02 aiwenmo

the connection to other services is guaranteed according to the library unit tests, we only need to make sure invoke behavior is all right, so could mock the connection function result.

leechor avatar Feb 28 '23 05:02 leechor

the connection to other services is guaranteed according to the library unit tests, we only need to make sure invoke behavior is all right, so could mock the connection function result.

Can you give an example?

aiwenmo avatar Feb 28 '23 10:02 aiwenmo

the connection to other services is guaranteed according to the library unit tests, we only need to make sure invoke behavior is all right, so could mock the connection function result.

Can you give an example?

#1701

leechor avatar Mar 03 '23 12:03 leechor

  • [X] #1701

aiwenmo avatar Mar 04 '23 13:03 aiwenmo