Skip to content

Commit 19c51ae

Browse files
Sazon, John Bryan Jbzon
authored andcommitted
fix travisci test errors
1 parent e89ca8d commit 19c51ae

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

cmd/gitlab_client_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"testing"
66

77
"github.com/stretchr/testify/assert"
8+
gitlab "github.com/xanzy/go-gitlab"
89
)
910

1011
// Get the correct test data from the users environment variables
@@ -80,7 +81,7 @@ func TestGitlabNewClient(t *testing.T) {
8081
assert.Nil(t, err)
8182
}
8283
if !tc.negativeTest {
83-
_, _, err = gitlabClient.Users.ListUsers(nil)
84+
_, _, err = gitlabClient.Users.ListUsers(&gitlab.ListUsersOptions{})
8485
assert.Nil(t, err)
8586
}
8687
})

cmd/helpers_for_test.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ func (execT *execTestCmdFlags) executeCommand() (string, testResult) {
136136
}
137137

138138
// A helper to ignore os.Exit(1) errors when running a cobra Command
139-
// This was copied from https://github.com/spf13/cobra/blob/master/command_test.go
140139
func executeCommand(root *cobra.Command,
141140
args ...string) (stdout string, err error) {
142141
for i, arg := range args {
@@ -149,9 +148,7 @@ func executeCommand(root *cobra.Command,
149148
}
150149

151150
// A helper to ignore os.Exit(1) errors when running a cobra Command
152-
// This was copied from https://github.com/spf13/cobra/blob/master/command_test.go
153-
func executeCommandC(root *cobra.Command,
154-
args ...string) (stdout string, output string, err error) {
151+
func executeCommandC(root *cobra.Command, args ...string) (stdout string, output string, err error) {
155152
buf := new(bytes.Buffer)
156153
root.SetOutput(buf)
157154
root.SetArgs(args)
@@ -168,7 +165,7 @@ func executeCommandC(root *cobra.Command,
168165
go func() {
169166
var buf bytes.Buffer
170167
if _, err := io.Copy(&buf, r); err != nil {
171-
tInfo(err)
168+
panic(err)
172169
}
173170
outC <- buf.String()
174171
}()

0 commit comments

Comments
 (0)