Skip to content

Commit

Permalink
fix(tests): fix sorting hooks test flake
Browse files Browse the repository at this point in the history
  • Loading branch information
adamreese committed Jul 11, 2017
1 parent 0a20ed7 commit 9325d13
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pkg/tiller/hooks_test.go
Expand Up @@ -197,17 +197,18 @@ metadata:
sorted := []manifest{}
for _, s := range data {
manifests := util.SplitManifests(s.manifest)
mCount := 0
for _, m := range manifests {
name := s.name[mCount]

for _, m := range manifests {
var sh util.SimpleHead
err := yaml.Unmarshal([]byte(m), &sh)
if err != nil {
// This is expected for manifests that are corrupt or empty.
t.Log(err)
continue
}

name := sh.Metadata.Name

//only keep track of non-hook manifests
if err == nil && s.hooks[name] == nil {
another := manifest{
Expand All @@ -217,8 +218,6 @@ metadata:
}
sorted = append(sorted, another)
}

mCount++
}
}

Expand Down

0 comments on commit 9325d13

Please sign in to comment.