-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_test.go
46 lines (38 loc) · 907 Bytes
/
main_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package main
import (
"log"
"os"
"testing"
"github.com/stretchr/testify/suite"
"github.com/urfave/cli/v2"
)
type GLTestSuite struct {
suite.Suite
Logger *Logger
Conf Config
Ctx *cli.Context
GitlabToken string
BaseURL string
Client *Client
}
func (suite *GLTestSuite) SetupTest() {
suite.Conf, _ = NewConfig()
suite.Logger = NewLogger(suite.Conf)
suite.Ctx = &cli.Context{}
suite.GitlabToken = os.Getenv("GITLAB_CI_TOKEN")
suite.BaseURL = "https://gitlab.fathom5.work"
client, err := NewClient(suite.GitlabToken, nil)
if err != nil {
log.Fatalf("failed to create NewClient: %s", err)
}
suite.Client = client
// set default values for global flags
baseURL = suite.BaseURL
token = suite.GitlabToken
}
func (suite *GLTestSuite) TestVersion() {
suite.NotEqual("", Version())
}
func TestGLTestSuite(t *testing.T) {
suite.Run(t, new(GLTestSuite))
}