mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-11 06:02:18 +00:00
Fixup unit tests
This commit is contained in:
@@ -32,7 +32,7 @@ func TestServices(t *testing.T) {
|
||||
fakeWatch := watch.NewFake()
|
||||
fakeClient := &client.Fake{Watch: fakeWatch}
|
||||
services := make(chan ServiceUpdate)
|
||||
source := SourceAPI{client: fakeClient, services: services}
|
||||
source := SourceAPI{servicesWatcher: fakeClient.Services(api.NamespaceAll), endpointsWatcher: fakeClient.Endpoints(api.NamespaceAll), services: services}
|
||||
resourceVersion := "1"
|
||||
go func() {
|
||||
// called twice
|
||||
@@ -84,7 +84,7 @@ func TestServicesFromZero(t *testing.T) {
|
||||
},
|
||||
}
|
||||
services := make(chan ServiceUpdate)
|
||||
source := SourceAPI{client: fakeClient, services: services}
|
||||
source := SourceAPI{servicesWatcher: fakeClient.Services(api.NamespaceAll), endpointsWatcher: fakeClient.Endpoints(api.NamespaceAll), services: services}
|
||||
resourceVersion := ""
|
||||
ch := make(chan struct{})
|
||||
go func() {
|
||||
@@ -112,7 +112,7 @@ func TestServicesFromZero(t *testing.T) {
|
||||
func TestServicesError(t *testing.T) {
|
||||
fakeClient := &client.Fake{Err: errors.New("test")}
|
||||
services := make(chan ServiceUpdate)
|
||||
source := SourceAPI{client: fakeClient, services: services}
|
||||
source := SourceAPI{servicesWatcher: fakeClient.Services(api.NamespaceAll), endpointsWatcher: fakeClient.Endpoints(api.NamespaceAll), services: services}
|
||||
resourceVersion := "1"
|
||||
ch := make(chan struct{})
|
||||
go func() {
|
||||
@@ -133,7 +133,7 @@ func TestServicesError(t *testing.T) {
|
||||
func TestServicesFromZeroError(t *testing.T) {
|
||||
fakeClient := &client.Fake{Err: errors.New("test")}
|
||||
services := make(chan ServiceUpdate)
|
||||
source := SourceAPI{client: fakeClient, services: services}
|
||||
source := SourceAPI{servicesWatcher: fakeClient.Services(api.NamespaceAll), endpointsWatcher: fakeClient.Endpoints(api.NamespaceAll), services: services}
|
||||
resourceVersion := ""
|
||||
ch := make(chan struct{})
|
||||
go func() {
|
||||
@@ -157,7 +157,7 @@ func TestEndpoints(t *testing.T) {
|
||||
fakeWatch := watch.NewFake()
|
||||
fakeClient := &client.Fake{Watch: fakeWatch}
|
||||
endpoints := make(chan EndpointsUpdate)
|
||||
source := SourceAPI{client: fakeClient, endpoints: endpoints}
|
||||
source := SourceAPI{servicesWatcher: fakeClient.Services(api.NamespaceAll), endpointsWatcher: fakeClient.Endpoints(api.NamespaceAll), endpoints: endpoints}
|
||||
resourceVersion := "1"
|
||||
go func() {
|
||||
// called twice
|
||||
@@ -209,7 +209,7 @@ func TestEndpointsFromZero(t *testing.T) {
|
||||
},
|
||||
}
|
||||
endpoints := make(chan EndpointsUpdate)
|
||||
source := SourceAPI{client: fakeClient, endpoints: endpoints}
|
||||
source := SourceAPI{servicesWatcher: fakeClient.Services(api.NamespaceAll), endpointsWatcher: fakeClient.Endpoints(api.NamespaceAll), endpoints: endpoints}
|
||||
resourceVersion := ""
|
||||
ch := make(chan struct{})
|
||||
go func() {
|
||||
@@ -237,7 +237,7 @@ func TestEndpointsFromZero(t *testing.T) {
|
||||
func TestEndpointsError(t *testing.T) {
|
||||
fakeClient := &client.Fake{Err: errors.New("test")}
|
||||
endpoints := make(chan EndpointsUpdate)
|
||||
source := SourceAPI{client: fakeClient, endpoints: endpoints}
|
||||
source := SourceAPI{servicesWatcher: fakeClient.Services(api.NamespaceAll), endpointsWatcher: fakeClient.Endpoints(api.NamespaceAll), endpoints: endpoints}
|
||||
resourceVersion := "1"
|
||||
ch := make(chan struct{})
|
||||
go func() {
|
||||
@@ -258,7 +258,7 @@ func TestEndpointsError(t *testing.T) {
|
||||
func TestEndpointsFromZeroError(t *testing.T) {
|
||||
fakeClient := &client.Fake{Err: errors.New("test")}
|
||||
endpoints := make(chan EndpointsUpdate)
|
||||
source := SourceAPI{client: fakeClient, endpoints: endpoints}
|
||||
source := SourceAPI{servicesWatcher: fakeClient.Services(api.NamespaceAll), endpointsWatcher: fakeClient.Endpoints(api.NamespaceAll), endpoints: endpoints}
|
||||
resourceVersion := ""
|
||||
ch := make(chan struct{})
|
||||
go func() {
|
||||
|
Reference in New Issue
Block a user