Skip to content

Commit 9c751ad

Browse files
committed
Adapt e2e tests
1 parent 67f39a5 commit 9c751ad

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

test/e2e/e2e_suite_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
package e2e
1818

1919
import (
20+
"context"
2021
"testing"
2122
"time"
2223

@@ -64,5 +65,8 @@ var _ = BeforeSuite(func() {
6465
testClient, err = client.New(restConfig, client.Options{Scheme: scheme})
6566
Expect(err).NotTo(HaveOccurred())
6667

68+
clientContext, clientCancel := context.WithCancel(context.Background())
6769
komega.SetClient(testClient)
70+
komega.SetContext(clientContext)
71+
DeferCleanup(clientCancel)
6872
})

test/e2e/example_test.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,18 @@ import (
3232
. "github.com/timebertt/kubernetes-controller-sharding/pkg/utils/test/matchers"
3333
)
3434

35-
var _ = Describe("Example Shard", Label("example"), Ordered, func() {
36-
const controllerRingName = "example"
35+
var _ = Describe("Example Controller", Label("checksum-controller"), Ordered, func() {
36+
const controllerRingName = "checksum-controller"
3737

38-
var (
39-
controllerRing *shardingv1alpha1.ControllerRing
40-
)
38+
var controllerRing *shardingv1alpha1.ControllerRing
4139

4240
BeforeAll(func() {
4341
controllerRing = &shardingv1alpha1.ControllerRing{ObjectMeta: metav1.ObjectMeta{Name: controllerRingName}}
4442
})
4543

4644
Describe("setup", func() {
4745
It("the Deployment should be healthy", func(ctx SpecContext) {
48-
deployment := &appsv1.Deployment{ObjectMeta: metav1.ObjectMeta{Name: "shard", Namespace: metav1.NamespaceDefault}}
46+
deployment := &appsv1.Deployment{ObjectMeta: metav1.ObjectMeta{Name: controllerRingName, Namespace: metav1.NamespaceDefault}}
4947

5048
Eventually(ctx, func(g Gomega) {
5149
g.Expect(Get(deployment)()).To(Succeed())

0 commit comments

Comments
 (0)