forked from galaxydi/go-loghub
-
Notifications
You must be signed in to change notification settings - Fork 113
/
client_dashboard_test.go
49 lines (41 loc) · 1.1 KB
/
client_dashboard_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
47
48
49
package sls
import (
"fmt"
"os"
"testing"
"time"
"github.com/stretchr/testify/suite"
)
func TestDashboard(t *testing.T) {
suite.Run(t, new(DashboardTestSuite))
}
type DashboardTestSuite struct {
suite.Suite
endpoint string
projectName string
logstoreName string
accessKeyID string
accessKeySecret string
client Client
}
func (s *DashboardTestSuite) SetupSuite() {
s.endpoint = os.Getenv("LOG_TEST_ENDPOINT")
s.projectName = fmt.Sprintf("test-go-dashboard-%d", time.Now().Unix())
s.logstoreName = fmt.Sprintf("logstore-%d", time.Now().Unix())
s.accessKeyID = os.Getenv("LOG_TEST_ACCESS_KEY_ID")
s.accessKeySecret = os.Getenv("LOG_TEST_ACCESS_KEY_SECRET")
s.client.AccessKeyID = s.accessKeyID
s.client.AccessKeySecret = s.accessKeySecret
s.client.Endpoint = s.endpoint
s.Nil(makeSureLogstoreExist(&s.client, s.projectName, s.logstoreName))
}
func (s *DashboardTestSuite) TearDownSuite() {
err := s.client.DeleteProject(s.projectName)
s.Require().Nil(err)
}
func (s *DashboardTestSuite) TestDashboard() {
// @todo
}
func (s *DashboardTestSuite) TestChart() {
// @todo
}