Skip to content

Commit

Permalink
add tests for deploy structured
Browse files Browse the repository at this point in the history
  • Loading branch information
Yonah Dissen committed Sep 19, 2023
1 parent 42cc011 commit ec470f6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/kor/configmaps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ func createTestConfigmaps(t *testing.T) *fake.Clientset {
ObjectMeta: metav1.ObjectMeta{Name: testNamespace},
}, metav1.CreateOptions{})

if err != nil {
t.Fatalf("Error creating namespace %s: %v", testNamespace, err)
}

configmap1 := CreateTestConfigmap(testNamespace, "configmap-1")
configmap2 := CreateTestConfigmap(testNamespace, "configmap-2")
configmap3 := CreateTestConfigmap(testNamespace, "configmap-3")
Expand Down
4 changes: 4 additions & 0 deletions pkg/kor/deployments_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ func createTestDeployments(t *testing.T) *fake.Clientset {
ObjectMeta: v1.ObjectMeta{Name: testNamespace},
}, v1.CreateOptions{})

if err != nil {
t.Fatalf("Error creating namespace %s: %v", testNamespace, err)
}

appLabels := map[string]string{}

deployment1 := CreateTestDeployment(testNamespace, "test-deployment1", 0, appLabels)
Expand Down
4 changes: 4 additions & 0 deletions pkg/kor/services_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ func createTestServices(t *testing.T) *fake.Clientset {
ObjectMeta: v1.ObjectMeta{Name: testNamespace},
}, v1.CreateOptions{})

if err != nil {
t.Fatalf("Error creating namespace %s: %v", testNamespace, err)
}

endpoint1 := CreateTestEndpoint(testNamespace, "test-endpoint1", 0)
endpoint2 := CreateTestEndpoint(testNamespace, "test-endpoint2", 1)
_, err = clientset.CoreV1().Endpoints(testNamespace).Create(context.TODO(), endpoint1, v1.CreateOptions{})
Expand Down
4 changes: 4 additions & 0 deletions pkg/kor/statefulsets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ func createTestStatefulSets(t *testing.T) *fake.Clientset {
ObjectMeta: v1.ObjectMeta{Name: testNamespace},
}, v1.CreateOptions{})

if err != nil {
t.Fatalf("Error creating namespace %s: %v", testNamespace, err)
}

appLabels := map[string]string{}

sts1 := CreateTestStatefulSet(testNamespace, "test-sts1", 0, appLabels)
Expand Down

0 comments on commit ec470f6

Please sign in to comment.