tests

package
v0.0.0-...-c4ccf5f Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2018 License: Apache-2.0 Imports: 21 Imported by: 0

README

FN integration API tests

Test dependencies

DOCKER_HOST - for building images
FN_API_URL - Fn API endpoint

How to run tests?

export FN_API_URL=http://localhost:8080
go test -v ./...

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APICallWithRetry

func APICallWithRetry(t *testing.T, attempts int, sleep time.Duration, callback func() error) (err error)

func APIClient

func APIClient() *client.Fn

func CallFN

func CallFN(u string, content io.Reader, output io.Writer, method string, env []string) (http.Header, error)

func CheckAppResponseError

func CheckAppResponseError(t *testing.T, e error)

func CheckRouteResponseError

func CheckRouteResponseError(t *testing.T, e error)

func Cleanup

func Cleanup()

func CreateApp

func CreateApp(t *testing.T, ctx context.Context, fnclient *client.Fn, appName string, config map[string]string)

func CreateAppNoAssert

func CreateAppNoAssert(ctx context.Context, fnclient *client.Fn, appName string, config map[string]string) (*apps.PostAppsOK, error)

func CreateRoute

func CreateRoute(t *testing.T, ctx context.Context, fnclient *client.Fn, appName, routePath, image, routeType, routeFormat string, timeout, idleTimeout int32, routeConfig map[string]string, headers map[string][]string)

func CreateUpdateApp

func CreateUpdateApp(t *testing.T, ctx context.Context, fnclient *client.Fn, appName string, config map[string]string) *apps.PatchAppsAppOK

func DeleteApp

func DeleteApp(t *testing.T, ctx context.Context, fnclient *client.Fn, appName string)

func DeleteAppNoT

func DeleteAppNoT(ctx context.Context, fnclient *client.Fn, appName string)

func DeleteRoute

func DeleteRoute(t *testing.T, ctx context.Context, fnclient *client.Fn, appName, routePath string)

func DeployRoute

func DeployRoute(t *testing.T, ctx context.Context, fnclient *client.Fn, appName, routePath, image, routeType, routeFormat string, routeConfig map[string]string, headers map[string][]string) *models.Route

func EnvAsHeader

func EnvAsHeader(req *http.Request, selectedEnv []string)

func GetApp

func GetApp(t *testing.T, ctx context.Context, fnclient *client.Fn, appName string) *models.App

func GetRoute

func GetRoute(t *testing.T, ctx context.Context, fnclient *client.Fn, appName, routePath string) *models.Route

func Host

func Host() string

func ListRoutes

func ListRoutes(t *testing.T, ctx context.Context, fnclient *client.Fn, appName string) []*models.Route

func MyCaller

func MyCaller() string

func RandStringBytes

func RandStringBytes(n int) string

func UpdateRoute

func UpdateRoute(t *testing.T, ctx context.Context, fnclient *client.Fn, appName, routePath, image, routeType, format string, memory uint64, routeConfig map[string]string, headers map[string][]string, newRoutePath string) (*routes.PatchAppsAppRoutesRouteOK, error)

Types

type SuiteSetup

type SuiteSetup struct {
	Context      context.Context
	Client       *client.Fn
	AppName      string
	RoutePath    string
	Image        string
	RouteType    string
	Format       string
	Memory       uint64
	Timeout      int32
	IdleTimeout  int32
	RouteConfig  map[string]string
	RouteHeaders map[string][]string
	Cancel       context.CancelFunc
}

func SetupDefaultSuite

func SetupDefaultSuite() *SuiteSetup

Directories

Path Synopsis
fn
log

Jump to

Keyboard shortcuts

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