incubator-seata icon indicating copy to clipboard operation
incubator-seata copied to clipboard

test: added unit tests for NacosRegistryServiceImple

Open mehedikhan72 opened this issue 10 months ago • 4 comments

Unit tests added for NacosRegistryServiceImplementation

mehedikhan72 avatar Mar 16 '25 21:03 mehedikhan72

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 54.22%. Comparing base (757bf45) to head (6a7e9d7). :warning: Report is 145 commits behind head on 2.x.

Additional details and impacted files
@@             Coverage Diff              @@
##                2.x    #7225      +/-   ##
============================================
+ Coverage     54.17%   54.22%   +0.04%     
- Complexity     7222     7260      +38     
============================================
  Files          1173     1176       +3     
  Lines         41796    41927     +131     
  Branches       4906     4918      +12     
============================================
+ Hits          22642    22733      +91     
- Misses        17013    17042      +29     
- Partials       2141     2152      +11     

see 7 files with indirect coverage changes

Impacted file tree graph

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Mar 17 '25 11:03 codecov[bot]

Hi @slievrly . Can you take a look? Since these are mock tests, how else would we improve these? The actual functionalities are tightly coupled(Depends on the discovery services) which makes me think these are not good cases for mock tests, since we are mocking the core functionalities.

Please let me know if I'm missing any key points, thanks.

mehedikhan72 avatar Mar 22 '25 20:03 mehedikhan72

Hi @slievrly . Can you take a look? Since these are mock tests, how else would we improve these? The actual functionalities are tightly coupled(Depends on the discovery services) which makes me think these are not good cases for mock tests, since we are mocking the core functionalities.

Please let me know if I'm missing any key points, thanks.

Some third-party configuration registries themselves provide mock server capabilities. If they don't, then we'll consider launching a registry container in the github action pipeline to do real testing. If that's not possible, we'll consider mock test to simulate the registry's behavior to see if Seata behaves as expected.

slievrly avatar Mar 24 '25 03:03 slievrly

https://github.com/apache/incubator-seata/blob/2.x/.github/workflows/build.yml#L38 I don't think mocking is necessary because the Nacos container is already running in the CI environment on Linux. Therefore, we can directly perform the related tests, as long as we add a condition to run only in the Linux environment

funky-eyes avatar Mar 24 '25 05:03 funky-eyes

Long time no progress, close it.

slievrly avatar Oct 17 '25 06:10 slievrly