eventing icon indicating copy to clipboard operation
eventing copied to clipboard

Test that trigger is not ready before dependency exists with dependency annotation

Open Cali0707 opened this issue 9 months ago • 7 comments

Problem Currently in the rekt test TestTriggerDependencyAnnotation, we do not verify that the trigger is not ready until the PingSource exists. A simple way to fix this would be to move the trigger.IsReady(...) call from the Setup phase to the Requirement phase, and then add a new step function to the Setup phase which checks that the trigger is not ready with reason DependencyDoesNotExist.

Persona: Which persona is this feature for?

Exit Criteria The rekt test verifies that the trigger is not ready with reason DependencyDoesNotExist before the PingSource is installed.

Time Estimate (optional): How many developer-days do you think this may take to resolve? 1

Additional context (optional)

  • For more info about the rekt tests, see here: https://github.com/knative-extensions/reconciler-test/
  • The test is here: https://github.com/knative/eventing/blob/c104df5f482c62a9dc4e3624b7e2891797f25c84/test/rekt/features/trigger/feature.go#L44

Cali0707 avatar May 06 '24 18:05 Cali0707

/area test-and-release /good-first-issue

Cali0707 avatar May 06 '24 18:05 Cali0707

@Cali0707: This request has been marked as suitable for new contributors.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed by commenting with the /remove-good-first-issue command.

In response to this:

/area test-and-release /good-first-issue

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

knative-prow[bot] avatar May 06 '24 18:05 knative-prow[bot]

/assign

Rahul-Kumar-prog avatar May 06 '24 20:05 Rahul-Kumar-prog

@Cali0707 we have to change all the trigger.IsReady(...) setup phase to requirement phase?

Rahul-Kumar-prog avatar May 09 '24 18:05 Rahul-Kumar-prog

hey @Rahul-Kumar-prog , you only need to move the trigger.IsReady(..) to the requirement phase for the specific test feature that I linked above. All other tests should be left unchanged.

You will also need to add the step function I was mentioning above that verifies that the trigger is not ready with reason DependencyDoesNotExist to the setup phase for the test I linked above

Cali0707 avatar May 09 '24 18:05 Cali0707

@Cali0707 here DependencyDoesNotExist, is it a function or string. because in setup phase it only takes a string and a featur.Stepfn? can you tell me about this?

And when I write trigger.---- there no any dependencydoesnotexist. If so should I handle it with err?

Rahul-Kumar-prog avatar May 11 '24 19:05 Rahul-Kumar-prog

because in setup phase it only takes a string and a featur.Stepfn? can you tell me about this?

I'd recommend reading the documentation in https://github.com/knative-extensions/reconciler-test/ which I linked above, this explains how the e2e tests and phases work

here DependencyDoesNotExist, is it a function or string. You will need to create a function which checks for this status reason (which will be a string). This is where the StepFn comes in

Cali0707 avatar May 13 '24 17:05 Cali0707