tests

package
v0.0.0-...-29e7bc9 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Overview

Package tests contains integration tests that run k6 commands, and interact with standard I/O streams. They're the highest level tests we have, just below E2E tests that execute the k6 binary. Since they initialize all internal k6 components similarly to how a user would, they're very useful, but also very expensive to run.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main(m *testing.M)

Main is a TestMain function that can be imported by other test packages that want to use the blocking transport and other features useful for integration tests.

Types

type GlobalTestState

type GlobalTestState struct {
	*state.GlobalState
	Cancel func()

	Stdout, Stderr *bytes.Buffer
	LoggerHook     *testutils.SimpleLogrusHook

	Cwd string

	ExpectedExitCode int
}

GlobalTestState is a wrapper around GlobalState for use in tests.

func NewGlobalTestState

func NewGlobalTestState(tb testing.TB) *GlobalTestState

NewGlobalTestState returns an initialized GlobalTestState, mocking all GlobalState fields for use in tests.

Jump to

Keyboard shortcuts

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