-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_test.go
52 lines (41 loc) · 1.03 KB
/
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
47
48
49
50
51
52
package graphql
import (
"log"
"os"
"testing"
"github.com/surahman/FTeX/pkg/logger"
"go.uber.org/zap"
)
// graphQLConfigTestData is a map of the HTTP GraphQL configuration test data.
var graphQLConfigTestData = configTestData()
// zapLogger is the Zap logger used strictly for the test suite in this package.
var zapLogger *logger.Logger
func TestMain(m *testing.M) {
var err error
// Configure logger.
if zapLogger, err = logger.NewTestLogger(); err != nil {
log.Printf("Test suite logger setup failed: %v\n", err)
os.Exit(1)
}
// Setup test space.
if err = setup(); err != nil {
zapLogger.Error("Test suite setup failure", zap.Error(err))
os.Exit(1)
}
// Run test suite.
exitCode := m.Run()
// Cleanup test space.
if err = tearDown(); err != nil {
zapLogger.Error("Test suite teardown failure:", zap.Error(err))
os.Exit(1)
}
os.Exit(exitCode)
}
// setup will configure the auth test object.
func setup() error {
return nil
}
// tearDown will delete the test clusters keyspace.
func tearDown() error {
return nil
}