Skip to content

Commit

Permalink
Fix namespacing in workflowbackend integration test
Browse files Browse the repository at this point in the history
Signed-off-by: joshvanl <me@joshvanl.dev>
  • Loading branch information
JoshVanL committed Jan 29, 2024
1 parent 6bc848d commit ba58da7
Showing 1 changed file with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (w *workflowbackend) Setup(t *testing.T) []framework.Option {

inmemStore := compapi.Component{
TypeMeta: metav1.TypeMeta{Kind: "Component", APIVersion: "dapr.io/v1alpha1"},
ObjectMeta: metav1.ObjectMeta{Name: "mystore"},
ObjectMeta: metav1.ObjectMeta{Name: "mystore", Namespace: "default"},
Spec: compapi.ComponentSpec{
Type: "state.in-memory", Version: "v1",
Metadata: []common.NameValuePair{{Name: "actorStateStore", Value: common.DynamicValue{JSON: apiextv1.JSON{Raw: []byte(`"true"`)}}}},
Expand All @@ -110,20 +110,22 @@ func (w *workflowbackend) Setup(t *testing.T) []framework.Option {
w.operatorCreate.SetComponents(inmemStore)
w.operatorUpdate.SetComponents(inmemStore, compapi.Component{
TypeMeta: metav1.TypeMeta{Kind: "Component", APIVersion: "dapr.io/v1alpha1"},
ObjectMeta: metav1.ObjectMeta{Name: "wfbackend"},
ObjectMeta: metav1.ObjectMeta{Name: "wfbackend", Namespace: "default"},
Spec: compapi.ComponentSpec{Type: "workflowbackend.actors", Version: "v1"},
})
w.operatorDelete.SetComponents(inmemStore, compapi.Component{
TypeMeta: metav1.TypeMeta{Kind: "Component", APIVersion: "dapr.io/v1alpha1"},
ObjectMeta: metav1.ObjectMeta{Name: "wfbackend"},
ObjectMeta: metav1.ObjectMeta{Name: "wfbackend", Namespace: "default"},
Spec: compapi.ComponentSpec{Type: "workflowbackend.actors", Version: "v1"},
})

w.daprdCreate = daprd.New(t,
daprd.WithMode("kubernetes"),
daprd.WithConfigs("hotreloading"),
daprd.WithExecOptions(
exec.WithEnvVars("DAPR_TRUST_ANCHORS", string(sentry.CABundle().TrustAnchors)),
exec.WithEnvVars(t,
"DAPR_TRUST_ANCHORS", string(sentry.CABundle().TrustAnchors),
),
exec.WithExitCode(1),
exec.WithRunError(func(t *testing.T, err error) {
require.ErrorContains(t, err, "exit status 1")
Expand All @@ -138,7 +140,9 @@ func (w *workflowbackend) Setup(t *testing.T) []framework.Option {
daprd.WithMode("kubernetes"),
daprd.WithConfigs("hotreloading"),
daprd.WithExecOptions(
exec.WithEnvVars("DAPR_TRUST_ANCHORS", string(sentry.CABundle().TrustAnchors)),
exec.WithEnvVars(t,
"DAPR_TRUST_ANCHORS", string(sentry.CABundle().TrustAnchors),
),
exec.WithExitCode(1),
exec.WithRunError(func(t *testing.T, err error) {
require.ErrorContains(t, err, "exit status 1")
Expand All @@ -153,7 +157,9 @@ func (w *workflowbackend) Setup(t *testing.T) []framework.Option {
daprd.WithMode("kubernetes"),
daprd.WithConfigs("hotreloading"),
daprd.WithExecOptions(
exec.WithEnvVars("DAPR_TRUST_ANCHORS", string(sentry.CABundle().TrustAnchors)),
exec.WithEnvVars(t,
"DAPR_TRUST_ANCHORS", string(sentry.CABundle().TrustAnchors),
),
exec.WithExitCode(1),
exec.WithRunError(func(t *testing.T, err error) {
require.ErrorContains(t, err, "exit status 1")
Expand Down Expand Up @@ -190,7 +196,7 @@ func (w *workflowbackend) Run(t *testing.T, ctx context.Context) {
}, comps)
actorsComp := compapi.Component{
TypeMeta: metav1.TypeMeta{Kind: "Component", APIVersion: "dapr.io/v1alpha1"},
ObjectMeta: metav1.ObjectMeta{Name: "wfbackend"},
ObjectMeta: metav1.ObjectMeta{Name: "wfbackend", Namespace: "default"},
Spec: compapi.ComponentSpec{Type: "workflowbackend.actors", Version: "v1"},
}
w.operatorCreate.AddComponents(actorsComp)
Expand All @@ -207,7 +213,7 @@ func (w *workflowbackend) Run(t *testing.T, ctx context.Context) {
}, comps)
sqliteComp := compapi.Component{
TypeMeta: metav1.TypeMeta{Kind: "Component", APIVersion: "dapr.io/v1alpha1"},
ObjectMeta: metav1.ObjectMeta{Name: "wfbackend"},
ObjectMeta: metav1.ObjectMeta{Name: "wfbackend", Namespace: "default"},
Spec: compapi.ComponentSpec{Type: "workflowbackend.sqlite", Version: "v1"},
}
w.operatorUpdate.SetComponents(sqliteComp)
Expand Down

0 comments on commit ba58da7

Please sign in to comment.