Browse Source

Fixed registry tests

luis 7 years ago
parent
commit
1a705813be
3 changed files with 6 additions and 6 deletions
  1. 1 2
      .drone.yml
  2. 3 3
      go/src/flow/registry/registry_test.go
  3. 2 1
      go/src/flowserver/sessionmgr.go

+ 1 - 2
.drone.yml

@@ -11,9 +11,8 @@ pipeline:
       - go get github.com/axw/gocov/gocov
       - go get -d ./go/src/...
       - go get -d -t ./go/src/...
-      - ls /app/go/deps
-      - ls /app/go/deps/bin
       - /app/go/deps/bin/gocov test -v -race ./go/src/... | /app/go/deps/bin/gocov report
+      - go generate ./go/src/...
       - CGO_ENABLED=0 go build -o DIST/flowserver flowserver/cmd/flowserver  
   frontend:
     image: node:6

+ 3 - 3
go/src/flow/registry/registry_test.go

@@ -13,7 +13,7 @@ func TestRegistry(t *testing.T) {
 	r.Register("vecadd", dummy1)
 
 	e, err := r.Entry("vecadd")
-	assert.NotEq(err, nil, "fetching entry")
+	assert.Eq(err, nil, "fetching entry")
 
 	d := e.Description
 
@@ -38,7 +38,7 @@ func TestRegister(t *testing.T) {
 	assert := assert.A(t)
 	r := registry.New()
 	e := r.Register("func", func(a, b int) int { return 0 })
-	assert.NotEq(e.Err(), nil, "registering a func")
+	assert.Eq(e.Err(), nil, "should register a function")
 }
 func TestRegisterDuplicate(t *testing.T) {
 	assert := assert.A(t)
@@ -46,7 +46,7 @@ func TestRegisterDuplicate(t *testing.T) {
 	r.Register("func", func(a, b int) int { return 0 })
 	e := r.Register("func", func(b int) int { return 0 })
 
-	assert.NotEq(e.Err(), nil, "should allow duplicate")
+	assert.Eq(e.Err(), nil, "should allow duplicate")
 }
 func TestRegisterInvalidOutput(t *testing.T) {
 	assert := assert.A(t)

+ 2 - 1
go/src/flowserver/sessionmgr.go

@@ -3,6 +3,7 @@ package flowserver
 import (
 	"encoding/json"
 	"errors"
+	"flow"
 	"flowserver/flowmsg"
 	"log"
 	"net/http"
@@ -32,7 +33,7 @@ func (fsm *FlowSessionManager) CreateSession() *FlowSession {
 	fsm.Lock()
 	defer fsm.Unlock()
 	for {
-		ID := RandString(10)
+		ID := flow.RandString(10)
 		sess, ok := fsm.sessions[ID]
 		if !ok {
 			sess = NewSession(ID)