test
This commit is contained in:
parent
dddd5d1831
commit
052e6f1368
@ -22,15 +22,6 @@ func TestHelmRepoAdd(t *testing.T) {
|
||||
|
||||
res, err := repo.AddRepository()
|
||||
fmt.Println("TestHelmRepoAdd.24", res, err)
|
||||
|
||||
// bin := filepath.Join(TEST_BIN_DIR, "helm")
|
||||
// os.Chmod(bin, 0700)
|
||||
// assert.FileExists(t, bin, "TestHelmVersion error")
|
||||
|
||||
// version, err := Version(bin)
|
||||
|
||||
// assert.Nilf(t, err, "error message %s", bin)
|
||||
// assert.Equal(t, version, "v3.15.4+gfa9efb0", "TestHelmVersion error")
|
||||
}
|
||||
|
||||
// helm : not found
|
||||
|
@ -9,6 +9,7 @@ type toolsData struct {
|
||||
Tools []ToolData `yaml:"tools"`
|
||||
}
|
||||
|
||||
// Lecture de la liste des outils
|
||||
func FromConfigFile(filename string) ([]ToolData, error) {
|
||||
yamlFile, _ := os.ReadFile(filename)
|
||||
var data toolsData
|
||||
|
@ -2,6 +2,7 @@ package tool
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
// "os"
|
||||
"path/filepath"
|
||||
|
||||
"testing"
|
||||
@ -15,13 +16,6 @@ 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")
|
||||
|
||||
version, err := Version(bin)
|
||||
|
||||
assert.Nilf(t, err, "error message %s", bin)
|
||||
assert.Equal(t, "v1.30.3", version, "TestKubectlVersion error")
|
||||
assert.Equal(t, "kubectl", data[0].Name, "TestToolConf error")
|
||||
assert.Nilf(t, err, "error message %s", src)
|
||||
}
|
@ -0,0 +1 @@
|
||||
package tool
|
@ -15,7 +15,6 @@ import (
|
||||
|
||||
func GetFromOnline(version string) (string, string, error) {
|
||||
|
||||
fmt.Println(" ONLINE 18")
|
||||
version2 := version
|
||||
if version == "latest" {
|
||||
versionLatest, err := readLatestFromOnline()
|
||||
|
@ -1,4 +1,7 @@
|
||||
---
|
||||
|
||||
tools:
|
||||
|
||||
- name: kubectl
|
||||
url: https://dl.k8s.io/release/%s/bin/linux/amd64/kubectl
|
||||
version: v1.30.3
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user