Skip to content

Commit

Permalink
chore: lint and format helm_wrapper_test file
Browse files Browse the repository at this point in the history
  • Loading branch information
hbollon committed Jun 23, 2023
1 parent 3a2eb73 commit 2ac6025
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions helm_wrapper_test.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package main

import (
"bytes"
"io"
"os"
"os/exec"
"io"
"bytes"
"sync"
"testing"
"testing"
)

var g_hw *HelmWrapper

func init() {
g_hw, _ = NewHelmWrapper()
g_hw, _ = NewHelmWrapper()
}

func TestNewHelmWrapper(t *testing.T) {
Expand All @@ -23,7 +23,7 @@ func TestErrorf(t *testing.T) {
g_hw.Errors = []error{}
err := g_hw.errorf("test %s %d %t", "a", 1, true)
if g_hw.Errors[0] != err {
t.Errorf("errorf(test %%s %%d %%t, a, 1, true) = %s; want %s", g_hw.Errors[0], err)
t.Errorf("errorf(test %%s %%d %%t, a, 1, true) = %s; want %s", g_hw.Errors[0], err)
}
}

Expand All @@ -34,17 +34,17 @@ func TestPipeWriter(t *testing.T) {
func TestValuesArg(t *testing.T) {
res, _, err := g_hw.valuesArg([]string{"-f", "cat.yaml"})
if res != "cat.yaml" || err != nil {
t.Errorf("valuesArg([]string{\"-f\", \"cat.yaml\"}) = %s, %s; want cat.yaml, <nil>", res, "cat.yaml")
t.Errorf("valuesArg([]string{\"-f\", \"cat.yaml\"}) = %s, %s; want cat.yaml, <nil>", res, "cat.yaml")
}

res, _, err = g_hw.valuesArg([]string{"--values", "cat.yaml"})
if res != "cat.yaml" || err != nil {
t.Errorf("valuesArg([]string{\"--valuse\", \"cat.yaml\"}) = %s, %s; want cat.yaml, <nil>", res, "cat.yaml")
t.Errorf("valuesArg([]string{\"--valuse\", \"cat.yaml\"}) = %s, %s; want cat.yaml, <nil>", res, "cat.yaml")
}

res, _, err = g_hw.valuesArg([]string{"--values=cat.yaml"})
if res != "cat.yaml" || err != nil {
t.Errorf("valuesArg([]string{\"--values=cat.yaml\"}) = %s, %s; want cat.yaml, <nil>", res, "cat.yaml")
t.Errorf("valuesArg([]string{\"--values=cat.yaml\"}) = %s, %s; want cat.yaml, <nil>", res, "cat.yaml")
}
}

Expand Down Expand Up @@ -133,11 +133,11 @@ func TestRunHelm(t *testing.T) {
"./test/charts/test",
"--values=test/charts/test/values-enc.yaml",
}

g_hw.RunHelm()
writer.Close()
wg.Wait()


reader, writer, err = os.Pipe()
if err != nil {
panic(err)
Expand Down

0 comments on commit 2ac6025

Please sign in to comment.