Skip to content
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
12 changes: 11 additions & 1 deletion test/conformance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,20 @@ Run test with e2e tag and optionally select conformance test
> NOTE: Make sure you have built the
> [test images](https://github.com/knative/eventing/tree/master/test#building-the-test-images)!

```go
```shell
go test -v -tags=e2e -count=1 ./test/conformance/...

go test -v -timeout 30s -tags e2e knative.dev/eventing/test/conformance -run ^TestMustPassTracingHeaders$

go test -v -timeout 30s -tags e2e knative.dev/eventing/test/conformance -run ^TestMustPassTracingHeaders$ --kubeconfig $KUBECONFIG
```

## Running Broker conformance tests against an existing broker

When developing a new broker, or testings against a preexisting broker setup you
can specify:

```shell
go test -v -tags e2e knative.dev/eventing/test/conformance -brokername=foo -brokernamespace=bar -run TestBrokerV1Beta1DataPlaneIngress

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: empty line

```
4 changes: 2 additions & 2 deletions test/conformance/broker_data_plane_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ import (
)

func TestBrokerV1Beta1DataPlaneIngress(t *testing.T) {
client := testlib.Setup(t, true, testlib.SetupClientOptionNoop)
client := testlib.Setup(t, true, helpers.BrokerDataPlaneNamespaceSetupOption(brokerNamespace))
defer testlib.TearDown(client)

broker := helpers.BrokerDataPlaneSetupHelper(client, brokerName, brokerNamespace, brokerClass)
helpers.BrokerV1Beta1IngressDataPlaneTestHelper(t, client, broker)
}
func TestBrokerV1Beta1DataPlaneConsumer(t *testing.T) {
client := testlib.Setup(t, true, testlib.SetupClientOptionNoop)
client := testlib.Setup(t, true, helpers.BrokerDataPlaneNamespaceSetupOption(brokerNamespace))
defer testlib.TearDown(client)

broker := helpers.BrokerDataPlaneSetupHelper(client, brokerName, brokerNamespace, brokerClass)
Expand Down
9 changes: 9 additions & 0 deletions test/conformance/helpers/broker_data_plane_test_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ func BrokerDataPlaneSetupHelper(client *testlib.Client, brokerName, brokerNamesp
return broker
}

func BrokerDataPlaneNamespaceSetupOption(namespace string) testlib.SetupClientOption {
return func(client *testlib.Client) {
if namespace != "" {
client.Kube.Kube.CoreV1().Namespaces().Delete(client.Namespace, nil)
client.Namespace = namespace
}
}
}

//At ingress
//Supports CE 0.3 or CE 1.0 via HTTP
//Supports structured or Binary mode
Expand Down