setup

package
v0.6.167 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertCustomTestRepoSetupRan added in v0.6.69

func AssertCustomTestRepoSetupRan(t *testing.T, w Workspace, repoPath string, logStr string, user string, pwd string, logFile string)

func AssertCwd

func AssertCwd(t *testing.T, w Workspace, expectedCwd string)

func AssertDockerRunning

func AssertDockerRunning(t *testing.T, w Workspace) bool

func AssertFileContainsString

func AssertFileContainsString(t *testing.T, w Workspace, filePath string, contains string) bool

func AssertFileNotContainsString

func AssertFileNotContainsString(t *testing.T, w Workspace, filePath string, contains string) bool

func AssertInternalCurlOuputContains

func AssertInternalCurlOuputContains(t *testing.T, w Workspace, url string, contains string, retries int)

func AssertInternalSSHServerRunning

func AssertInternalSSHServerRunning(t *testing.T, w Workspace, privKeyPath string, user string, healthCheck string)

func AssertPathDoesNotExist

func AssertPathDoesNotExist(t *testing.T, workspace Workspace, path string) bool

func AssertPathExists

func AssertPathExists(t *testing.T, workspace Workspace, path string) bool

func AssertPathNotExist

func AssertPathNotExist(t *testing.T, workspace Workspace, path string) bool

func AssertRepoHasNumFiles

func AssertRepoHasNumFiles(t *testing.T, w Workspace, filePath string, num int)

func AssertTestRepoSetupRan

func AssertTestRepoSetupRan(t *testing.T, w Workspace, repoPath string)

func AssertTestUserRepoSetupRan

func AssertTestUserRepoSetupRan(t *testing.T, w Workspace, repoPath string)

func AssertUser

func AssertUser(t *testing.T, w Workspace, expectedUser string)

func AssertValidBrevBaseRepoSetup

func AssertValidBrevBaseRepoSetup(t *testing.T, w Workspace, repoPath string)

func AssertValidBrevProjRepo

func AssertValidBrevProjRepo(t *testing.T, w Workspace, repoPath string)

func AssertValidUserBrevSetup

func AssertValidUserBrevSetup(t *testing.T, w Workspace, repoPath string)

func AssertWorkspaceSetup

func AssertWorkspaceSetup(t *testing.T, w Workspace, password string, host string)

func GetTestKeys

func GetTestKeys(prefix string) (*store.KeyPair, error)

func GetUnauthedTestKeys

func GetUnauthedTestKeys(prefix string) (*store.KeyPair, error)

func NewTestSetupParams

func NewTestSetupParams(keyPair *store.KeyPair) *store.SetupParamsV0

func UpdateFile

func UpdateFile(w Workspace, filePath string, content string) error

Types

type AllWorkspaceTestClientOption

type AllWorkspaceTestClientOption struct {
	BrevBinaryPath string
	TestNamePrefix string
}

func NewWorkspaceTestClientOptions

func NewWorkspaceTestClientOptions(options []WorkspaceTestClientOption) AllWorkspaceTestClientOption

type BrevBinaryPath

type BrevBinaryPath struct {
	BinaryPath string
}

func (BrevBinaryPath) ApplyWorkspaceTestClientOption

func (b BrevBinaryPath) ApplyWorkspaceTestClientOption(allOptions *AllWorkspaceTestClientOption)

type ContainerParams

type ContainerParams struct {
	Name  string
	Image string
	Ports []string
}

type ExecResult

type ExecResult interface {
	CombinedOutput() ([]byte, error)
}

type TestNamePrefix

type TestNamePrefix struct {
	Name string
}

func (TestNamePrefix) ApplyWorkspaceTestClientOption

func (t TestNamePrefix) ApplyWorkspaceTestClientOption(allOptions *AllWorkspaceTestClientOption)

type TestWorkspace

type TestWorkspace struct {
	SetupParams    *store.SetupParamsV0
	ContainerName  string
	Image          string
	Ports          []string
	TestBrevBinary string // path to brev binary that should be tested
	ShowOut        bool
}

func NewTestWorkspace

func NewTestWorkspace(testBrevBinaryPath string, containerName string, image string, ports []string, setupParams *store.SetupParamsV0) *TestWorkspace

func (TestWorkspace) Copy

func (w TestWorkspace) Copy(src string, dest string) error

func (TestWorkspace) Done

func (w TestWorkspace) Done() error

func (TestWorkspace) Exec

func (w TestWorkspace) Exec(arg ...string) ([]byte, error)

func (TestWorkspace) KillContainer

func (w TestWorkspace) KillContainer() error

func (TestWorkspace) Reset

func (w TestWorkspace) Reset() error

func (TestWorkspace) RmContainer

func (w TestWorkspace) RmContainer() error

func (TestWorkspace) RmVolume

func (w TestWorkspace) RmVolume() error

func (TestWorkspace) Setup

func (w TestWorkspace) Setup() error

func (*TestWorkspace) UpdateParams

func (w *TestWorkspace) UpdateParams(params *store.SetupParamsV0)

type Workspace

type Workspace interface {
	Setup() error
	Done() error
	Reset() error
	Exec(arg ...string) ([]byte, error) // always returns []byte even if error since stdout/err is still useful
	Copy(src string, dest string) error
	UpdateParams(*store.SetupParamsV0)
}

type WorkspaceTestClient

type WorkspaceTestClient struct {
	SetupParams     *store.SetupParamsV0
	ContainerParams []ContainerParams
	TestWorkspaces  []Workspace
}

func NewWorkspaceTestClient

func NewWorkspaceTestClient(setupParams *store.SetupParamsV0, containerParams []ContainerParams, options ...WorkspaceTestClientOption) *WorkspaceTestClient

func (WorkspaceTestClient) Done

func (w WorkspaceTestClient) Done() error

func (WorkspaceTestClient) Test

func (w WorkspaceTestClient) Test(test workspaceTest) error

type WorkspaceTestClientOption

type WorkspaceTestClientOption interface {
	ApplyWorkspaceTestClientOption(allOptions *AllWorkspaceTestClientOption)
}

Jump to

Keyboard shortcuts

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