workspacebuild

package
v2.38.6 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: AGPL-3.0 Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CleanupRunner

type CleanupRunner struct {
	// contains filtered or unexported fields
}

CleanupRunner is a runner that deletes a workspace in the Run phase.

func NewCleanupRunner

func NewCleanupRunner(client *codersdk.Client, workspaceID uuid.UUID) *CleanupRunner

func (*CleanupRunner) Run

func (r *CleanupRunner) Run(ctx context.Context, _ string, logs io.Writer) error

Run implements Runnable.

type Config

type Config struct {
	// OrganizationID is the ID of the organization to create the workspace in.
	OrganizationID uuid.UUID `json:"organization_id"`
	// UserID is the ID of the user to run the test as.
	UserID string `json:"user_id"`
	// Request is the request to send to the Coder API to create the workspace.
	// request.template_id must be set. A name will be generated if not
	// specified.
	Request codersdk.CreateWorkspaceRequest `json:"request"`
	// NoWaitForAgents determines whether the test should wait for the workspace
	// agents to connect before returning.
	NoWaitForAgents bool `json:"no_wait_for_agents"`
	// NoWaitForBuild determines whether the test should wait for the workspace
	// build to complete before returning.
	NoWaitForBuild bool `json:"no_wait_for_build"`
	// Retry determines how many times to retry starting a workspace build if it
	// fails.
	Retry int `json:"retry"`
}

func (Config) Validate

func (c Config) Validate() error

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

func NewRunner

func NewRunner(client *codersdk.Client, cfg Config) *Runner

func (*Runner) Cleanup

func (r *Runner) Cleanup(ctx context.Context, id string, w io.Writer) error

Cleanup implements Cleanable by wrapping CleanupRunner.

func (*Runner) RunReturningWorkspace added in v2.27.0

func (r *Runner) RunReturningWorkspace(ctx context.Context, id string, logs io.Writer) (SlimWorkspace, error)

Run implements Runnable.

type SlimWorkspace added in v2.29.0

type SlimWorkspace struct {
	ID   uuid.UUID
	Name string
}

Jump to

Keyboard shortcuts

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