forked from jfrog/jfrog-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
unit_test.go
33 lines (28 loc) · 866 Bytes
/
unit_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
package main
import (
"os"
"testing"
"github.com/jfrog/jfrog-cli-core/utils/coreutils"
coreTests "github.com/jfrog/jfrog-cli-core/utils/tests"
"github.com/jfrog/jfrog-cli/utils/tests"
"github.com/jfrog/jfrog-client-go/utils/log"
clientTests "github.com/jfrog/jfrog-client-go/utils/tests"
)
const (
JfrogTestsHome = ".jfrogTest"
CliIntegrationTests = "github.com/jfrog/jfrog-cli"
)
func TestUnitTests(t *testing.T) {
oldHome, err := coreTests.SetJfrogHome()
if err != nil {
log.Error(err)
os.Exit(1)
}
defer os.Setenv(coreutils.HomeDir, oldHome)
// Clean from previous tests.
coreTests.CleanUnitTestsJfrogHome()
defer coreTests.CleanUnitTestsJfrogHome()
packages := clientTests.GetTestPackages("./...")
packages = clientTests.ExcludeTestsPackage(packages, CliIntegrationTests)
clientTests.RunTests(packages, *tests.HideUnitTestLog)
}