-
Notifications
You must be signed in to change notification settings - Fork 748
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit test cases for exotic jetstream eventbus
- add test to update native nats to exotic js - add test when url is missing for exotic js - add test when exotic js has correct properties - add test for exotic js install/uninstall Signed-off-by: gokulav137 <[email protected]>
- Loading branch information
1 parent
cfdf53d
commit 00f863a
Showing
6 changed files
with
111 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package installer | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
|
||
"github.com/argoproj/argo-events/common/logging" | ||
"github.com/argoproj/argo-events/pkg/apis/eventbus/v1alpha1" | ||
) | ||
|
||
var ( | ||
testJSExoticURL = "nats://nats:4222" | ||
|
||
testJSExoticBus = &v1alpha1.EventBus{ | ||
TypeMeta: metav1.TypeMeta{ | ||
APIVersion: v1alpha1.SchemeGroupVersion.String(), | ||
Kind: "EventBus", | ||
}, | ||
ObjectMeta: metav1.ObjectMeta{ | ||
Namespace: testNamespace, | ||
Name: testExoticName, | ||
}, | ||
Spec: v1alpha1.EventBusSpec{ | ||
JetStreamExotic: &v1alpha1.JetStreamConfig{ | ||
URL: testJSExoticURL, | ||
}, | ||
}, | ||
} | ||
) | ||
|
||
func TestInstallationJSExotic(t *testing.T) { | ||
t.Run("installation with exotic jetstream config", func(t *testing.T) { | ||
installer := NewExoticJetStreamInstaller(testJSExoticBus, logging.NewArgoEventsLogger()) | ||
conf, err := installer.Install(context.TODO()) | ||
assert.NoError(t, err) | ||
assert.NotNil(t, conf.JetStream) | ||
assert.Equal(t, conf.JetStream.URL, testJSExoticURL) | ||
}) | ||
} | ||
|
||
func TestUninstallationJSExotic(t *testing.T) { | ||
t.Run("uninstallation with exotic jetstream config", func(t *testing.T) { | ||
installer := NewExoticJetStreamInstaller(testJSExoticBus, logging.NewArgoEventsLogger()) | ||
err := installer.Uninstall(context.TODO()) | ||
assert.NoError(t, err) | ||
}) | ||
} |
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
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
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
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