forked from jfrog/jfrog-cli-security
-
Notifications
You must be signed in to change notification settings - Fork 0
/
unit_test.go
34 lines (27 loc) · 836 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
34
package main
import (
"github.com/stretchr/testify/assert"
coreTests "github.com/jfrog/jfrog-cli-core/v2/utils/tests"
"github.com/jfrog/jfrog-cli-security/tests/utils/integration"
clientTests "github.com/jfrog/jfrog-client-go/utils/tests"
clientLog "github.com/jfrog/jfrog-client-go/utils/log"
"os"
"testing"
)
const (
CliIntegrationTests = "github.com/jfrog/jfrog-cli-security"
)
func TestUnitTests(t *testing.T) {
integration.InitUnitTest(t)
// Create temp jfrog home
cleanUpJfrogHome, err := coreTests.SetJfrogHome()
if err != nil {
clientLog.Error(err)
os.Exit(1)
}
// Clean from previous tests.
defer cleanUpJfrogHome()
packages := clientTests.GetTestPackages("./...")
packages = clientTests.ExcludeTestsPackage(packages, CliIntegrationTests)
assert.NoError(t, clientTests.RunTests(packages, false))
}