fix appveyor builds

Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
pull/4934/head
Matthew Fisher 7 years ago
parent dee2a1a000
commit 819c5c5ed3
No known key found for this signature in database
GPG Key ID: 92AA783CBAAE8E3B

@ -0,0 +1,18 @@
version: "{build}"
clone_folder: c:\go\src\k8s.io\helm
environment:
GOPATH: c:\go
PATH: c:\ProgramData\bin;$(PATH)
install:
- ps: iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/fishworks/gofish/master/scripts/install.ps1'))
- gofish init
- gofish install dep go
- go version
- dep ensure -vendor-only
cache:
- vendor -> Gopkg.lock
build: "off"
deploy: "off"
test_script:
- go build .\cmd\...
- go test .\...

@ -86,7 +86,7 @@ func TestCreateStarterCmd(t *testing.T) {
defer testChdir(t, tdir)()
// Run a create
if _, err := executeCommand(nil, fmt.Sprintf("--home=%s create --starter=starterchart %s", hh, cname)); err != nil {
if _, err := executeCommand(nil, fmt.Sprintf("--home=%s create --starter=starterchart %s", hh.String(), cname)); err != nil {
t.Errorf("Failed to run create: %s", err)
return
}

@ -135,7 +135,7 @@ func (o *dependencyLisOptions) run(out io.Writer) error {
}
if c.Metadata.Dependencies == nil {
fmt.Fprintf(out, "WARNING: no dependencies at %s/charts\n", o.chartpath)
fmt.Fprintf(out, "WARNING: no dependencies at %s\n", filepath.Join(o.chartpath, "charts"))
return nil
}

@ -16,27 +16,38 @@ limitations under the License.
package main
import (
"runtime"
"testing"
)
func TestDependencyListCmd(t *testing.T) {
tests := []cmdTestCase{{
noSuchChart := cmdTestCase{
name: "No such chart",
cmd: "dependency list /no/such/chart",
golden: "output/dependency-list-no-chart.txt",
golden: "output/dependency-list-no-chart-linux.txt",
wantError: true,
}, {
}
noDependencies := cmdTestCase{
name: "No dependencies",
cmd: "dependency list testdata/testcharts/alpine",
golden: "output/dependency-list-no-requirements.txt",
}, {
name: "Dependencies in chart dir",
cmd: "dependency list testdata/testcharts/reqtest",
golden: "output/dependency-list.txt",
}, {
name: "Dependencies in chart archive",
cmd: "dependency list testdata/testcharts/reqtest-0.1.0.tgz",
golden: "output/dependency-list-archive.txt",
}}
golden: "output/dependency-list-no-requirements-linux.txt",
}
if runtime.GOOS == "windows" {
noSuchChart.golden = "output/dependency-list-no-chart-windows.txt"
noDependencies.golden = "output/dependency-list-no-requirements-windows.txt"
}
tests := []cmdTestCase{noSuchChart,
noDependencies, {
name: "Dependencies in chart dir",
cmd: "dependency list testdata/testcharts/reqtest",
golden: "output/dependency-list.txt",
}, {
name: "Dependencies in chart archive",
cmd: "dependency list testdata/testcharts/reqtest-0.1.0.tgz",
golden: "output/dependency-list-archive.txt",
}}
runTestCmd(t, tests)
}

@ -52,7 +52,7 @@ func TestDependencyUpdateCmd(t *testing.T) {
t.Fatal(err)
}
out, err := executeCommand(nil, fmt.Sprintf("--home=%s dependency update %s", hh, hh.Path(chartname)))
out, err := executeCommand(nil, fmt.Sprintf("--home=%s dependency update %s", hh.String(), hh.Path(chartname)))
if err != nil {
t.Logf("Output: %s", out)
t.Fatal(err)

@ -57,7 +57,6 @@ func init() {
func TestMain(m *testing.M) {
os.Unsetenv("HELM_HOME")
exitCode := m.Run()
os.RemoveAll(testingDir)
os.Exit(exitCode)

@ -0,0 +1 @@
Error: FindFirstFile \no\such\chart: The system cannot find the path specified.

@ -0,0 +1 @@
WARNING: no requirements at testdata\testcharts\alpine\charts

@ -15,6 +15,8 @@ limitations under the License.
package chartutil
import (
"os"
"path/filepath"
"sort"
"strconv"
"testing"
@ -315,7 +317,12 @@ func TestDependentChartWithSubChartsHelmignore(t *testing.T) {
}
func TestDependentChartsWithSubChartsSymlink(t *testing.T) {
c := loadChart(t, "testdata/joonix")
joonix := filepath.Join("testdata", "joonix")
if err := os.Symlink(filepath.Join("..", "..", "frobnitz"), filepath.Join(joonix, "charts", "frobnitz")); err != nil {
t.Fatal(err)
}
defer os.RemoveAll(filepath.Join(joonix, "charts", "frobnitz"))
c := loadChart(t, joonix)
if c.Name() != "joonix" {
t.Fatalf("unexpected chart name: %s", c.Name())

@ -21,6 +21,7 @@ import (
"fmt"
"io/ioutil"
"os"
"path"
"path/filepath"
"sort"
"strings"
@ -110,7 +111,7 @@ func (i IndexFile) Add(md *chart.Metadata, filename, baseURL, digest string) {
_, file := filepath.Split(filename)
u, err = urlutil.URLJoin(baseURL, file)
if err != nil {
u = filepath.Join(baseURL, file)
u = path.Join(baseURL, file)
}
}
cr := &ChartVersion{
@ -246,9 +247,11 @@ func IndexDirectory(dir, baseURL string) (*IndexFile, error) {
var parentDir string
parentDir, fname = filepath.Split(fname)
// filepath.Split appends an extra slash to the end of parentDir. We want to strip that out.
parentDir = strings.TrimSuffix(parentDir, string(os.PathSeparator))
parentURL, err := urlutil.URLJoin(baseURL, parentDir)
if err != nil {
parentURL = filepath.Join(baseURL, parentDir)
parentURL = path.Join(baseURL, parentDir)
}
c, err := loader.Load(arch)

Loading…
Cancel
Save