test

package
v2.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package test provides test helpers for unit and integration tests. This code is not meant to be used outside of tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartServer

func StartServer(t *testing.T) (*server.Server, int)

StartServer starts a server.Server with a random port and waits for the server to be up

func StartServerWithConfig

func StartServerWithConfig(t *testing.T, conf *server.Config) (*server.Server, int)

StartServerWithConfig starts a server.Server with a random port and waits for the server to be up

func StopServer

func StopServer(t *testing.T, s *server.Server, port int)

StopServer stops the test server and waits for the port to be down

func WaitForPortDown

func WaitForPortDown(t *testing.T, port int)

WaitForPortDown waits up to 5s for a port to come down and fails t if that fails

func WaitForPortUp

func WaitForPortUp(t *testing.T, port int)

WaitForPortUp waits up to 7s for a port to come up and fails t if that fails

Types

This section is empty.

Jump to

Keyboard shortcuts

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