Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
m00g3n committed Aug 12, 2024
1 parent 3f1bae4 commit 19d451a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
13 changes: 12 additions & 1 deletion internal/controller/runtime/fsm/runtime_fsm_apply_crb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ var _ = Describe(`runtime_fsm_apply_crb`, Label("applyCRB"), func() {
// initialize test data if required
Expect(tc.init()).ShouldNot(HaveOccurred())

//TODO change timeout
ctx, cancel := context.WithTimeout(context.Background(), time.Second*10000)
defer cancel()

Expand Down Expand Up @@ -175,6 +176,7 @@ var _ = Describe(`runtime_fsm_apply_crb`, Label("applyCRB"), func() {
}),

Entry("error getting client", tcApplySfn{
instance: testRuntime,
expected: tcSfnExpected{
err: testErr,
},
Expand All @@ -184,7 +186,16 @@ var _ = Describe(`runtime_fsm_apply_crb`, Label("applyCRB"), func() {
withFn(sFnApplyClusterRoleBindings),
withFakeEventRecorder(1),
),
setup: defaultSetup,
setup: func(f *fsm) error {
GetShootClient = func(
_ context.Context,
_ client.SubResourceClient,
_ *gardener_api.Shoot) (client.Client, error) {
return nil, testErr
}
return nil

},
}),
)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package fsm
import (
"context"
"fmt"
"k8s.io/utils/ptr"
"time"

"k8s.io/utils/ptr"

gardener "github.com/gardener/gardener/pkg/apis/core/v1beta1"
imv1 "github.com/kyma-project/infrastructure-manager/api/v1"
. "github.com/onsi/ginkgo/v2" //nolint:revive
Expand Down Expand Up @@ -99,7 +100,7 @@ var _ = Describe("KIM sFnCreateKubeconfig", func() {
&systemState{instance: *inputRtWithLabelsAndCondition, shoot: &testShoot},
testOpts{
MatchExpectedErr: BeNil(),
MatchNextFnState: haveName("sFnProcessShoot"),
MatchNextFnState: haveName("sFnApplyClusterRoleBindings"),
},
),
Entry(
Expand Down

0 comments on commit 19d451a

Please sign in to comment.