Documentation
¶
Index ¶
- func BuildFeatureTarGz(filename, content string) []byte
- func CleanString(input string) string
- func CleanupTempDir(initialDir, tempDir string)
- func CopyTestdata(testdataPath, initialDir string) string
- func CopyTestdataNoChdir(testdataPath string) string
- func CopyToTempDir(relativePath string) (string, error)
- func CopyToTempDirInDir(baseDir, relativePath string) (string, error)
- func CopyToTempDirWithoutChdir(relativePath string) (string, error)
- func CreateTempDir() (string, error)
- func ExpectEqual(actual any, extra any, explain ...any)
- func ExpectError(err error, explain ...any)
- func ExpectNoError(err error, explain ...any)
- func ExpectNoErrorWithOffset(offset int, err error, explain ...any)
- func ExpectNotEqual(actual any, extra any, explain ...any)
- func ImportGpgKey(privateKeyPath string) error
- func OpenSSHControlMaster(t testLogger, workspaceHost string, extraEnv map[string]string) (controlPath string, closer func(), err error)
- func PushFeatureTag(refStr string)
- func RetryFixed(ctx context.Context, attempts int, delay time.Duration, ...) error
- func SSHMultiplexedExec(controlPath, host string, extraEnv map[string]string, cmd ...string) (stdout, stderr string, err error)
- func ServeAgent()
- func SetEnvForSpec(name, value string)
- func SkipOnWindows(reason string)
- func SkipUnlessOS(goos, reason string)
- func StartMockSSHAgent(t testLogger) (authSock string, pubKey string, cleanup func())
- func TimeoutLong() time.Duration
- func TimeoutModerate() time.Duration
- func TimeoutShort() time.Duration
- func TimeoutVeryLong() time.Duration
- func UnsetEnvForSpec(name string)
- func UseFileSecretsBackend()
- func WriteTempDevcontainer(prefix, content string) string
- type Framework
- func NewDefaultFramework(path string) *Framework
- func SetupDockerProvider(binDir, dockerPath string) (*Framework, error)
- func SetupDockerWorkspace(testdataPath, initialDir string) (string, *Framework, error)
- func SetupDockerWorkspaceAndUp(ctx context.Context, testdataPath, initialDir string) (string, *Framework, error)
- func (f *Framework) CleanupWorkspace(ctx context.Context, workspace string) error
- func (f *Framework) DevsyBuild(ctx context.Context, additionalArgs ...string) error
- func (f *Framework) DevsyContextCreate(ctx context.Context, name string, extraArgs ...string) error
- func (f *Framework) DevsyContextDelete(ctx context.Context, name string, extraArgs ...string) error
- func (f *Framework) DevsyContextUse(ctx context.Context, name string, extraArgs ...string) error
- func (f *Framework) DevsyIDEList(ctx context.Context, extraArgs ...string) (string, error)
- func (f *Framework) DevsyIDEUse(ctx context.Context, ide string, extraArgs ...string) error
- func (f *Framework) DevsyList(ctx context.Context) (string, error)
- func (f *Framework) DevsyListParsed(ctx context.Context) ([]*provider2.Workspace, error)
- func (f *Framework) DevsyLogs(ctx context.Context, workspace string) (string, error)
- func (f *Framework) DevsyMachineCreate(ctx context.Context, args []string) error
- func (f *Framework) DevsyMachineDelete(ctx context.Context, args []string) error
- func (f *Framework) DevsyPortTest(ctx context.Context, port string, workspace string) error
- func (f *Framework) DevsyProviderAdd(ctx context.Context, args ...string) error
- func (f *Framework) DevsyProviderAddDocker(ctx context.Context, name string) error
- func (f *Framework) DevsyProviderDelete(ctx context.Context, args ...string) error
- func (f *Framework) DevsyProviderFindOption(ctx context.Context, provider string, searchStr string, extraArgs ...string) error
- func (f *Framework) DevsyProviderList(ctx context.Context, extraArgs ...string) error
- func (f *Framework) DevsyProviderOptionsCheckNamespaceDescription(ctx context.Context, provider, searchStr string) error
- func (f *Framework) DevsyProviderOptionsJSON(ctx context.Context, providerName string) (string, error)
- func (f *Framework) DevsyProviderRename(ctx context.Context, oldName, newName string, args ...string) error
- func (f *Framework) DevsyProviderSetSource(ctx context.Context, args ...string) error
- func (f *Framework) DevsyProviderUse(ctx context.Context, provider string, extraArgs ...string) error
- func (f *Framework) DevsyRename(ctx context.Context, oldName, newName string, args ...string) error
- func (f *Framework) DevsySSH(ctx context.Context, workspace string, command string) (string, error)
- func (f *Framework) DevsySSHEchoTestString(ctx context.Context, workspace string) error
- func (f *Framework) DevsySSHGpgSecretKeyForwarded(ctx context.Context, workspace, expectedFingerprint string) error
- func (f *Framework) DevsySSHOnce(ctx context.Context, workspace string, command string) (string, error)
- func (f *Framework) DevsyStatus(ctx context.Context, extraArgs ...string) (client.WorkspaceStatus, error)
- func (f *Framework) DevsyStop(ctx context.Context, workspace string) error
- func (f *Framework) DevsyUp(ctx context.Context, additionalArgs ...string) error
- func (f *Framework) DevsyUpRecreate(ctx context.Context, additionalArgs ...string) error
- func (f *Framework) DevsyUpReset(ctx context.Context, additionalArgs ...string) error
- func (f *Framework) DevsyUpStreams(ctx context.Context, workspace string, additionalArgs ...string) (string, string, error)
- func (f *Framework) DevsyUpStreamsRaw(ctx context.Context, workspace string, additionalArgs ...string) (string, string, error)
- func (f *Framework) DevsyUpWithIDE(ctx context.Context, additionalArgs ...string) error
- func (f *Framework) DevsyWorkspaceDelete(ctx context.Context, workspace string, extraArgs ...string) error
- func (f *Framework) DevsyWorkspaceStop(ctx context.Context, extraArgs ...string) error
- func (f *Framework) DevsyWorkspaceTaskCancel(ctx context.Context, taskID string) error
- func (f *Framework) DevsyWorkspaceTaskList(ctx context.Context) (string, error)
- func (f *Framework) ExecCommand(ctx context.Context, captureStdOut, searchForString bool, searchString string, ...) error
- func (f *Framework) ExecCommandCapture(ctx context.Context, args []string) (string, string, error)
- func (f *Framework) ExecCommandJSON(ctx context.Context, args []string) (map[string]any, error)
- func (f *Framework) ExecCommandOutput(ctx context.Context, args []string) (string, error)
- func (f *Framework) ExecCommandStdout(ctx context.Context, args []string) error
- func (f *Framework) FindWorkspace(ctx context.Context, id string) (*provider2.Workspace, error)
- func (f *Framework) SetupGPG(tmpDir string) error
- func (f *Framework) StartMCPServer(ctx context.Context) (*MCPClient, error)
- type MCPClient
- type Pod
- type PodContainer
- type PodList
- type PodSpec
- type SecurityContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildFeatureTarGz ¶ added in v1.24.0
BuildFeatureTarGz returns a gzipped tar holding a single file.
func CleanString ¶
func CleanupTempDir ¶
func CleanupTempDir(initialDir, tempDir string)
func CopyTestdata ¶ added in v1.24.0
CopyTestdata copies testdataPath to a temp dir, changes into it, and registers cleanup that removes the temp dir and changes back to initialDir.
func CopyTestdataNoChdir ¶
CopyTestdataNoChdir copies testdataPath to a temp dir and removes it on cleanup.
func CopyToTempDir ¶
func CopyToTempDirInDir ¶
func CreateTempDir ¶
func ExpectEqual ¶
ExpectEqual expects the specified two are the same, otherwise an exception raises.
func ExpectError ¶
ExpectError expects an error happens, otherwise an exception raises.
func ExpectNoError ¶
ExpectNoError checks if "err" is set, and if so, fails assertion while logging the error.
func ExpectNoErrorWithOffset ¶
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 ¶
ExpectNotEqual expects the specified two are not the same, otherwise an exception raises.
func ImportGpgKey ¶ added in v1.11.0
func OpenSSHControlMaster ¶ added in v1.3.1
func OpenSSHControlMaster( t testLogger, workspaceHost string, extraEnv map[string]string, ) (controlPath string, closer func(), err error)
OpenSSHControlMaster starts an OpenSSH ControlMaster connection to the given devsy workspace host (typically "<workspace>.devsy", as written by `devsy up`'s SSH config integration). Multiple sessions can then be opened over the same connection by re-invoking ssh with `-S <controlPath>`.
Returns the controlPath, the host the caller should pass to multiplexed ssh invocations, and a closer that tears the master down.
`extraEnv` is merged into the child ssh process environment (e.g. to set SSH_AUTH_SOCK for agent forwarding).
func PushFeatureTag ¶ added in v1.24.0
func PushFeatureTag(refStr string)
PushFeatureTag pushes a minimal my-feature@1.0.0 OCI feature to refStr.
func RetryFixed ¶ added in v1.24.0
func RetryFixed( ctx context.Context, attempts int, delay time.Duration, fn func(ctx context.Context) error, ) error
RetryFixed calls fn up to attempts times, sleeping delay between failed attempts, and returns nil on the first success. When attempts are exhausted it returns the last error wrapped with the attempt count. Cancelling ctx stops retrying: the returned error wraps both ctx.Err() and the last fn error. attempts below 1 is treated as 1.
func SSHMultiplexedExec ¶ added in v1.3.1
func SSHMultiplexedExec( controlPath, host string, extraEnv map[string]string, cmd ...string, ) (stdout, stderr string, err error)
SSHMultiplexedExec runs cmd as a new SSH session on the existing ControlMaster connection at controlPath.
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.
func SetEnvForSpec ¶
func SetEnvForSpec(name, value string)
SetEnvForSpec sets name to value for the current spec. The prior state is restored in DeferCleanup; unset and set-to-empty are kept distinct.
func SkipOnWindows ¶ added in v1.24.0
func SkipOnWindows(reason string)
func SkipUnlessOS ¶ added in v1.24.0
func SkipUnlessOS(goos, reason string)
func StartMockSSHAgent ¶ added in v1.3.1
StartMockSSHAgent starts an isolated ssh-agent on a temporary socket path and loads a freshly generated ed25519 key into it. The returned cleanup function kills the agent process and removes the temp directory.
func TimeoutLong ¶ added in v1.1.0
func TimeoutModerate ¶ added in v1.1.0
func TimeoutShort ¶ added in v1.1.0
func TimeoutVeryLong ¶ added in v1.1.0
func UnsetEnvForSpec ¶
func UnsetEnvForSpec(name string)
UnsetEnvForSpec unsets name for the current spec and restores the prior state in DeferCleanup.
func UseFileSecretsBackend ¶ added in v1.24.0
func UseFileSecretsBackend()
UseFileSecretsBackend forces the file backend so tests do not depend on an OS keyring (unavailable in CI); env is restored on cleanup.
func WriteTempDevcontainer ¶ added in v1.24.0
WriteTempDevcontainer writes content to devcontainer.json inside a new temp dir named by prefix and returns the dir. The caller owns cleanup of the returned dir.
Types ¶
type Framework ¶
func NewDefaultFramework ¶
func SetupDockerProvider ¶
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 SetupDockerWorkspace ¶ added in v1.24.0
SetupDockerWorkspace copies testdataPath to a temp dir and returns it with a docker-provider framework; temp dir and workspace are removed on cleanup.
func SetupDockerWorkspaceAndUp ¶ added in v1.24.0
func SetupDockerWorkspaceAndUp( ctx context.Context, testdataPath, initialDir string, ) (string, *Framework, error)
SetupDockerWorkspaceAndUp is SetupDockerWorkspace followed by devsy up.
func (*Framework) CleanupWorkspace ¶ added in v1.18.0
CleanupWorkspace gives cleanup a fresh, bounded context. Ginkgo cleanup may run after the spec context has expired, so inheriting its cancellation can silently skip the workspace deletion.
func (*Framework) DevsyBuild ¶
func (*Framework) DevsyContextCreate ¶
func (*Framework) DevsyContextDelete ¶
func (*Framework) DevsyContextUse ¶
func (*Framework) DevsyIDEList ¶
func (*Framework) DevsyIDEUse ¶
func (*Framework) DevsyListParsed ¶
func (*Framework) DevsyMachineCreate ¶
func (*Framework) DevsyMachineDelete ¶
func (*Framework) DevsyPortTest ¶
func (*Framework) DevsyProviderAdd ¶
func (*Framework) DevsyProviderAddDocker ¶ added in v1.24.0
DevsyProviderAddDocker adds a docker provider called name, using podman as DOCKER_PATH when DOCKER_HOST points at a podman socket.
func (*Framework) DevsyProviderDelete ¶
func (*Framework) DevsyProviderFindOption ¶
func (*Framework) DevsyProviderList ¶
func (*Framework) DevsyProviderOptionsCheckNamespaceDescription ¶
func (*Framework) DevsyProviderOptionsJSON ¶
func (f *Framework) DevsyProviderOptionsJSON( ctx context.Context, providerName string, ) (string, error)
DevsyProviderOptionsJSON executes `devsy provider get --result-format 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) DevsyProviderSetSource ¶ added in v1.3.1
func (*Framework) DevsyProviderUse ¶
func (*Framework) DevsyRename ¶ added in v1.3.0
func (f *Framework) DevsyRename( ctx context.Context, oldName, newName string, args ...string, ) error
DevsyRename executes the `devsy rename` command in the test framework.
func (*Framework) DevsySSHEchoTestString ¶
func (*Framework) DevsySSHGpgSecretKeyForwarded ¶ added in v1.11.0
func (*Framework) DevsySSHOnce ¶ added in v1.18.0
func (f *Framework) DevsySSHOnce( ctx context.Context, workspace string, command string, ) (string, error)
DevsySSHOnce performs a single SSH attempt. It is intended for readiness polling, where retrying inside the polling callback can outlive the polling window and consume the enclosing spec's deadline.
func (*Framework) DevsyStatus ¶
func (*Framework) DevsyUpRecreate ¶
func (*Framework) DevsyUpReset ¶
func (*Framework) DevsyUpStreams ¶
func (*Framework) DevsyUpStreamsRaw ¶ added in v1.3.1
func (f *Framework) DevsyUpStreamsRaw( ctx context.Context, workspace string, additionalArgs ...string, ) (string, string, error)
DevsyUpStreamsRaw executes the `devsy up` command capturing stdout/stderr without injecting a default --ide flag, allowing callers to supply their own IDE selection.
func (*Framework) DevsyUpWithIDE ¶
DevsyUp executes the `devsy up` command in the test framework.
func (*Framework) DevsyWorkspaceDelete ¶
func (*Framework) DevsyWorkspaceStop ¶
func (*Framework) DevsyWorkspaceTaskCancel ¶ added in v1.20.0
DevsyWorkspaceTaskCancel cancels a detached workspace task.
func (*Framework) DevsyWorkspaceTaskList ¶ added in v1.20.0
DevsyWorkspaceTaskList returns the raw `workspace task list` JSON states.
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 ¶
ExecCommandCapture executes the command string with the devsy test binary, and returns stdout, stderr, and any error that occurred.
func (*Framework) ExecCommandJSON ¶
ExecCommandJSON runs the devsy test binary and decodes its stdout as a JSON object.
func (*Framework) ExecCommandOutput ¶
ExecCommand executes the command string with the devsy test binary.
func (*Framework) ExecCommandStdout ¶
ExecCommandStdout executes the command string with the devsy test binary.
func (*Framework) FindWorkspace ¶
type MCPClient ¶ added in v1.14.1
type MCPClient struct {
// contains filtered or unexported fields
}
type PodContainer ¶
type PodContainer struct {
Image string `json:"image,omitempty"`
SecurityContext *SecurityContext `json:"securityContext,omitempty"`
}
type PodSpec ¶
type PodSpec struct {
Containers []PodContainer `json:"containers,omitempty"`
HostUsers *bool `json:"hostUsers,omitempty"`
}
type SecurityContext ¶ added in v1.17.0
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package dockerwsl provisions and tears down the Docker daemon the Windows E2E runners use: dockerd inside WSL2, reached from the host over SSH.
|
Package dockerwsl provisions and tears down the Docker daemon the Windows E2E runners use: dockerd inside WSL2, reached from the host over SSH. |
|
Package ginkgoreport validates Ginkgo JSON reports produced by E2E runs.
|
Package ginkgoreport validates Ginkgo JSON reports produced by E2E runs. |
|
Package registryfixture owns the bounded Linux registry/proxy and helper fixtures used by native provider-consumer tests.
|
Package registryfixture owns the bounded Linux registry/proxy and helper fixtures used by native provider-consumer tests. |
|
Package runenv is the execution environment shared by the E2E CI helpers.
|
Package runenv is the execution environment shared by the E2E CI helpers. |
|
runenvtest
Package runenvtest provides in-memory fakes of the runenv seams, assembled into a Rig, for testing code written against runenv.Dependencies.
|
Package runenvtest provides in-memory fakes of the runenv seams, assembled into a Rig, for testing code written against runenv.Dependencies. |