Skip to content

Commit

Permalink
testObserverOptions: remove unused pretty field
Browse files Browse the repository at this point in the history
Signed-off-by: Kornilios Kourtis <[email protected]>
  • Loading branch information
kkourt committed Jun 17, 2023
1 parent 6a33cef commit 9baecf3
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions pkg/observer/observer_test_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ var (
)

type testObserverOptions struct {
pretty bool
crd bool
config string
lib string
Expand Down Expand Up @@ -97,12 +96,6 @@ func WithDenyList(denyList *tetragon.Filter) TestOption {
}
}

func withPretty() TestOption {
return func(o *TestOptions) {
o.observer.pretty = true
}
}

func WithConfig(config string) TestOption {
return func(o *TestOptions) {
o.observer.config = config
Expand Down Expand Up @@ -198,7 +191,6 @@ func newDefaultTestOptions(opts ...TestOption) *TestOptions {
// default values
options := &TestOptions{
observer: testObserverOptions{
pretty: false,
crd: false,
config: "",
lib: "",
Expand Down Expand Up @@ -323,15 +315,13 @@ func GetDefaultObserverWithWatchers(t *testing.T, ctx context.Context, base *sen

func GetDefaultObserverWithBase(t *testing.T, ctx context.Context, b *sensors.Sensor, file, lib string, opts ...TestOption) (*Observer, error) {
opts = append(opts, WithConfig(file))
opts = append(opts, withPretty())
opts = append(opts, WithLib(lib))

return GetDefaultObserverWithWatchers(t, ctx, b, opts...)
}

func GetDefaultObserverWithFile(t *testing.T, ctx context.Context, file, lib string, opts ...TestOption) (*Observer, error) {
opts = append(opts, WithConfig(file))
opts = append(opts, withPretty())
opts = append(opts, WithLib(lib))

b := base.GetInitialSensor()
Expand All @@ -340,7 +330,6 @@ func GetDefaultObserverWithFile(t *testing.T, ctx context.Context, file, lib str

func GetDefaultSensorsWithFile(t *testing.T, ctx context.Context, file, lib string, opts ...TestOption) ([]*sensors.Sensor, error) {
opts = append(opts, WithConfig(file))
opts = append(opts, withPretty())
opts = append(opts, WithLib(lib))

b := base.GetInitialSensor()
Expand All @@ -350,7 +339,6 @@ func GetDefaultSensorsWithFile(t *testing.T, ctx context.Context, file, lib stri

func GetDefaultObserverWithFileNoTest(t *testing.T, ctx context.Context, file, lib string, fail bool, opts ...TestOption) (*Observer, error) {
opts = append(opts, WithConfig(file))
opts = append(opts, withPretty())
opts = append(opts, WithLib(lib))
opts = append(opts, withNotestfail(fail))

Expand Down Expand Up @@ -589,7 +577,6 @@ func WriteConfigFile(fileName, config string) error {
func GetDefaultObserver(t *testing.T, ctx context.Context, lib string, opts ...TestOption) (*Observer, error) {
b := base.GetInitialSensor()

opts = append(opts, withPretty())
opts = append(opts, WithLib(lib))

return GetDefaultObserverWithWatchers(t, ctx, b, opts...)
Expand All @@ -598,7 +585,6 @@ func GetDefaultObserver(t *testing.T, ctx context.Context, lib string, opts ...T
func GetDefaultObserverWithConfig(t *testing.T, ctx context.Context, config, lib string, opts ...TestOption) (*Observer, error) {
b := base.GetInitialSensor()

opts = append(opts, withPretty())
opts = append(opts, WithConfig(config))
opts = append(opts, WithLib(lib))

Expand Down

0 comments on commit 9baecf3

Please sign in to comment.