diff --git a/.gitignore b/.gitignore index 7a7abb6..93cbb1b 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ # Output of the go coverage tool, specifically when used with LiteIDE *.out target/ +coverage.txt logs diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..1c67207 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,14 @@ +language: go + +go: + - 1.16 + +before_install: + - go get -t -v ./... + - sudo apt-get install redis-server + +script: + - go test -coverprofile=coverage.txt -covermode=atomic ./... + +after_success: + - bash <(curl -s https://codecov.io/bash) diff --git a/README.md b/README.md index cba2dfe..a569cd7 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Godis +![](https://img.shields.io/github/license/HDT3213/godis)   ![](https://goreportcard.com/badge/github.com/HDT3213/godis) [中文版](https://github.com/hdt3213/godis/blob/master/README_CN.md) diff --git a/redis/client/client_test.go b/redis/client/client_test.go index 0574653..500a82b 100644 --- a/redis/client/client_test.go +++ b/redis/client/client_test.go @@ -3,6 +3,7 @@ package client import ( "github.com/hdt3213/godis/lib/logger" "github.com/hdt3213/godis/redis/reply" + "strconv" "testing" ) @@ -55,7 +56,7 @@ func TestClient(t *testing.T) { }) if intRet, ok := result.(*reply.IntReply); ok { if intRet.Code != 1 { - t.Error("`del` failed, result: " + string(intRet.Code)) + t.Error("`del` failed, result: " + strconv.FormatInt(intRet.Code, 10)) } } @@ -81,7 +82,7 @@ func TestClient(t *testing.T) { }) if intRet, ok := result.(*reply.IntReply); ok { if intRet.Code != 3 { - t.Error("`rpush` failed, result: " + string(intRet.Code)) + t.Error("`rpush` failed, result: " + strconv.FormatInt(intRet.Code, 10)) } }