integration

package
v0.13.6 Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: Apache-2.0 Imports: 13 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.

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). Each Tiltfile should deploy small services to gcr.io/windmill-test-containers. Add new images to purge-test-images.sh so that they get purged periodically.

Run the tests with

go test -tags 'integration' -timeout 300s ./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. Follow these instructions if you want to run the same cluster locally.

https://github.com/kubernetes-sigs/kind

Simulating restart_container() on non-Docker clusters

As of 6/28/19 restart_container(), a command that can be passed to a live_update, doesn't work on non-Docker clusters. However there's a workaround available to simulate restart_container()'s functionality. It's used in the onewatch integration test so that the test passes on non-Docker clusters. Here's how it works:

Copy start.sh and restart.sh to your container working dir.

Make your container entrypoint: ./start.sh path-to-binary [args]

To restart the container add this instead of restart_container() in the live update parameter: run(./restart.sh)

So, for example:

docker_build('gcr.io/windmill-test-containers/integration/onewatch',
             '.',
             dockerfile='Dockerfile',
             live_update=[
               sync('.', '/go/src/github.com/windmilleng/tilt/integration/onewatch'),
               run('go install github.com/windmilleng/tilt/integration/onewatch'),
               run('./restart.sh'),
             ])

This live update will cause the go install to be run in the container every time anything in the . path locally changes. After the go install is run, ./restart.sh will be run. This will kill the original entrypoint, and restart it, effectively simulating the container_restart() functionality on Docker.

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

This section is empty.

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
}

func NewTiltDriver added in v0.10.18

func NewTiltDriver() *TiltDriver

func (*TiltDriver) Args added in v0.11.1

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

func (*TiltDriver) Down added in v0.10.18

func (d *TiltDriver) Down(out io.Writer) error

func (*TiltDriver) DumpEngine added in v0.10.18

func (d *TiltDriver) DumpEngine(out io.Writer) error

func (*TiltDriver) Up added in v0.10.18

func (d *TiltDriver) Up(args []string, out io.Writer) (*TiltUpResponse, error)

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) Kill added in v0.10.18

func (r *TiltUpResponse) Kill() 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.

Directories

Path Synopsis
dcbuild
dcfastbuild

Jump to

Keyboard shortcuts

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