-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
29 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,8 +74,8 @@ var _ = Describe("Resources", func() { | |
}, | ||
}, | ||
} | ||
//ppackage *v1alphav1.PulsarPackage | ||
//ppackageurl string = "source://public/default/test-source@latest" | ||
ppackage *v1alphav1.PulsarPackage | ||
ppackageurl string = "function://public/default/[email protected]" | ||
pfuncName string = "test-func" | ||
pfunc *v1alphav1.PulsarFunction | ||
psinkpackageurl string = "builtin://data-generator" | ||
|
@@ -102,8 +102,8 @@ var _ = Describe("Resources", func() { | |
roles := []string{"ironman"} | ||
actions := []string{"produce", "consume", "functions"} | ||
ppermission = utils.MakePulsarPermission(namespaceName, ppermissionName, topicName, pconnName, v1alphav1.PulsarResourceTypeTopic, roles, actions, v1alphav1.CleanUpAfterDeletion) | ||
//ppackage = utils.MakePulsarPackage(namespaceName, pfuncName, ppackageurl, pconnName, lifecyclePolicy) | ||
pfunc = utils.MakePulsarFunction(namespaceName, pfuncName, "function://public/default/api-examples@latest", pconnName, lifecyclePolicy) | ||
ppackage = utils.MakePulsarPackage(namespaceName, pfuncName, ppackageurl, pconnName, lifecyclePolicy) | ||
pfunc = utils.MakePulsarFunction(namespaceName, pfuncName, ppackageurl, pconnName, lifecyclePolicy) | ||
psink = utils.MakePulsarSink(namespaceName, pfuncName, psinkpackageurl, pconnName, lifecyclePolicy) | ||
psource = utils.MakePulsarSource(namespaceName, pfuncName, psourcepackageurl, pconnName, lifecyclePolicy) | ||
}) | ||
|
@@ -292,33 +292,33 @@ var _ = Describe("Resources", func() { | |
}) | ||
|
||
Context("PulsarFunction & PulsarPackage operation", func() { | ||
//It("should create the pulsarpackage successfully", func() { | ||
// err := k8sClient.Create(ctx, ppackage) | ||
// Expect(err == nil || apierrors.IsAlreadyExists(err)).Should(BeTrue()) | ||
//}) | ||
// | ||
//It("the package should be ready", func() { | ||
// Eventually(func() bool { | ||
// p := &v1alphav1.PulsarPackage{} | ||
// tns := types.NamespacedName{Namespace: namespaceName, Name: pfuncName} | ||
// Expect(k8sClient.Get(ctx, tns, p)).Should(Succeed()) | ||
// return v1alphav1.IsPulsarResourceReady(p) | ||
// }, "20s", "100ms").Should(BeTrue()) | ||
//}) | ||
It("should create the pulsarpackage successfully", func() { | ||
err := k8sClient.Create(ctx, ppackage) | ||
Expect(err == nil || apierrors.IsAlreadyExists(err)).Should(BeTrue()) | ||
}) | ||
|
||
It("the package should be ready", func() { | ||
Eventually(func() bool { | ||
p := &v1alphav1.PulsarPackage{} | ||
tns := types.NamespacedName{Namespace: namespaceName, Name: pfuncName} | ||
Expect(k8sClient.Get(ctx, tns, p)).Should(Succeed()) | ||
return v1alphav1.IsPulsarResourceReady(p) | ||
}, "40s", "100ms").Should(BeTrue()) | ||
}) | ||
|
||
It("should create the pulsarfunction successfully", func() { | ||
err := k8sClient.Create(ctx, pfunc) | ||
Expect(err == nil || apierrors.IsAlreadyExists(err)).Should(BeTrue()) | ||
}) | ||
|
||
//It("the function should be ready", func() { | ||
// Eventually(func() bool { | ||
// f := &v1alphav1.PulsarFunction{} | ||
// tns := types.NamespacedName{Namespace: namespaceName, Name: pfuncName} | ||
// Expect(k8sClient.Get(ctx, tns, f)).Should(Succeed()) | ||
// return v1alphav1.IsPulsarResourceReady(f) | ||
// }, "20s", "100ms").Should(BeTrue()) | ||
//}) | ||
It("the function should be ready", func() { | ||
Eventually(func() bool { | ||
f := &v1alphav1.PulsarFunction{} | ||
tns := types.NamespacedName{Namespace: namespaceName, Name: pfuncName} | ||
Expect(k8sClient.Get(ctx, tns, f)).Should(Succeed()) | ||
return v1alphav1.IsPulsarResourceReady(f) | ||
}, "40s", "100ms").Should(BeTrue()) | ||
}) | ||
}) | ||
|
||
Context("PulsarSink operation", func() { | ||
|
@@ -333,7 +333,7 @@ var _ = Describe("Resources", func() { | |
tns := types.NamespacedName{Namespace: namespaceName, Name: pfuncName} | ||
Expect(k8sClient.Get(ctx, tns, s)).Should(Succeed()) | ||
return v1alphav1.IsPulsarResourceReady(s) | ||
}, "20s", "100ms").Should(BeTrue()) | ||
}, "40s", "100ms").Should(BeTrue()) | ||
}) | ||
}) | ||
|
||
|
@@ -349,7 +349,7 @@ var _ = Describe("Resources", func() { | |
tns := types.NamespacedName{Namespace: namespaceName, Name: pfuncName} | ||
Expect(k8sClient.Get(ctx, tns, s)).Should(Succeed()) | ||
return v1alphav1.IsPulsarResourceReady(s) | ||
}, "20s", "100ms").Should(BeTrue()) | ||
}, "40s", "100ms").Should(BeTrue()) | ||
}) | ||
}) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters