test

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

package test contains helpers for writing tests

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecError

func ExecError(err error) error

ExecError extracts stderr if err is an exec.ExitError

func ListenPort

func ListenPort() (int, error)

ListenPort returns a free ephemeral port for listening.

func SkipIfNoCluster

func SkipIfNoCluster(t testing.TB)

SkipIfNoCluster call t.Skip() if not logged in to a cluster.

Types

type LokiServer

type LokiServer struct {
	Port        int
	ContainerID string
}

LokiServer is a single-process Loki instance running in a container.

func NewLokiServer

func NewLokiServer() (server *LokiServer, err error)

func RequireLokiServer

func RequireLokiServer(t *testing.T) *LokiServer

func (*LokiServer) Close

func (s *LokiServer) Close() error

func (*LokiServer) Push

func (s *LokiServer) Push(labels map[string]string, lines ...string) error

func (*LokiServer) URL

func (s *LokiServer) URL() *url.URL

Directories

Path Synopsis
Package domain provides unit tests and benchmarks to be run against all domains.
Package domain provides unit tests and benchmarks to be run against all domains.
package mock is a mock implementation of a korrel8r domain for testing.
package mock is a mock implementation of a korrel8r domain for testing.

Jump to

Keyboard shortcuts

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