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

Moved new trigger filters tests to rekt from experimental #7243

Merged
merged 7 commits into from
Sep 25, 2023
Merged
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
4 changes: 2 additions & 2 deletions config/core/configmaps/features.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ data:
# For more details: https://github.com/knative/eventing/issues/5593
kreference-mapping: "disabled"

# ALPHA feature: The new-trigger-filters flag allows you to use the new `filters` field
# BETA feature: The new-trigger-filters flag allows you to use the new `filters` field
# in Trigger objects with its rich filtering capabilities.
# For more details: https://github.com/knative/eventing/issues/5204
new-trigger-filters: "disabled"
new-trigger-filters: "enabled"

# ALPHA feature: The transport-encryption flag allows you to encrypt events in transit using the transport layer security (TLS) protocol.
# For more details: https://github.com/knative/eventing/issues/5957
Expand Down
3 changes: 2 additions & 1 deletion test/experimental/eventtype_autocreate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"testing"

"knative.dev/eventing/test/experimental/features/eventtype_autocreate"
"knative.dev/eventing/test/rekt/resources/broker"

"knative.dev/pkg/system"
"knative.dev/reconciler-test/pkg/environment"
Expand Down Expand Up @@ -54,7 +55,7 @@ func TestBrokerEventTypeAutoCreate(t *testing.T) {
)
brokerName := feature.MakeRandomK8sName("broker")

env.Prerequisite(ctx, t, InstallMTBroker(brokerName))
env.Prerequisite(ctx, t, broker.InstallMTBroker(brokerName))
env.Test(ctx, t, eventtype_autocreate.AutoCreateEventTypesOnBroker(brokerName))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,18 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package experimental
package rekt

import (
"fmt"
"testing"

newfilters "knative.dev/eventing/test/rekt/features/new_trigger_filters"

"knative.dev/pkg/system"
"knative.dev/reconciler-test/pkg/environment"
"knative.dev/reconciler-test/pkg/feature"
"knative.dev/reconciler-test/pkg/k8s"
"knative.dev/reconciler-test/pkg/knative"

newfilters "knative.dev/eventing/test/experimental/features/new_trigger_filters"
"knative.dev/eventing/test/rekt/resources/broker"
)

Expand All @@ -45,7 +44,7 @@ func TestMTChannelBrokerNewTriggerFilters(t *testing.T) {
)
brokerName := "default"

env.Prerequisite(ctx, t, InstallMTBroker(brokerName))
env.Prerequisite(ctx, t, broker.InstallMTBroker(brokerName))
env.TestSet(ctx, t, newfilters.FiltersFeatureSet(brokerName))
}

Expand All @@ -61,7 +60,7 @@ func TestMTChannelBrokerAnyTriggerFilters(t *testing.T) {
)
brokerName := "default"

env.Prerequisite(ctx, t, InstallMTBroker(brokerName))
env.Prerequisite(ctx, t, broker.InstallMTBroker(brokerName))
env.Test(ctx, t, newfilters.AnyFilterFeature(brokerName))
}

Expand All @@ -77,13 +76,6 @@ func TestMTChannelBrokerAllTriggerFilters(t *testing.T) {
)
brokerName := "default"

env.Prerequisite(ctx, t, InstallMTBroker(brokerName))
env.Prerequisite(ctx, t, broker.InstallMTBroker(brokerName))
env.Test(ctx, t, newfilters.AllFilterFeature(brokerName))
}

func InstallMTBroker(name string) *feature.Feature {
f := feature.NewFeatureNamed("Multi-tenant channel-based broker")
f.Setup(fmt.Sprintf("Install broker %q", name), broker.Install(name, broker.WithEnvConfig()...))
f.Requirement("Broker is ready", broker.IsReady(name))
return f
}
8 changes: 8 additions & 0 deletions test/rekt/resources/broker/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package broker
import (
"context"
"embed"
"fmt"
"log"
"os"
"time"
Expand Down Expand Up @@ -279,3 +280,10 @@ func AsKReference(name string) *duckv1.KReference {
APIVersion: "eventing.knative.dev/v1",
}
}

func InstallMTBroker(name string) *feature.Feature {
f := feature.NewFeatureNamed("Multi-tenant channel-based broker")
f.Setup(fmt.Sprintf("Install broker %q", name), Install(name, WithEnvConfig()...))
f.Requirement("Broker is ready", IsReady(name))
return f
}
Loading