framework

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: MPL-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanString

func CleanString(input string) string

func CleanupTempDir

func CleanupTempDir(initialDir, tempDir string)

func CopyToTempDir

func CopyToTempDir(relativePath string) (string, error)

func CopyToTempDirInDir

func CopyToTempDirInDir(baseDir, relativePath string) (string, error)

func CopyToTempDirWithoutChdir

func CopyToTempDirWithoutChdir(relativePath string) (string, error)

func CreateTempDir

func CreateTempDir() (string, error)

func ExpectEqual

func ExpectEqual(actual any, extra any, explain ...any)

ExpectEqual expects the specified two are the same, otherwise an exception raises.

func ExpectError

func ExpectError(err error, explain ...any)

ExpectError expects an error happens, otherwise an exception raises.

func ExpectNoError

func ExpectNoError(err error, explain ...any)

ExpectNoError checks if "err" is set, and if so, fails assertion while logging the error.

func ExpectNoErrorWithOffset

func ExpectNoErrorWithOffset(offset int, err error, explain ...any)

ExpectNoErrorWithOffset checks if "err" is set, and if so, fails assertion while logging the error at "offset" levels above its caller (for example, for call chain f -> g -> ExpectNoErrorWithOffset(1, ...) error would be logged for "f").

func ExpectNotEqual

func ExpectNotEqual(actual any, extra any, explain ...any)

ExpectNotEqual expects the specified two are not the same, otherwise an exception raises.

func GetTimeout

func GetTimeout() time.Duration

func ServeAgent

func ServeAgent()

ServeAgent will be a simple http file server that will expose our freshly compiled devsy binaries to be downloaded as agents. useful for non-linux runners.

Types

type Framework

type Framework struct {
	DevsyBinDir  string
	DevsyBinName string
}

func NewDefaultFramework

func NewDefaultFramework(path string) *Framework

func SetupDockerProvider

func SetupDockerProvider(binDir, dockerPath string) (*Framework, error)

SetupDockerProvider creates a new framework, removes any existing docker provider, adds a fresh one with the given docker path, and sets it as the active provider.

func (*Framework) DevsyBuild

func (f *Framework) DevsyBuild(ctx context.Context, additionalArgs ...string) error

func (*Framework) DevsyContextCreate

func (f *Framework) DevsyContextCreate(
	ctx context.Context,
	name string,
	extraArgs ...string,
) error

func (*Framework) DevsyContextDelete

func (f *Framework) DevsyContextDelete(
	ctx context.Context,
	name string,
	extraArgs ...string,
) error

func (*Framework) DevsyContextUse

func (f *Framework) DevsyContextUse(ctx context.Context, name string, extraArgs ...string) error

func (*Framework) DevsyIDEList

func (f *Framework) DevsyIDEList(ctx context.Context, extraArgs ...string) (string, error)

func (*Framework) DevsyIDEUse

func (f *Framework) DevsyIDEUse(ctx context.Context, ide string, extraArgs ...string) error

func (*Framework) DevsyList

func (f *Framework) DevsyList(ctx context.Context) (string, error)

DevsyList executes the `devsy list` command in the test framework.

func (*Framework) DevsyListParsed

func (f *Framework) DevsyListParsed(ctx context.Context) ([]*provider2.Workspace, error)

func (*Framework) DevsyMachineCreate

func (f *Framework) DevsyMachineCreate(ctx context.Context, args []string) error

func (*Framework) DevsyMachineDelete

func (f *Framework) DevsyMachineDelete(ctx context.Context, args []string) error

func (*Framework) DevsyPortTest

func (f *Framework) DevsyPortTest(ctx context.Context, port string, workspace string) error

func (*Framework) DevsyProviderAdd

func (f *Framework) DevsyProviderAdd(ctx context.Context, args ...string) error

func (*Framework) DevsyProviderDelete

func (f *Framework) DevsyProviderDelete(ctx context.Context, args ...string) error

func (*Framework) DevsyProviderFindOption

func (f *Framework) DevsyProviderFindOption(
	ctx context.Context,
	provider string,
	searchStr string,
	extraArgs ...string,
) error

func (*Framework) DevsyProviderList

func (f *Framework) DevsyProviderList(ctx context.Context, extraArgs ...string) error

func (*Framework) DevsyProviderOptionsCheckNamespaceDescription

