forked from jfrog/jfrog-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_test.go
48 lines (43 loc) · 1019 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
47
48
package main
import (
"flag"
"github.com/jfrog/jfrog-cli-go/utils/log"
"github.com/jfrog/jfrog-cli-go/utils/tests"
"github.com/jfrog/jfrog-client-go/utils"
"os"
"testing"
)
func TestMain(m *testing.M) {
log.SetDefaultLogger()
setupIntegrationTests()
result := m.Run()
tearDownIntegrationTests()
os.Exit(result)
}
func setupIntegrationTests() {
flag.Parse()
*tests.RtUrl = utils.AddTrailingSlashIfNeeded(*tests.RtUrl)
if *tests.TestBintray {
InitBintrayTests()
}
if *tests.TestArtifactory && !*tests.TestArtifactoryProxy {
InitArtifactoryTests()
}
if *tests.TestBuildTools || *tests.TestGo || *tests.TestNuget || *tests.TestPip {
InitBuildToolsTests()
}
if *tests.TestDocker {
InitDockerTests()
}
}
func tearDownIntegrationTests() {
if *tests.TestBintray {
CleanBintrayTests()
}
if *tests.TestArtifactory && !*tests.TestArtifactoryProxy {
CleanArtifactoryTests()
}
if *tests.TestBuildTools || *tests.TestGo || *tests.TestNuget || *tests.TestPip {
CleanBuildToolsTests()
}
}