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

Fix: Merge master commit to develop #653

Merged
merged 15 commits into from
Jul 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@ registry/zookeeper/zookeeper-4unittest/
metadata/report/zookeeper/zookeeper-4unittest/
registry/consul/agent*
config_center/apollo/mockDubbog.properties.json

# vim stuff
*~
.*.sw?
36 changes: 32 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,40 @@ If you are willing to do some code contributions and document contributions to [

Benchmark project [dubbo-go-benchmark](https://github.com/dubbogo/dubbo-go-benchmark).

About dubbo-go benchmarking report, please refer to [dubbo benchmarking report](https://github.com/apache/dubbo-go/wiki/pressure-test-report-for-dubbo) & [jsonrpc benchmarking report](https://github.com/apache/dubbo-go/wiki/pressure-test-report-for-jsonrpc).
About dubbo-go benchmarking report, please refer to [dubbo benchmarking report](https://github.com/apache/dubbo-go/wiki/Benchmark-test-of-dubbo) & [jsonrpc benchmarking report](https://github.com/apache/dubbo-go/wiki/Benchmark-test-of-jsonrpc).

## [User List](https://github.com/apache/dubbo-go/issues/2)

If you are using [apache/dubbo-go](github.com/apache/dubbo-go) and think that it helps you or want do some contributions to it, please add your company to to [the user list](https://github.com/apache/dubbo-go/issues/2) to let us know your needs.

![ctrip](https://pic.c-ctrip.com/common/c_logo2013.png)
![Excellent Health Technology Group](https://user-images.githubusercontent.com/52339367/84628582-80512200-af1b-11ea-945a-c6b4b9ad31f2.png)
![tuya](https://raw.githubusercontent.com/pantianying/go-tool/master/picture/logo_2-removebg-preview.png)

<div>
<table>
<tbody>
<tr></tr>
<tr>
<td align="center" valign="middle">
<a href="" target="_blank">
<img width="222px" src="https://pic.c-ctrip.com/common/c_logo2013.png">
</a>
</td>
<td align="center" valign="middle">
<a href="" target="_blank">
<img width="222px" src="https://user-images.githubusercontent.com/52339367/84628582-80512200-af1b-11ea-945a-c6b4b9ad31f2.png">
</a>
</td>
<td align="center" valign="middle">
<a href="" target="_blank">
<img width="222px" src="https://mosn.io/images/community/tuya.png">
</a>
</td>
<td align="center" valign="middle">
<a href="https://github.com/mosn" target="_blank">
<img width="222px" src="https://raw.githubusercontent.com/mosn/community/master/icons/png/mosn-labeled-horizontal.png">
</a>
</td>
</tr>
<tr></tr>
</tbody>
</table>
</div>
35 changes: 31 additions & 4 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,39 @@ go test ./... -coverprofile=coverage.txt -covermode=atomic

性能测试项目是 [dubbo-go-benchmark](https://github.com/dubbogo/dubbo-go-benchmark)。

关于 dubbo-go 性能测试报告,请阅读 [dubbo benchmarking report](https://github.com/apache/dubbo-go/wiki/pressure-test-report-for-dubbo) & [jsonrpc benchmarking report](https://github.com/apache/dubbo-go/wiki/pressure-test-report-for-jsonrpc)。
关于 dubbo-go 性能测试报告,请阅读 [dubbo benchmarking report](https://github.com/apache/dubbo-go/wiki/Benchmark-test-of-dubbo) & [jsonrpc benchmarking report](https://github.com/apache/dubbo-go/wiki/Benchmark-test-of-jsonrpc)。

## [User List](https://github.com/apache/dubbo-go/issues/2)

若你正在使用 [apache/dubbo-go](github.com/apache/dubbo-go) 且认为其有用或者向对其做改进,请忝列贵司信息于 [用户列表](https://github.com/apache/dubbo-go/issues/2),以便我们知晓之。

![ctrip](https://pic.c-ctrip.com/common/c_logo2013.png)
![Excellent Health Technology Group](https://user-images.githubusercontent.com/52339367/84628582-80512200-af1b-11ea-945a-c6b4b9ad31f2.png)
![tuya](https://raw.githubusercontent.com/pantianying/go-tool/master/picture/logo_2-removebg-preview.png)
<div>
<table>
<tbody>
<tr></tr>
<tr>
<td align="center" valign="middle">
<a href="" target="_blank">
<img width="222px" src="https://pic.c-ctrip.com/common/c_logo2013.png">
</a>
</td>
<td align="center" valign="middle">
<a href="" target="_blank">
<img width="222px" src="https://user-images.githubusercontent.com/52339367/84628582-80512200-af1b-11ea-945a-c6b4b9ad31f2.png">
</a>
</td>
<td align="center" valign="middle">
<a href="" target="_blank">
<img width="222px" src="https://mosn.io/images/community/tuya.png">
</a>
</td>
<td align="center" valign="middle">
<a href="https://github.com/mosn" target="_blank">
<img width="222px" src="https://raw.githubusercontent.com/mosn/community/master/icons/png/mosn-labeled-horizontal.png">
</a>
</td>
</tr>
<tr></tr>
</tbody>
</table>
</div>
4 changes: 2 additions & 2 deletions filter/filter_impl/access_log_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func TestAccessLogFilter_Invoke_Not_Config(t *testing.T) {
assert.Nil(t, result.Error())
}

func TestAccessLogFilter_Invoke_Default_Config(t *testing.T) {
func TestAccessLogFilterInvokeDefaultConfig(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
url, _ := common.NewURL(
Expand All @@ -74,7 +74,7 @@ func TestAccessLogFilter_Invoke_Default_Config(t *testing.T) {
assert.Nil(t, result.Error())
}

func TestAccessLogFilter_OnResponse(t *testing.T) {
func TestAccessLogFilterOnResponse(t *testing.T) {
result := &protocol.RPCResult{}
accessLogFilter := GetAccessLogFilter()
response := accessLogFilter.OnResponse(nil, result, nil, nil)
Expand Down
4 changes: 2 additions & 2 deletions filter/filter_impl/active_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
"github.com/apache/dubbo-go/protocol/mock"
)

func TestActiveFilter_Invoke(t *testing.T) {
func TestActiveFilterInvoke(t *testing.T) {
invoc := invocation.NewRPCInvocation("test", []interface{}{"OK"}, make(map[string]string, 0))
url, _ := common.NewURL("dubbo://192.168.10.10:20000/com.ikurento.user.UserProvider")
filter := ActiveFilter{}
Expand All @@ -50,7 +50,7 @@ func TestActiveFilter_Invoke(t *testing.T) {

}

func TestActiveFilter_OnResponse(t *testing.T) {
func TestActiveFilterOnResponse(t *testing.T) {
c := protocol.CurrentTimeMillis()
elapsed := 100
invoc := invocation.NewRPCInvocation("test", []interface{}{"OK"}, map[string]string{
Expand Down
2 changes: 1 addition & 1 deletion filter/filter_impl/echo_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"github.com/apache/dubbo-go/protocol/invocation"
)

func TestEchoFilter_Invoke(t *testing.T) {
func TestEchoFilterInvoke(t *testing.T) {
filter := GetFilter()
result := filter.Invoke(context.Background(), protocol.NewBaseInvoker(common.URL{}), invocation.NewRPCInvocation("$echo", []interface{}{"OK"}, nil))
assert.Equal(t, "OK", result.Result())
Expand Down
6 changes: 3 additions & 3 deletions filter/filter_impl/execute_limit_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
"github.com/apache/dubbo-go/protocol/invocation"
)

func TestExecuteLimitFilter_Invoke_Ignored(t *testing.T) {
func TestExecuteLimitFilterInvokeIgnored(t *testing.T) {
methodName := "hello"
invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]string, 0))

Expand All @@ -49,7 +49,7 @@ func TestExecuteLimitFilter_Invoke_Ignored(t *testing.T) {
assert.Nil(t, result.Error())
}

func TestExecuteLimitFilter_Invoke_Configure_Error(t *testing.T) {
func TestExecuteLimitFilterInvokeConfigureError(t *testing.T) {
methodName := "hello1"
invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]string, 0))

Expand All @@ -66,7 +66,7 @@ func TestExecuteLimitFilter_Invoke_Configure_Error(t *testing.T) {
assert.Nil(t, result.Error())
}

func TestExecuteLimitFilter_Invoke(t *testing.T) {
func TestExecuteLimitFilterInvoke(t *testing.T) {
methodName := "hello1"
invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]string, 0))

Expand Down
6 changes: 3 additions & 3 deletions filter/filter_impl/generic_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/stretchr/testify/assert"
)

func Test_struct2MapAll(t *testing.T) {
func TestStruct2MapAll(t *testing.T) {
var testData struct {
AaAa string `m:"aaAa"`
BaBa string
Expand Down Expand Up @@ -64,7 +64,7 @@ type testStruct struct {
} `m:"xxYy"`
}

func Test_struct2MapAll_Slice(t *testing.T) {
func TestStruct2MapAllSlice(t *testing.T) {
var testData struct {
AaAa string `m:"aaAa"`
BaBa string
Expand All @@ -89,7 +89,7 @@ func Test_struct2MapAll_Slice(t *testing.T) {
assert.Equal(t, reflect.Map, reflect.TypeOf(m["caCa"].([]interface{})[0].(map[string]interface{})["xxYy"]).Kind())
}

func Test_struct2MapAll_Map(t *testing.T) {
func TestStruct2MapAllMap(t *testing.T) {
var testData struct {
AaAa string
Baba map[string]interface{}
Expand Down
6 changes: 3 additions & 3 deletions filter/filter_impl/generic_service_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (*TestService) Reference() string {
return "com.test.Path"
}

func TestGenericServiceFilter_Invoke(t *testing.T) {
func TestGenericServiceFilterInvoke(t *testing.T) {
hessian.RegisterPOJO(&TestStruct{})
methodName := "$invoke"
m := make(map[string]interface{})
Expand Down Expand Up @@ -105,7 +105,7 @@ func TestGenericServiceFilter_Invoke(t *testing.T) {
assert.Nil(t, result.Error())
}

func TestGenericServiceFilter_ResponseTestStruct(t *testing.T) {
func TestGenericServiceFilterResponseTestStruct(t *testing.T) {
ts := &TestStruct{
AaAa: "aaa",
BaBa: "bbb",
Expand All @@ -130,7 +130,7 @@ func TestGenericServiceFilter_ResponseTestStruct(t *testing.T) {
assert.Equal(t, reflect.ValueOf(r.Result()).Kind(), reflect.Map)
}

func TestGenericServiceFilter_ResponseString(t *testing.T) {
func TestGenericServiceFilterResponseString(t *testing.T) {
str := "111"
result := &protocol.RPCResult{
Rest: str,
Expand Down
2 changes: 1 addition & 1 deletion filter/filter_impl/graceful_shutdown_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (
"github.com/apache/dubbo-go/protocol/invocation"
)

func TestGenericFilter_Invoke(t *testing.T) {
func TestGenericFilterInvoke(t *testing.T) {
invoc := invocation.NewRPCInvocation("GetUser", []interface{}{"OK"}, make(map[string]string, 0))

invokeUrl := common.NewURLWithOptions(
Expand Down
14 changes: 7 additions & 7 deletions filter/filter_impl/hystrix_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func TestGetHystrixFilter(t *testing.T) {
assert.NotNil(t, filterGot)
}

func TestGetConfig_1(t *testing.T) {
func TestGetConfig1(t *testing.T) {
mockInitHystrixConfig()
configGot := getConfig("com.ikurento.user.UserProvider", "GetUser", true)
assert.NotNil(t, configGot)
Expand All @@ -101,7 +101,7 @@ func TestGetConfig_1(t *testing.T) {
assert.Equal(t, 5, configGot.RequestVolumeThreshold)
}

func TestGetConfig_2(t *testing.T) {
func TestGetConfig2(t *testing.T) {
mockInitHystrixConfig()
configGot := getConfig("com.ikurento.user.UserProvider", "GetUser0", true)
assert.NotNil(t, configGot)
Expand All @@ -112,7 +112,7 @@ func TestGetConfig_2(t *testing.T) {
assert.Equal(t, 15, configGot.RequestVolumeThreshold)
}

func TestGetConfig_3(t *testing.T) {
func TestGetConfig3(t *testing.T) {
mockInitHystrixConfig()
//This should use default
configGot := getConfig("Mock.Service", "GetMock", true)
Expand Down Expand Up @@ -145,22 +145,22 @@ func (iv *testMockFailInvoker) Invoke(_ context.Context, _ protocol.Invocation)
}
}

func TestHystrixFilter_Invoke_Success(t *testing.T) {
func TestHystrixFilterInvokeSuccess(t *testing.T) {
hf := &HystrixFilter{}
result := hf.Invoke(context.Background(), &testMockSuccessInvoker{}, &invocation.RPCInvocation{})
assert.NotNil(t, result)
assert.NoError(t, result.Error())
assert.NotNil(t, result.Result())
}

func TestHystrixFilter_Invoke_Fail(t *testing.T) {
func TestHystrixFilterInvokeFail(t *testing.T) {
hf := &HystrixFilter{}
result := hf.Invoke(context.Background(), &testMockFailInvoker{}, &invocation.RPCInvocation{})
assert.NotNil(t, result)
assert.Error(t, result.Error())
}

func TestHystricFilter_Invoke_CircuitBreak(t *testing.T) {
func TestHystricFilterInvokeCircuitBreak(t *testing.T) {
mockInitHystrixConfig()
hystrix.Flush()
hf := &HystrixFilter{COrP: true}
Expand All @@ -183,7 +183,7 @@ func TestHystricFilter_Invoke_CircuitBreak(t *testing.T) {

}

func TestHystricFilter_Invoke_CircuitBreak_Omit_Exception(t *testing.T) {
func TestHystricFilterInvokeCircuitBreakOmitException(t *testing.T) {
mockInitHystrixConfig()
hystrix.Flush()
reg, _ := regexp.Compile(".*exception.*")
Expand Down
2 changes: 1 addition & 1 deletion filter/filter_impl/metrics_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (
"github.com/apache/dubbo-go/protocol/invocation"
)

func TestMetricsFilter_Invoke(t *testing.T) {
func TestMetricsFilterInvoke(t *testing.T) {

// prepare the mock reporter
config.GetMetricConfig().Reporters = []string{"mock"}
Expand Down
8 changes: 4 additions & 4 deletions filter/filter_impl/token_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
"github.com/apache/dubbo-go/protocol/invocation"
)

func TestTokenFilter_Invoke(t *testing.T) {
func TestTokenFilterInvoke(t *testing.T) {
filter := GetTokenFilter()

url := common.NewURLWithOptions(
Expand All @@ -50,7 +50,7 @@ func TestTokenFilter_Invoke(t *testing.T) {
assert.Nil(t, result.Result())
}

func TestTokenFilter_InvokeEmptyToken(t *testing.T) {
func TestTokenFilterInvokeEmptyToken(t *testing.T) {
filter := GetTokenFilter()

testUrl := common.URL{}
Expand All @@ -61,7 +61,7 @@ func TestTokenFilter_InvokeEmptyToken(t *testing.T) {
assert.Nil(t, result.Result())
}

func TestTokenFilter_InvokeEmptyAttach(t *testing.T) {
func TestTokenFilterInvokeEmptyAttach(t *testing.T) {
filter := GetTokenFilter()

testUrl := common.NewURLWithOptions(
Expand All @@ -72,7 +72,7 @@ func TestTokenFilter_InvokeEmptyAttach(t *testing.T) {
assert.NotNil(t, result.Error())
}

func TestTokenFilter_InvokeNotEqual(t *testing.T) {
func TestTokenFilterInvokeNotEqual(t *testing.T) {
filter := GetTokenFilter()

testUrl := common.NewURLWithOptions(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/stretchr/testify/assert"
)

func TestFixedWindowTpsLimitStrategyImpl_IsAllowable(t *testing.T) {
func TestFixedWindowTpsLimitStrategyImplIsAllowable(t *testing.T) {
creator := &fixedWindowStrategyCreator{}
strategy := creator.Create(2, 60000)
assert.True(t, strategy.IsAllowable())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/stretchr/testify/assert"
)

func TestSlidingWindowTpsLimitStrategyImpl_IsAllowable(t *testing.T) {
func TestSlidingWindowTpsLimitStrategyImplIsAllowable(t *testing.T) {
creator := &slidingWindowStrategyCreator{}
strategy := creator.Create(2, 60000)
assert.True(t, strategy.IsAllowable())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/stretchr/testify/assert"
)

func TestThreadSafeFixedWindowTpsLimitStrategyImpl_IsAllowable(t *testing.T) {
func TestThreadSafeFixedWindowTpsLimitStrategyImplIsAllowable(t *testing.T) {
creator := &threadSafeFixedWindowStrategyCreator{}
strategy := creator.Create(2, 60000)
assert.True(t, strategy.IsAllowable())
Expand Down
Loading