From 833ca182e37d145bbc46cae493197e87b200fa7c Mon Sep 17 00:00:00 2001 From: fangyincheng <fangyincheng@sina.com> Date: Fri, 17 May 2019 19:15:25 +0800 Subject: [PATCH] Add:add travis --- .travis.yml | 17 +++++++++++++++++ cluster/loadbalance.go | 2 -- cluster/loadbalance/random.go | 2 +- protocol/jsonrpc/http_test.go | 2 +- protocol/jsonrpc/jsonrpc_invoker_test.go | 2 +- 5 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..2038d8ecc --- /dev/null +++ b/.travis.yml @@ -0,0 +1,17 @@ +language: go + +go: + - "1.11" + - "1.12" + +env: + - GO111MODULE=on + +install: true + +script: + - go fmt ./... && [[ -z `git status -s` ]] + - go mod vendor && go test ./... -coverprofile=coverage.txt -covermode=atomic + +after_success: + - bash <(curl -s https://codecov.io/bash) diff --git a/cluster/loadbalance.go b/cluster/loadbalance.go index 4df608810..8e1ff5d14 100644 --- a/cluster/loadbalance.go +++ b/cluster/loadbalance.go @@ -8,5 +8,3 @@ import ( type LoadBalance interface { Select([]protocol.Invoker, protocol.Invocation) protocol.Invoker } - - diff --git a/cluster/loadbalance/random.go b/cluster/loadbalance/random.go index 556c503dd..aad09f2fa 100644 --- a/cluster/loadbalance/random.go +++ b/cluster/loadbalance/random.go @@ -31,7 +31,7 @@ func (lb *randomLoadBalance) Select(invokers []protocol.Invoker, invocation prot sameWeight := true weights := make([]int64, length) - firstWeight :=GetWeight(invokers[0], invocation) + firstWeight := GetWeight(invokers[0], invocation) totalWeight := firstWeight weights[0] = firstWeight diff --git a/protocol/jsonrpc/http_test.go b/protocol/jsonrpc/http_test.go index 522337cca..19025fa0d 100644 --- a/protocol/jsonrpc/http_test.go +++ b/protocol/jsonrpc/http_test.go @@ -37,7 +37,7 @@ func TestHTTPClient_Call(t *testing.T) { // Export proto := GetProtocol() - url, err := common.NewURL(context.Background(), "jsonrpc://127.0.0.1:20000/com.ikurento.user.UserProvider?anyhost=true&"+ + url, err := common.NewURL(context.Background(), "jsonrpc://127.0.0.1:20001/com.ikurento.user.UserProvider?anyhost=true&"+ "application=BDTService&category=providers&default.timeout=10000&dubbo=dubbo-provider-golang-1.0.0&"+ "environment=dev&interface=com.ikurento.user.UserProvider&ip=192.168.56.1&methods=GetUser%2C&"+ "module=dubbogo+user-info+server&org=ikurento.com&owner=ZX&pid=1447&revision=0.0.1&"+ diff --git a/protocol/jsonrpc/jsonrpc_invoker_test.go b/protocol/jsonrpc/jsonrpc_invoker_test.go index 8bf3f3e3c..5e1bd3538 100644 --- a/protocol/jsonrpc/jsonrpc_invoker_test.go +++ b/protocol/jsonrpc/jsonrpc_invoker_test.go @@ -24,7 +24,7 @@ func TestJsonrpcInvoker_Invoke(t *testing.T) { // Export proto := GetProtocol() - url, err := common.NewURL(context.Background(), "jsonrpc://127.0.0.1:20000/com.ikurento.user.UserProvider?anyhost=true&"+ + url, err := common.NewURL(context.Background(), "jsonrpc://127.0.0.1:20001/com.ikurento.user.UserProvider?anyhost=true&"+ "application=BDTService&category=providers&default.timeout=10000&dubbo=dubbo-provider-golang-1.0.0&"+ "environment=dev&interface=com.ikurento.user.UserProvider&ip=192.168.56.1&methods=GetUser%2C&"+ "module=dubbogo+user-info+server&org=ikurento.com&owner=ZX&pid=1447&revision=0.0.1&"+ -- GitLab