add travis.yml

This commit is contained in:
hdt3213
2021-05-02 16:31:41 +08:00
parent 12b17750b2
commit ab2cb554fa
4 changed files with 19 additions and 3 deletions

1
.gitignore vendored
View File

@@ -11,6 +11,7 @@
# Output of the go coverage tool, specifically when used with LiteIDE # Output of the go coverage tool, specifically when used with LiteIDE
*.out *.out
target/ target/
coverage.txt
logs logs

14
.travis.yml Normal file
View File

@@ -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)

View File

@@ -1,4 +1,4 @@
# Godis ![](https://img.shields.io/github/license/HDT3213/godis) &nbsp; ![](https://goreportcard.com/badge/github.com/HDT3213/godis)
[中文版](https://github.com/hdt3213/godis/blob/master/README_CN.md) [中文版](https://github.com/hdt3213/godis/blob/master/README_CN.md)

View File

@@ -3,6 +3,7 @@ package client
import ( import (
"github.com/hdt3213/godis/lib/logger" "github.com/hdt3213/godis/lib/logger"
"github.com/hdt3213/godis/redis/reply" "github.com/hdt3213/godis/redis/reply"
"strconv"
"testing" "testing"
) )
@@ -55,7 +56,7 @@ func TestClient(t *testing.T) {
}) })
if intRet, ok := result.(*reply.IntReply); ok { if intRet, ok := result.(*reply.IntReply); ok {
if intRet.Code != 1 { 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, ok := result.(*reply.IntReply); ok {
if intRet.Code != 3 { if intRet.Code != 3 {
t.Error("`rpush` failed, result: " + string(intRet.Code)) t.Error("`rpush` failed, result: " + strconv.FormatInt(intRet.Code, 10))
} }
} }