Skip to content

Commit

Permalink
Feature/tc unit test (#104)
Browse files Browse the repository at this point in the history
* add unit test for TC
  • Loading branch information
bohehe authored Mar 1, 2022
1 parent 5ece21f commit f759109
Show file tree
Hide file tree
Showing 13 changed files with 1,296 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: GolangCI Lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.39.0
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.44.2
golangci-lint run ./...
- name: Unit Tests
Expand Down
9 changes: 9 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,12 @@ linters:
- goimports
- gocritic
- revive

linters-settings:
revive:
rules:
- name: exported
severity: warning
disabled: false
arguments:
- "disableStutteringCheck"
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
## Introduction | [中文](https://github.com/opentrx/seata-golang/blob/v2/docs/README_ZH.md)
seata-golang is a distributed transaction middleware based on Golang.
### difference between seata-glang and [seata](https://github.com/seata/seata)
| feature | seata | seata-golang | remark |
| ---- | :----: | :----: | --- |
| AT mode | || |
| TCC mode ||| |
| SAGA mode | | × | |
| rpc || | [dev branch](https://github.com/opentrx/seata-golang/tree/dev) |
| grpc | × || [v2 branch](https://github.com/opentrx/seata-golang/tree/v2) |
| feature | seata | seata-golang | remark |
|-----------|:-----:|:------------:|----------------------------------------------------------------|
| AT mode | || |
| TCC mode ||| |
| SAGA mode | | ☑️ | |
| rpc || | [dev branch](https://github.com/opentrx/seata-golang/tree/dev) |
| grpc | ☑️ || [v2 branch](https://github.com/opentrx/seata-golang/tree/v2) |

## Architecture
<img alt="seata-flow" width="500px" src="https://github.com/opentrx/seata-golang/blob/v2/docs/images/seata-flow.png" />
Expand Down
14 changes: 7 additions & 7 deletions docs/README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
## 简介 | [English](https://github.com/opentrx/seata-golang/blob/v2/README.md)
seata-golang是一个用于解决分布式事务的中间件,是基于Go语言版本的seata。
### seata-golang与[seata](https://github.com/seata/seata) 的区别
| 特性 | seata | seata-golang | 备注 |
| ---- | :----: | :----: | --- |
| AT mode | || |
| TCC mode ||| |
| SAGA mode | | × | |
| rpc || | [dev branch](https://github.com/opentrx/seata-golang/tree/dev) |
| grpc | × || [v2 branch](https://github.com/opentrx/seata-golang/tree/v2) |
| 特性 | seata | seata-golang | 备注 |
|-----------|:-----:|:------------:|----------------------------------------------------------------|
| AT mode | || |
| TCC mode ||| |
| SAGA mode | | ☑️ | |
| rpc || | [dev branch](https://github.com/opentrx/seata-golang/tree/dev) |
| grpc | ☑️ || [v2 branch](https://github.com/opentrx/seata-golang/tree/v2) |

## 架构
<img alt="seata-flow" width="500px" src="https://github.com/opentrx/seata-golang/blob/v2/docs/images/seata-flow.png" />
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require (
github.com/go-sql-driver/mysql v1.5.0
github.com/go-xorm/xorm v0.7.9
github.com/gogo/protobuf v1.3.2
github.com/golang/mock v1.3.1
github.com/lib/pq v1.0.0
github.com/natefinch/lumberjack v2.0.0+incompatible
github.com/pkg/errors v0.9.1
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4er
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.3.1 h1:qGJ6qTW+x6xX/my+8YUVl4WNpX9B7+/l2tRsHGZ7f2s=
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
Expand Down
302 changes: 302 additions & 0 deletions pkg/tc/holder/mock/session_holder.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f759109

Please sign in to comment.