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

add rm test

Open kaori-seasons opened this issue 3 years ago β€’ 5 comments

What this PR does: Related to issue-135 add tests for resourcemanager

Which issue(s) this PR fixes:

add test: tcc_service_test.go rm_remoting_test.go

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


kaori-seasons avatar Aug 05 '22 14:08 kaori-seasons

Hi guy, @complone why the fields of TwoPhaseAction need to export?

106umao avatar Aug 05 '22 15:08 106umao

Hi guy, @complone why the fields of TwoPhaseAction need to export?

In the mock data stage of tcc_service_test, I need to expose fields for assignment.

and the test is still being added, I will fix the ci in a week

kaori-seasons avatar Aug 05 '22 15:08 kaori-seasons

and the test is still being added, I will fix the ci in a week

You can use reflection to get values, preferably without modifying field visibility for unit tests

106umao avatar Aug 05 '22 15:08 106umao

CI is failed

luky116 avatar Aug 05 '22 15:08 luky116

CI is failed

As mentioned, will be fixed it within a week

kaori-seasons avatar Aug 05 '22 15:08 kaori-seasons

The reason why Ci hangs up at present is because the test of the global transaction involves the network IO of getty communication and is investigating how to mock the listener server

kaori-seasons avatar Aug 13 '22 12:08 kaori-seasons

RoBot detected the issue body's language is not English, translate it automatically. πŸ‘―πŸ‘­πŸ»πŸ§‘β€πŸ€β€πŸ§‘πŸ‘«πŸ§‘πŸΏβ€πŸ€β€πŸ§‘πŸ»πŸ‘©πŸΎβ€πŸ€β€πŸ‘¨πŸΏπŸ‘¬πŸΏ


At present, because the test of the global transaction involves the network IO of getty communication, how to mock the listener server is being investigated.

Issues-translate-bot avatar Aug 13 '22 12:08 Issues-translate-bot

Codecov Report

Merging #192 (9054b4e) into master (0cb9e30) will increase coverage by 1.10%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #192      +/-   ##
==========================================
+ Coverage   47.57%   48.68%   +1.10%     
==========================================
  Files          56       56              
  Lines        2806     2806              
==========================================
+ Hits         1335     1366      +31     
+ Misses       1407     1375      -32     
- Partials       64       65       +1     
Impacted Files Coverage Ξ”
pkg/rm/two_phase.go 69.86% <100.00%> (+2.28%) :arrow_up:
pkg/rm/tcc/tcc_service.go 71.25% <0.00%> (+5.62%) :arrow_up:
pkg/rm/rm_remoting.go 7.14% <0.00%> (+7.14%) :arrow_up:
pkg/rm/rm_cache.go 84.61% <0.00%> (+84.61%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov-commenter avatar Aug 16 '22 00:08 codecov-commenter