Skip to content

Commit

Permalink
fixing integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
philbrookes committed Feb 16, 2018
1 parent ea5ad2c commit 4f2eb0d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
3 changes: 3 additions & 0 deletions integration/client_delete_serviceInstance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ func getInstance(si *ProvisionServiceParams) (instance *v1beta1.ServiceInstance,
return nil, err
}

if len(siList.Items) == 0 {
return nil, errors.New("no matching instances found")
}
return &siList.Items[0], nil
}

Expand Down
14 changes: 12 additions & 2 deletions integration/service_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,21 @@ func TestIntegration(t *testing.T) {
}

func CreateInstance(t *testing.T, si *ProvisionServiceParams) {
args := []string{"create", "serviceinstance", si.ServiceName, si.Namespace}
args = append(args, si.Params...)
args := []string{"delete", "secret", "dh-fh-sync-server-apb-params", si.Namespace}
cmd := exec.Command(*executable, args...)
_ = exec.Command(*executable, args...)

output, err := cmd.CombinedOutput()
if err != nil {
t.Fatalf("Failed to delete fh-sync-server apb secret 'dh-fh-sync-server-apb-params': '%s' with error: '%s'", output, err)
}

args = []string{"create", "serviceinstance", si.ServiceName, si.Namespace}
args = append(args, si.Params...)
t.Logf("executing: %v\n", *executable+strings.Join(args, " "))
cmd = exec.Command(*executable, args...)

output, err = cmd.CombinedOutput()
if err != nil {
t.Fatalf("Failed to create service instance '%s': '%s' with error: '%s'", si.ServiceName, output, err)
}
Expand Down
1 change: 0 additions & 1 deletion integration/validatedCommandUtils.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ type ValidationResult struct {
}

func (v ValidationResult) Test(t *testing.T) (output []byte, err error) {
t.Log(fmt.Sprintf("%s\n", v.Output))
if !v.Success {
t.Fatal(v.Message)
}
Expand Down

0 comments on commit 4f2eb0d

Please sign in to comment.