integration

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

README

Tilt Integration Tests

Runs the Tilt binary and ensures that services are correctly deployed.

Who You Are: A developer who has kubectl configured to talk to an existing cluster.

What This Framework Does: Compiles the Tilt binary, deploys servers to the tilt-integration namespace, and cleans up when it finishes.

NOTE: The tilt-integration namespace will NOT be deleted afterwards.

Each subdirectory is a test case driven by the file of the same name (e.g., oneup_.go drives the test driven by the data in oneup).

Run the tests with

go test -tags 'integration' -timeout 30m ./integration

or

make integration

These tests will not run with the normal make test.

On CircleCI, we run these tests against a clean Kubernetes cluster using kind. To create a single-use kind cluster locally and run the tests against it, run:

make integration-kind

Documentation

Overview

Integration tests that run the Tilt binary directly. See README.md for more info on how to run and write integration tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TiltDriverUseRandomFreePort added in v0.19.0

func TiltDriverUseRandomFreePort(t testing.TB, td *TiltDriver)

Types

type Event added in v0.9.5

type Event map[string]interface{}

func (Event) Duration added in v0.9.5

func (e Event) Duration() time.Duration

func (Event) Name added in v0.9.5

func (e Event) Name() string

func (Event) Tags added in v0.9.5

func (e Event) Tags() map[string]string

type MemoryStatsReporter

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

func (*MemoryStatsReporter) Close

func (sr *MemoryStatsReporter) Close() error

func (*MemoryStatsReporter) Count

func (sr *MemoryStatsReporter) Count(name string, value int64, tags map[string]string, rate float64) error

func (*MemoryStatsReporter) Incr

func (sr *MemoryStatsReporter) Incr(name string, tags map[string]string, rate float64) error

func (*MemoryStatsReporter) Timing

func (sr *MemoryStatsReporter) Timing(name string, value time.Duration, tags map[string]string, rate float64) error

type MemoryStatsServer

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

func StartMemoryStatsServer

func StartMemoryStatsServer() (mss *MemoryStatsServer, port int, err error)

func (*MemoryStatsServer) TearDown

func (mss *MemoryStatsServer) TearDown() error

type StatsReporter added in v0.9.5

type StatsReporter interface {
	io.Closer
	Timing(name string, value time.Duration, tags map[string]string, rate float64) error
	Count(name string, value int64, tags map[string]string, rate float64) error
	Incr(name string, tags map[string]string, rate float64) error
}

type StatsServer added in v0.9.5

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

A small http server that decodes json and sends it to our metrics services

func NewStatsServer added in v0.9.5

func NewStatsServer(stats StatsReporter) StatsServer

func (StatsServer) Index added in v0.9.5

func (s StatsServer) Index(w http.ResponseWriter, r *http.Request)

func (StatsServer) Report added in v0.9.5

func (s StatsServer) Report(w http.ResponseWriter, r *http.Request)

func (StatsServer) Router added in v0.9.5

func (s StatsServer) Router() *mux.Router

type TiltDriver added in v0.10.18

type TiltDriver struct {
	Environ map[string]string
	// contains filtered or unexported fields
}

func NewTiltDriver added in v0.10.18

func NewTiltDriver(t testing.TB, options ...TiltDriverOption) *TiltDriver

func (*TiltDriver) APIResources added in v0.20.4

func (d *TiltDriver) APIResources(ctx context.Context) ([]string, error)

func (*TiltDriver) Args added in v0.14.0

func (d *TiltDriver) Args(ctx context.Context, args []string, out io.Writer) error

func (*TiltDriver) CI added in v0.17.9

func (d *TiltDriver) CI(ctx context.Context, out io.Writer, args ...string) error

func (*TiltDriver) Down added in v0.10.18

func (d *TiltDriver) Down(ctx context.Context, out io.Writer) error

func (*TiltDriver) DumpEngine added in v0.10.18

func (d *TiltDriver) DumpEngine(ctx context.Context, out io.Writer) error

func (*TiltDriver) Get added in v0.20.4

func (d *TiltDriver) Get(ctx context.Context, apiType string, names ...string) ([]byte, error)

func (*TiltDriver) Patch added in v0.23.5

func (d *TiltDriver) Patch(ctx context.Context, apiType string, patch string, name string) error

func (*TiltDriver) Up added in v0.10.18

func (d *TiltDriver) Up(ctx context.Context, command UpCommand, out io.Writer, args ...string) (*TiltUpResponse, error)

type TiltDriverOption added in v0.19.0

type TiltDriverOption func(t testing.TB, td *TiltDriver)

type TiltUpResponse added in v0.10.18

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

func (*TiltUpResponse) Done added in v0.10.18

func (r *TiltUpResponse) Done() <-chan struct{}

func (*TiltUpResponse) Err added in v0.10.18

func (r *TiltUpResponse) Err() error

func (*TiltUpResponse) KillAndDumpThreads added in v0.10.18

func (r *TiltUpResponse) KillAndDumpThreads() error

Kill the tilt process and print the goroutine/register state. Useful if you think Tilt is deadlocked but aren't sure why.

func (*TiltUpResponse) TriggerExit added in v0.22.11

func (r *TiltUpResponse) TriggerExit() error

TriggerExit sends a SIGTERM to the `tilt up` process to give it a chance to exit normally.

If the signal cannot be sent or 2 seconds have elapsed, it will be forcibly killed with SIGKILL.

type UpCommand added in v0.22.11

type UpCommand string
const (
	UpCommandUp   UpCommand = "up"
	UpCommandDemo UpCommand = "demo"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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