mirror of https://github.com/dapr/cli.git
Remove tests for init and uninstall
This commit is contained in:
parent
362a12f6f8
commit
d53dc63da8
3
Makefile
3
Makefile
|
@ -124,5 +124,4 @@ release: build archive
|
|||
################################################################################
|
||||
.PHONY: test
|
||||
test:
|
||||
go test ./pkg/...
|
||||
go test -timeout 120s ./pkg/... --tags=large_timeout
|
||||
go test ./pkg/...
|
|
@ -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")
|
||||
}
|
|
@ -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")
|
||||
}
|
Loading…
Reference in New Issue