Skip to content
Merged
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
11 changes: 0 additions & 11 deletions test/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,12 @@ import (
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1"
fakepipelineclientset "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/fake"
informersv1alpha1 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1alpha1"
"go.uber.org/zap/zaptest/observer"
corev1 "k8s.io/api/core/v1"
coreinformers "k8s.io/client-go/informers/core/v1"
fakekubeclientset "k8s.io/client-go/kubernetes/fake"
"knative.dev/pkg/controller"
)

// GetLogMessages returns a list of all string logs in logs.
func GetLogMessages(logs *observer.ObservedLogs) []string {
messages := []string{}
for _, l := range logs.All() {
messages = append(messages, l.Message)
}
return messages
}

// Data represents the desired state of the system (i.e. existing resources) to seed controllers
// with.
type Data struct {
Expand Down Expand Up @@ -86,7 +76,6 @@ type Informers struct {
// TestAssets holds references to the controller, logs, clients, and informers.
type TestAssets struct {
Controller *controller.Impl
Logs *observer.ObservedLogs
Copy link
Member

Choose a reason for hiding this comment

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

This is strange - I remember using Logs to debug a test in the past, before the controller refactor.
I might be nice to have GetLogMessages populate the Logs field here, which would give tests access to logs and would enable testing on seeing a certain log message.

But I agree since it's not used now we can remove it and add it back if needed in future.

Clients Clients
}

Expand Down