Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change trigger requirement phases #7946

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions test/rekt/features/trigger/feature.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ func TriggerDependencyAnnotation() *feature.Feature {
// trigger won't go ready until after the pingsource exists, because of the dependency annotation
f.Requirement("trigger goes ready", trigger.IsReady(triggerName))

f.Setup("Trigger not ready with reason DependencyDoesNotExist", trigger.IsDependencyDoesNotExist(triggerName))

f.Requirement("install pingsource", func(ctx context.Context, t feature.T) {
brokeruri, err := broker.Address(ctx, brokerName)
if err != nil {
Expand Down
5 changes: 5 additions & 0 deletions test/rekt/resources/trigger/trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ func IsReady(name string, timing ...time.Duration) feature.StepFn {
return k8s.IsReady(GVR(), name, timing...)
}

// IsDependencyDoesNotExist tests to see if a Trigger not become ready with Dependency.
func IsDependencyDoesNotExist(name string, timing ...time.Duration) feature.StepFn {
return k8s.IsDependencyDoesNotExist(GVR(), name, timing...)
}

func WithNewFilters(filters []eventingv1.SubscriptionsAPIFilter) manifest.CfgFn {
jsonBytes, err := json.Marshal(filters)
if err != nil {
Expand Down
12 changes: 12 additions & 0 deletions vendor/knative.dev/reconciler-test/pkg/k8s/steps.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*

Check failure on line 1 in vendor/knative.dev/reconciler-test/pkg/k8s/steps.go

View workflow job for this annotation

GitHub Actions / verify / Verify Deps and Codegen

Please run ./hack/update-codegen.sh. diff --git a/vendor/knative.dev/reconciler-test/pkg/k8s/steps.go b/vendor/knative.dev/reconciler-test/pkg/k8s/steps.go index 06f9933..86d27ed 100644 --- a/vendor/knative.dev/reconciler-test/pkg/k8s/steps.go +++ b/vendor/knative.dev/reconciler-test/pkg/k8s/steps.go @@ -61,18 +61,6 @@ func IsNotReady(gvr schema.GroupVersionResource, name string, timing ...time.Dur } } -// IsDependencyDoesNotExist return a reusable feature.StepFn to assert if a dependency in not ready. -// within the time given. Timing is optional but if provided is [interval, timeout]. -func IsDependencyDoesNotExist(gvr schema.GroupVersionResource, name string, timing ...time.Duration) feature.StepFn { - return func(ctx context.Context, t feature.T) { - interval, timeout := PollTimings(ctx, timing) - env := environment.FromContext(ctx) - if err := WaitForResourceNotReady(ctx, t, env.Namespace(), name, gvr, interval, timeout); err != nil { - t.Error(gvr, "DependencyDoesNotExist,", err) - } - } -} - // IsAddressable tests to see if a resource becomes Addressable within the time // given. Timing is optional but if provided is [interval, timeout]. func IsAddressable(gvr schema.GroupVersionResource, name string, timing ...time.Duration) feature.StepFn {
Copyright 2020 The Knative Authors

Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -61,6 +61,18 @@
}
}

// IsDependencyDoesNotExist return a reusable feature.StepFn to assert if a dependency in not ready.
// within the time given. Timing is optional but if provided is [interval, timeout].
func IsDependencyDoesNotExist(gvr schema.GroupVersionResource, name string, timing ...time.Duration) feature.StepFn {
return func(ctx context.Context, t feature.T) {
interval, timeout := PollTimings(ctx, timing)
env := environment.FromContext(ctx)
if err := WaitForResourceNotReady(ctx, t, env.Namespace(), name, gvr, interval, timeout); err != nil {
t.Error(gvr, "DependencyDoesNotExist,", err)
}
}
}

// IsAddressable tests to see if a resource becomes Addressable within the time
// given. Timing is optional but if provided is [interval, timeout].
func IsAddressable(gvr schema.GroupVersionResource, name string, timing ...time.Duration) feature.StepFn {
Expand Down
Loading