Browse Source

add testcover

pull/330/head
yedf2 4 years ago
parent
commit
16d47667ca
  1. 7
      client/dtmcli/logger/logger_test.go
  2. 5
      dtmsvr/trans_type_workflow.go

7
client/dtmcli/logger/logger_test.go

@ -4,6 +4,7 @@ import (
"os" "os"
"testing" "testing"
"github.com/stretchr/testify/assert"
"go.uber.org/zap" "go.uber.org/zap"
) )
@ -37,3 +38,9 @@ func TestWithLogger(t *testing.T) {
FatalfIf(false, "nothing") FatalfIf(false, "nothing")
FatalIfError(nil) FatalIfError(nil)
} }
func TestCover(t *testing.T) {
sin := lumberjackSink{}
err := sin.Sync()
assert.Nil(t, err)
}

5
dtmsvr/trans_type_workflow.go

@ -25,10 +25,7 @@ type cWorkflowCustom struct {
} }
func (t *transWorkflowProcessor) ProcessOnce(branches []TransBranch) error { func (t *transWorkflowProcessor) ProcessOnce(branches []TransBranch) error {
if t.Status == dtmcli.StatusSubmitted { // client workflow finished if t.Status == dtmcli.StatusFailed || t.Status == dtmcli.StatusSucceed {
t.changeStatus(dtmcli.StatusSucceed)
return nil
} else if t.Status == dtmcli.StatusFailed || t.Status == dtmcli.StatusSucceed {
return nil return nil
} }

Loading…
Cancel
Save