Documentation ¶
Index ¶
- Constants
- func AssertEqualsEngineStatus(t *testing.T, expectedEngineStatus, actualEngineStatus model.EngineStatus)
- func AssertEqualsField(t *testing.T, a, b model.Field)
- func AssertEqualsResource(t *testing.T, a, b model.Resource)
- func AssertEqualsResourcePter(t *testing.T, a, b *model.Resource)
- func AssertEqualsResources(t *testing.T, a, b model.Resources)
- func AssertEqualsTag(t *testing.T, a, b *model.Tag)
- func AssertEqualsTags(t *testing.T, a, b model.Tags)
- func AssertResourceCount(t testing.TB, resources []model.Resource, tagValue string, count int)
- func AssertResourceFilteredCount(t testing.TB, resources []model.Resource, count int, filter ResourceFilter) []model.Resource
- func FetchAll[T any](ctx context.Context, t testing.TB, f func(context.Context, chan<- T) error) ([]T, error)
- func FilterFunc[T any](in []T, predicate func(T) bool) []T
- func FuncSignature(value any) string
- func JSONBytesEqual(a, b []byte) (bool, error)
- func MustFetchAll[T any](ctx context.Context, t testing.TB, f func(context.Context, chan<- T) error) []T
- func ResourceFilterTagKey(in []model.Resource, key string) []model.Resource
- func ResourceFilterTagKeyValue(in []model.Resource, key, value string) []model.Resource
- func SliceConvertFunc[In any, Out any, T ~[]In](in T, f func(In) Out) []Out
- func TypeStr(v any) string
- func Unique[T comparable](in []T) []T
- type ResourceFilter
Constants ¶
const TestTag = "test"
Variables ¶
This section is empty.
Functions ¶
func AssertEqualsEngineStatus ¶
func AssertEqualsEngineStatus(t *testing.T, expectedEngineStatus, actualEngineStatus model.EngineStatus)
func AssertResourceCount ¶
AssertResourceCount asserts that there is a specific number of given resources with the "test" tag. If tagValue is not an empty string, it also filters on resources that have the "test" tag with that value.
func FetchAll ¶
func FetchAll[T any](ctx context.Context, t testing.TB, f func(context.Context, chan<- T) error) ([]T, error)
FetchAll pulls all resources from `f` over the passed channel, returning the resources as a slice
func FilterFunc ¶
FilterFunc filters a slice based on the predicate function
func FuncSignature ¶
FuncSignature returns the signature of a function as a string, useful for error messages.
func JSONBytesEqual ¶
JSONBytesEqual compares the JSON in two byte slices.
func MustFetchAll ¶
func MustFetchAll[T any](ctx context.Context, t testing.TB, f func(context.Context, chan<- T) error) []T
MustFetchAll is like FetchAll, but fatals the running test if there is an error during fetching
func ResourceFilterTagKey ¶
ResourceFilterTagKey filters a slice of model.Resources based on a given tag key being present on that resource.
func ResourceFilterTagKeyValue ¶
ResourceFilterTagKey filters a slice of model.Resources based on a given tag key/value pair being present on that resource.
func SliceConvertFunc ¶
func TypeStr ¶
TypeStr is a convenience function to get the fully qualified type identifier for a value
func Unique ¶
func Unique[T comparable](in []T) []T
Unique returns a new slice with duplicate elements removed and the order preserved.
Types ¶
type ResourceFilter ¶
func (ResourceFilter) String ¶
func (f ResourceFilter) String() string