Skip to content

Commit

Permalink
Merge pull request #303 from rramkumar1/use-mocks
Browse files Browse the repository at this point in the history
Use generated mocks to implement unit tests for pkg/backends
  • Loading branch information
nicksardo authored Jun 5, 2018
2 parents 2a805f5 + 9e85bf9 commit 53de1a9
Show file tree
Hide file tree
Showing 10 changed files with 815 additions and 274 deletions.
3 changes: 2 additions & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions pkg/backends/backends.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (

v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/kubernetes/pkg/cloudprovider/providers/gce"
"k8s.io/kubernetes/pkg/cloudprovider/providers/gce/cloud/meta"

"k8s.io/ingress-gce/pkg/healthchecks"
Expand Down Expand Up @@ -74,7 +75,7 @@ const maxRPS = 1

// Backends implements BackendPool.
type Backends struct {
cloud BackendServices
cloud *gce.GCECloud
negGetter NEGGetter
nodePool instances.NodePool
healthChecker healthchecks.HealthChecker
Expand All @@ -94,7 +95,7 @@ var _ BackendPool = (*Backends)(nil)
// - ignorePorts: is a set of ports to avoid syncing/GCing.
// - resyncWithCloud: if true, periodically syncs with cloud resources.
func NewBackendPool(
cloud BackendServices,
cloud *gce.GCECloud,
negGetter NEGGetter,
healthChecker healthchecks.HealthChecker,
nodePool instances.NodePool,
Expand Down
Loading

0 comments on commit 53de1a9

Please sign in to comment.