inspectiontaskbasetest

package
v0.52.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertFilterTask

func AssertFilterTask(t *testing.T, task coretask.Task[[]*log.Log], sourceRef taskid.TaskReference[[]*log.Log], testCases []FilterTaskTestCase)

AssertFilterTask asserts that the given filter task behaves as expected for the given test cases. It runs the task with the given log fields and checks if the log is included or excluded from the result.

func AssertGrouperTask

func AssertGrouperTask(t *testing.T, task coretask.Task[inspectiontaskbase.LogGroupMap], sourceRef taskid.TaskReference[[]*log.Log], testCases []GrouperTaskTestCase)

AssertGrouperTask asserts that the given grouper task behaves as expected for the given test cases.

Types

type FilterTaskTestCase

type FilterTaskTestCase struct {
	Description  string
	LogFields    []log.FieldSet
	WantIncluded bool
}

FilterTaskTestCase is a test case for testing a filter task. It contains the log fields to be filtered and the expected result.

type GrouperTaskTestCase

type GrouperTaskTestCase struct {
	Description string
	LogFields   []log.FieldSet
	WantGroup   string
}

GrouperTaskTestCase is a test case for log grouper task.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL