Skip to content

Commit

Permalink
Fix function calls in unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Stu Gott <[email protected]>
  • Loading branch information
stu-gott committed Feb 25, 2020
1 parent 5d9a2f0 commit 95f4705
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions pkg/virt-controller/services/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import (
const namespaceKubevirt = "kubevirt"

var _ = Describe("Template", func() {
var qemuGid int64 = 107

log.Log.SetIOWriter(GinkgoWriter)

Expand Down Expand Up @@ -77,6 +78,7 @@ var _ = Describe("Template", func() {
pvcCache,
virtClient,
config,
qemuGid,
)

// Set up mock clients
Expand Down
3 changes: 2 additions & 1 deletion pkg/virt-controller/watch/migration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ var _ = Describe("Migration watcher", func() {
var kubeClient *fake.Clientset
var networkClient *fakenetworkclient.Clientset
var pvcInformer cache.SharedIndexInformer
var qemuGid int64 = 107

shouldExpectPodCreation := func(uid types.UID, migrationUid types.UID, expectedAntiAffinityCount int, expectedAffinityCount int, expectedNodeAffinityCount int) {
// Expect pod creation
Expand Down Expand Up @@ -165,7 +166,7 @@ var _ = Describe("Migration watcher", func() {
config, _, _ := testutils.NewFakeClusterConfig(&k8sv1.ConfigMap{})

controller = NewMigrationController(
services.NewTemplateService("a", "b", "c", "d", "e", "f", pvcInformer.GetStore(), virtClient, config),
services.NewTemplateService("a", "b", "c", "d", "e", "f", pvcInformer.GetStore(), virtClient, config, qemuGid),
vmiInformer,
podInformer,
migrationInformer,
Expand Down
6 changes: 4 additions & 2 deletions pkg/virt-controller/watch/vmi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ var _ = Describe("VirtualMachineInstance watcher", func() {
var dataVolumeSource *framework.FakeControllerSource
var dataVolumeInformer cache.SharedIndexInformer
var dataVolumeFeeder *testutils.DataVolumeFeeder
var qemuGid int64 = 107

shouldExpectPodCreation := func(uid types.UID) {
// Expect pod creation
Expand Down Expand Up @@ -165,12 +166,13 @@ var _ = Describe("VirtualMachineInstance watcher", func() {
config, _, _ := testutils.NewFakeClusterConfig(&k8sv1.ConfigMap{})
pvcInformer, _ = testutils.NewFakeInformerFor(&k8sv1.PersistentVolumeClaim{})
controller = NewVMIController(
services.NewTemplateService("a", "b", "c", "d", "e", "f", pvcInformer.GetStore(), virtClient, config),
services.NewTemplateService("a", "b", "c", "d", "e", "f", pvcInformer.GetStore(), virtClient, config, qemuGid),
vmiInformer,
podInformer,
recorder,
virtClient,
dataVolumeInformer)
dataVolumeInformer,
)
// Wrap our workqueue to have a way to detect when we are done processing updates
mockQueue = testutils.NewMockWorkQueue(controller.Queue)
controller.Queue = mockQueue
Expand Down

0 comments on commit 95f4705

Please sign in to comment.