examples

package
v0.0.0-...-5984036 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ModifyFile

func ModifyFile(path string, modFn FileModifier) error

Types

type CodeChangeTest

type CodeChangeTest struct {
	// The path to the directory containing the service to test.
	ServicePath string

	// The path to the file that we're going to change.
	CodePath string

	// The modification that should be made to CodePath.
	FileChange FileModifier

	// The expected response before the code is changed.
	InitialResponseCheck keldaAssert.Assertion

	// The expected response after the code is changed.
	ChangedResponseCheck keldaAssert.Assertion
}

CodeChangeTest tests that Kelda properly syncs files by modifying a file, and checking the HTTP response.

func (CodeChangeTest) Test

func (test CodeChangeTest) Test(ctx context.Context, t *testing.T, helper *util.TestHelper)

type ExampleTest

type ExampleTest struct {
	// The services that we expect to get deployed from the Workspace.
	ExpectedServices []string

	// The services that should be run in development mode.
	DevServices []string

	// Additional tunnels to add to the Workspace.
	Tunnels []config.Tunnel

	CodeChangeTests []CodeChangeTest
}

ExampleTest is used for testing our example applications.

func (ExampleTest) Test

func (test ExampleTest) Test(t *testing.T, helper *util.TestHelper)

type FileModifier

type FileModifier func(string) string

func DeleteLine

func DeleteLine(linesToDelete ...int) FileModifier

func Replace

func Replace(currStr, newStr string) FileModifier

Jump to

Keyboard shortcuts

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