Skip to content
This repository has been archived by the owner on Jun 4, 2021. It is now read-only.

Status conformance tests for channels #1154

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
18 changes: 17 additions & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions test/conformance/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Conformance tests
Copy link
Member

Choose a reason for hiding this comment

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

nice! thanks for doing this


Conformance tests verifies kantive eventing implementation for expected behavior
described in
[specification](https://github.com/knative/eventing/tree/master/docs/spec).

## Running conformance tests

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)!

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

go test -v -timeout 30s -tags e2e knative.dev/eventing/test/conformance -run ^TestChannelStatus$ -channels=messaging.knative.dev/v1alpha1:NatssChannel,messaging.knative.dev/v1alpha1:KafkaChannel
pierDipi marked this conversation as resolved.
Show resolved Hide resolved
```
30 changes: 30 additions & 0 deletions test/conformance/channel_status_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//+build e2e

/*
Copyright 2020 The Knative Authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package conformance

import (
"testing"

eventingconformancehelpers "knative.dev/eventing/test/conformance/helpers"
"knative.dev/eventing/test/lib"
)

func TestChannelStatus(t *testing.T) {
eventingconformancehelpers.ChannelStatusTestHelperWithChannelTestRunner(t, channelTestRunner, lib.SetupClientOptionNoop)
}
47 changes: 47 additions & 0 deletions test/conformance/main_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
Copyright 2020 The Knative Authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package conformance

import (
"log"
"os"
"testing"

"knative.dev/eventing-contrib/test"
eventingTest "knative.dev/eventing/test"
"knative.dev/eventing/test/lib"
"knative.dev/pkg/test/zipkin"
)

var channelTestRunner lib.ChannelTestRunner

func TestMain(m *testing.M) {
os.Exit(func() int {
eventingTest.InitializeEventingFlags()
channelTestRunner = lib.ChannelTestRunner{
ChannelFeatureMap: test.ChannelFeatureMap,
ChannelsToTest: eventingTest.EventingFlags.Channels,
}

// Any tests may SetupZipkinTracing, it will only actually be done once. This should be the ONLY
// place that cleans it up. If an individual test calls this instead, then it will break other
// tests that need the tracing in place.
defer zipkin.CleanupZipkinTracingSetup(log.Printf)

return m.Run()
}())
}
2 changes: 2 additions & 0 deletions test/e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ initialize $@ --skip-istio-addon
# https://github.com/knative/eventing-contrib/issues/917
go_test_e2e -timeout=20m -parallel=1 ./test/e2e -channels=messaging.knative.dev/v1alpha1:NatssChannel,messaging.knative.dev/v1alpha1:KafkaChannel || fail_test

go_test_e2e -timeout=5m -parallel=2 ./test/conformance -channels=messaging.knative.dev/v1alpha1:NatssChannel,messaging.knative.dev/v1alpha1:KafkaChannel || fail_test

# If you wish to use this script just as test setup, *without* teardown, just uncomment this line and comment all go_test_e2e commands
# trap - SIGINT SIGQUIT SIGTSTP EXIT

Expand Down
201 changes: 201 additions & 0 deletions vendor/go.opentelemetry.io/otel/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions vendor/go.opentelemetry.io/otel/api/core/doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading