scraperinttest

package
v0.116.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

README

scraperinttest

This package is intended to be a temporary workspace for extracting common functionality from scraper integration tests. Once stabilized, this code can likely move to pdatatest or its sub-packages pmetrictest, etc.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunScript

func RunScript(script []string) testcontainers.ContainerHook

Types

type ContainerInfo

type ContainerInfo struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*ContainerInfo) Host

func (ci *ContainerInfo) Host(t *testing.T) string

func (*ContainerInfo) HostForNamedContainer added in v0.79.0

func (ci *ContainerInfo) HostForNamedContainer(t *testing.T, containerName string) string

func (*ContainerInfo) MappedPort

func (ci *ContainerInfo) MappedPort(t *testing.T, port string) string

func (*ContainerInfo) MappedPortForNamedContainer added in v0.79.0

func (ci *ContainerInfo) MappedPortForNamedContainer(t *testing.T, containerName string, port string) string

type IntegrationTest

type IntegrationTest struct {
	// contains filtered or unexported fields
}

func NewIntegrationTest

func NewIntegrationTest(f receiver.Factory, opts ...TestOption) *IntegrationTest

func (*IntegrationTest) Run

func (it *IntegrationTest) Run(t *testing.T)

type TestOption

type TestOption func(*IntegrationTest)

func AllowHardcodedHostPort added in v0.80.0

func AllowHardcodedHostPort() TestOption

func FailOnErrorLogs added in v0.79.0

func FailOnErrorLogs() TestOption

This option is useful for debugging scrapers but should not be used permanently because the logs do not correlate to a single scrape interval. In other words, when a retryable failure occurs, this setting will likely force a failure anyways.

func WithCompareOptions

func WithCompareOptions(opts ...pmetrictest.CompareMetricsOption) TestOption

func WithCompareTimeout

func WithCompareTimeout(t time.Duration) TestOption

func WithContainerRequest

func WithContainerRequest(cr testcontainers.ContainerRequest) TestOption

func WithCreateContainerTimeout

func WithCreateContainerTimeout(t time.Duration) TestOption

func WithCustomConfig

func WithCustomConfig(c customConfigFunc) TestOption

func WithExpectedFile

func WithExpectedFile(f string) TestOption

func WriteExpected added in v0.79.0

func WriteExpected() TestOption

Jump to

Keyboard shortcuts

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