eventing
eventing copied to clipboard
Test that trigger is not ready before dependency exists with dependency annotation
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
/area test-and-release /good-first-issue
@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.
/assign
@Cali0707 we have to change all the trigger.IsReady(...) setup phase to requirement phase?
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 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?
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