Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make error message more human readable #5563

Merged
merged 4 commits into from
Oct 17, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions pkg/minikube/service/service_test.go
Original file line number Diff line number Diff line change
@@ -101,7 +101,6 @@ var nondefaultserviceNamespaces = map[string]typed_core.ServiceInterface{
"default": nondefaultNamespaceServiceInterface,
}


var nondefaultNamespaceServiceInterface = &MockServiceInterface{
ServiceList: &core.ServiceList{
Items: []core.Service{
@@ -119,7 +118,6 @@ var nondefaultNamespaceServiceInterface = &MockServiceInterface{
},
}


var defaultNamespaceServiceInterface = &MockServiceInterface{
ServiceList: &core.ServiceList{
Items: []core.Service{
@@ -865,15 +863,15 @@ func TestWaitAndMaybeOpenService(t *testing.T) {
api: defaultAPI,
https: true,
expected: []string{"http://127.0.0.1:1111", "http://127.0.0.1:2222"},
nondefault: false,
nondefault: false,
},
{
description: "correctly return serviceURLs, no https, no url mode",
namespace: "default",
service: "mock-dashboard",
api: defaultAPI,
expected: []string{"http://127.0.0.1:1111", "http://127.0.0.1:2222"},
nondefault: false,
nondefault: false,
},
{
description: "correctly return serviceURLs, no https, url mode",
@@ -882,7 +880,7 @@ func TestWaitAndMaybeOpenService(t *testing.T) {
api: defaultAPI,
urlMode: true,
expected: []string{"http://127.0.0.1:1111", "http://127.0.0.1:2222"},
nondefault: false,
nondefault: false,
},
{
description: "correctly return serviceURLs, https, url mode",
@@ -892,7 +890,7 @@ func TestWaitAndMaybeOpenService(t *testing.T) {
urlMode: true,
https: true,
expected: []string{"http://127.0.0.1:1111", "http://127.0.0.1:2222"},
nondefault: false,
nondefault: false,
},
{
description: "correctly return empty serviceURLs",
@@ -901,7 +899,7 @@ func TestWaitAndMaybeOpenService(t *testing.T) {
api: defaultAPI,
expected: []string{},
err: true,
nondefault: false,
nondefault: false,
},
{
description: "correctly return empty serviceURLs",
@@ -910,13 +908,13 @@ func TestWaitAndMaybeOpenService(t *testing.T) {
api: defaultAPI,
expected: []string{},
err: true,
nondefault: true,
nondefault: true,
},
}
defer revertK8sClient(K8s)
for _, test := range tests {
t.Run(test.description, func(t *testing.T) {
if (test.nondefault) {
if test.nondefault {
K8s = &MockClientGetter{
servicesMap: nondefaultserviceNamespaces,
endpointsMap: endpointNamespaces,