This commit is contained in:
admju
2024-09-05 07:26:32 +00:00
parent a7a5465a22
commit dddd5d1831
11 changed files with 152 additions and 91 deletions

View File

@@ -1,13 +1,12 @@
package tool
import (
// "os"
"fmt"
"path/filepath"
"testing"
// "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/assert"
)
func TestToolConf(t *testing.T) {
@@ -17,12 +16,12 @@ func TestToolConf(t *testing.T) {
data, err := FromConfigFile(src)
fmt.Println("data", src, data, err)
// bin := filepath.Join(TEST_BIN_DIR, "kubectl")
// os.Chmod(bin, 0700)
// assert.FileExists(t, bin, "TestKubectlVersion error")
bin := filepath.Join(TEST_BIN_DIR, "kubectl")
os.Chmod(bin, 0700)
assert.FileExists(t, bin, "TestKubectlVersion error")
// version, err := Version(bin)
version, err := Version(bin)
// assert.Nilf(t, err, "error message %s", bin)
// assert.Equal(t, "v1.30.3", version, "TestKubectlVersion error")
assert.Nilf(t, err, "error message %s", bin)
assert.Equal(t, "v1.30.3", version, "TestKubectlVersion error")
}

0
src/tool/helm_test.go Normal file
View File