func (f *Framework) DevsyProviderOptionsCheckNamespaceDescription(
	ctx context.Context,
	provider, searchStr string,
) error

func (*Framework) DevsyProviderOptionsJSON

func (f *Framework) DevsyProviderOptionsJSON(
	ctx context.Context,
	providerName string,
) (string, error)

DevsyProviderOptionsJSON executes `devsy provider options --output json` and returns the raw JSON.

func (*Framework) DevsyProviderRename

func (f *Framework) DevsyProviderRename(
	ctx context.Context,
	oldName, newName string,
	args ...string,
) error

DevsyProviderRename executes the `devsy provider rename` command in the test framework.

func (*Framework) DevsyProviderUpdate

func (f *Framework) DevsyProviderUpdate(ctx context.Context, args ...string) error

func (*Framework) DevsyProviderUse

func (f *Framework) DevsyProviderUse(
	ctx context.Context,
	provider string,
	extraArgs ...string,
) error

func (*Framework) DevsySSH

func (f *Framework) DevsySSH(
	ctx context.Context,
	workspace string,
	command string,
) (string, error)

func (*Framework) DevsySSHEchoTestString

func (f *Framework) DevsySSHEchoTestString(ctx context.Context, workspace string) error

func (*Framework) DevsySSHGpgTestKey

func (f *Framework) DevsySSHGpgTestKey(ctx context.Context, workspace string) error

func (*Framework) DevsyStatus

func (f *Framework) DevsyStatus(
	ctx context.Context,
	extraArgs ...string,
) (client.WorkspaceStatus, error)

func (*Framework) DevsyStop

func (f *Framework) DevsyStop(ctx context.Context, workspace string) error

func (*Framework) DevsyUp

func (f *Framework) DevsyUp(ctx context.Context, additionalArgs ...string) error

func (*Framework) DevsyUpRecreate

func (f *Framework) DevsyUpRecreate(ctx context.Context, additionalArgs ...string) error

func (*Framework) DevsyUpReset

func (f *Framework) DevsyUpReset(ctx context.Context, additionalArgs ...string) error

func (*Framework) DevsyUpStreams

func (f *Framework) DevsyUpStreams(
	ctx context.Context,
	workspace string,
	additionalArgs ...string,
) (string, string, error)

func (*Framework) DevsyUpWithIDE

func (f *Framework) DevsyUpWithIDE(ctx context.Context, additionalArgs ...string) error

DevsyUp executes the `devsy up` command in the test framework.

func (*Framework) DevsyWorkspaceDelete

func (f *Framework) DevsyWorkspaceDelete(
	ctx context.Context,
	workspace string,
	extraArgs ...string,
) error

func (*Framework) DevsyWorkspaceStop

func (f *Framework) DevsyWorkspaceStop(ctx context.Context, extraArgs ...string) error

func (*Framework) ExecCommand

func (f *Framework) ExecCommand(
	ctx context.Context,
	captureStdOut, searchForString bool,
	searchString string,
	args []string,
) error

ExecCommand executes the command string with the devsy test binary.

func (*Framework) ExecCommandCapture

func (f *Framework) ExecCommandCapture(ctx context.Context, args []string) (string, string, error)

ExecCommandCapture executes the command string with the devsy test binary, and returns stdout, stderr, and any error that occurred.

func (*Framework) ExecCommandOutput

func (f *Framework) ExecCommandOutput(ctx context.Context, args []string) (string, error)

ExecCommand executes the command string with the devsy test binary.

func (*Framework) ExecCommandStdout

func (f *Framework) ExecCommandStdout(ctx context.Context, args []string) error

ExecCommandStdout executes the command string with the devsy test binary.

func (*Framework) FindWorkspace

func (f *Framework) FindWorkspace(ctx context.Context, id string) (*provider2.Workspace, error)

func (*Framework) SetupGPG

func (f *Framework) SetupGPG(tmpDir string) error

type Pod

type Pod struct {
	Spec PodSpec `json:"spec"`
}

type PodContainer

type PodContainer struct {
	Image string `json:"image,omitempty"`
}

type PodList

type PodList struct {
	Items []Pod `json:"items"`
}

PodList is a list of Pods.

type PodSpec

type PodSpec struct {
	Containers []PodContainer `json:"containers,omitempty"`
}

Jump to

Keyboard shortcuts

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