Remove tests for init and uninstall

This commit is contained in:
vinayada1 2020-05-29 16:39:23 -07:00
parent 362a12f6f8
commit d53dc63da8
3 changed files with 1 additions and 82 deletions

View File

@ -124,5 +124,4 @@ release: build archive
################################################################################
.PHONY: test
test:
go test ./pkg/...
go test -timeout 120s ./pkg/... --tags=large_timeout
go test ./pkg/...

View File

@ -1,36 +0,0 @@
// +build large_timeout
// ------------------------------------------------------------
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
// ------------------------------------------------------------
package standalone
import (
"os"
"testing"
"github.com/stretchr/testify/assert"
)
func tearDownInit(t *testing.T) {
Uninstall(true, "")
}
func TestStandaloneInit(t *testing.T) {
// Setup the teardown routine to cleanup
defer tearDownInit(t)
var err error
t.Run("Init", func(t *testing.T) {
err = Init("0.7.0", "", "")
})
assert.Nil(t, err)
// Assert that default components folder is created at Init time
defaultComponentsDir := getDefaultComponentsFolder()
_, err = os.Stat(defaultComponentsDir)
assert.Nil(t, err, "Default components directory not created at init time")
}

View File

@ -1,44 +0,0 @@
// +build large_timeout
// ------------------------------------------------------------
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
// ------------------------------------------------------------
package standalone
import (
"fmt"
"os"
"testing"
"github.com/stretchr/testify/assert"
)
func setupUninstall(t *testing.T) {
err := Init("0.7.0", "", "")
assert.Nil(t, err, "Unable to setup the test properly")
}
func tearDownUninstall(t *testing.T) {
fmt.Println("teardown ***")
Uninstall(true, "")
}
func TestUninstall(t *testing.T) {
setupUninstall(t)
// Setup the teardown routine to cleanup
defer tearDownUninstall(t)
var err error
t.Run("Uninstall", func(t *testing.T) {
err = Uninstall(true, "")
})
assert.Nil(t, err)
// Assert that default components folder is deleted after uninstall
defaultComponentsDir := getDefaultComponentsFolder()
_, err = os.Stat(defaultComponentsDir)
assert.NotNil(t, err, "Default components directory not deleted after uninstall")
}