Skip to content
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

Feature add tcc branch report #186

Closed
wants to merge 3 commits into from

Conversation

wang1309
Copy link
Contributor

@wang1309 wang1309 commented Aug 4, 2022

<!--  Thanks for sending a pull request! 

-->

What this PR does:
1:添加 tcc branchReport 调用
2:添加 branchReport 单元测试

Which issue(s) this PR fixes:
1: 规范 error 命名
2: 修复 const 枚举错误

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


applicationData)

assert.Nil(t, err)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change


assert.Nil(t, err)

log.Infof("err: %+v", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log.Infof("err: %+v", err)

@@ -34,3 +37,19 @@ func TestActionContext(t *testing.T) {
assert.Nil(t, err)
assert.Equal(t, `{"zhangsan":"lisi"}`, string(bytes))
}

func TestBranchReport(t *testing.T) {
rmInstance := GetTCCResourceManagerInstance()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
rmInstance := GetTCCResourceManagerInstance()

func TestBranchReport(t *testing.T) {
rmInstance := GetTCCResourceManagerInstance()
applicationData := `{"actionContext":{"zhangsan":"lisi"}}`
err := rmInstance.BranchReport(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
err := rmInstance.BranchReport(
err := GetTCCResourceManagerInstance().BranchReport(context.Background(), branch.BranchTypeTCC, "1111111111",


func TestBranchReport(t *testing.T) {
rmInstance := GetTCCResourceManagerInstance()
applicationData := `{"actionContext":{"zhangsan":"lisi"}}`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
applicationData := `{"actionContext":{"zhangsan":"lisi"}}`

branch.BranchTypeTCC,
"1111111111",
2645276141,
branch.BranchStatusPhaseoneDone,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
branch.BranchStatusPhaseoneDone,

context.Background(),
branch.BranchTypeTCC,
"1111111111",
2645276141,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
2645276141,
2645276141, branch.BranchStatusPhaseoneDone, `{"actionContext":{"zhangsan":"lisi"}}`)

err := rmInstance.BranchReport(
context.Background(),
branch.BranchTypeTCC,
"1111111111",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"1111111111",

applicationData := `{"actionContext":{"zhangsan":"lisi"}}`
err := rmInstance.BranchReport(
context.Background(),
branch.BranchTypeTCC,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
branch.BranchTypeTCC,

rmInstance := GetTCCResourceManagerInstance()
applicationData := `{"actionContext":{"zhangsan":"lisi"}}`
err := rmInstance.BranchReport(
context.Background(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
context.Background(),

"encoding/json"
"github.com/seata/seata-go/pkg/common/log"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

format the imports

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants