Skip to content

Commit

Permalink
Fix integration test operator informer by returning empty resiliency
Browse files Browse the repository at this point in the history
list

Signed-off-by: joshvanl <me@joshvanl.dev>
  • Loading branch information
JoshVanL committed Jan 10, 2024
1 parent 978df1b commit a2a051b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
compapi "github.com/dapr/dapr/pkg/apis/components/v1alpha1"
configapi "github.com/dapr/dapr/pkg/apis/configuration/v1alpha1"
httpendapi "github.com/dapr/dapr/pkg/apis/httpEndpoint/v1alpha1"
resiliencyapi "github.com/dapr/dapr/pkg/apis/resiliency/v1alpha1"
)

// Informer is a fake informer that adds events to the Kubernetes API server to
Expand Down Expand Up @@ -129,6 +130,8 @@ func (i *Informer) objToGVK(t *testing.T, obj runtime.Object) schema.GroupVersio
return schema.GroupVersionKind{Group: "dapr.io", Version: "v1alpha1", Kind: "configurations"}
case *httpendapi.HTTPEndpoint:
return schema.GroupVersionKind{Group: "dapr.io", Version: "v1alpha1", Kind: "httpendpoints"}
case *resiliencyapi.Resiliency:
return schema.GroupVersionKind{Group: "dapr.io", Version: "v1alpha1", Kind: "resiliencies"}
case *corev1.Pod:
return schema.GroupVersionKind{Group: "", Version: "v1", Kind: "pods"}
case *corev1.Service:
Expand Down
1 change: 1 addition & 0 deletions tests/integration/framework/process/kubernetes/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ func WithBaseOperatorAPI(t *testing.T, td spiffeid.TrustDomain, ns string, sentr
WithClusterDeploymentList(t, &appsv1.DeploymentList{TypeMeta: metav1.TypeMeta{APIVersion: "apps/v1", Kind: "DeploymentList"}}),
WithClusterDaprComponentList(t, &compapi.ComponentList{TypeMeta: metav1.TypeMeta{APIVersion: "dapr.io/v1alpha1", Kind: "ComponentList"}}),
WithClusterDaprHTTPEndpointList(t, &httpendapi.HTTPEndpointList{TypeMeta: metav1.TypeMeta{APIVersion: "dapr.io/v1alpha1", Kind: "HTTPEndpointList"}}),
WithClusterDaprResiliencyList(t, &resapi.ResiliencyList{TypeMeta: metav1.TypeMeta{APIVersion: "dapr.io/v1alpha1", Kind: "ResiliencyList"}}),
} {
op(o)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ func (i *informer) Run(t *testing.T, ctx context.Context) {

t.Run("adding a component should become available", func(t *testing.T) {
comp := compapi.Component{
TypeMeta: metav1.TypeMeta{APIVersion: "dapr.io/v1alpha1", Kind: "Component"},
ObjectMeta: metav1.ObjectMeta{Name: "123", Namespace: "default"},
Spec: compapi.ComponentSpec{
Type: "state.in-memory",
Expand Down

0 comments on commit a2a051b

Please sign in to comment.