Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
func Run(t *testing.T, appHostIsPrimary bool, factory DeploymentFactory)
Run runs the entire workspace app test suite against deployments minted by the provided factory.
appHostIsPrimary is true if the app host is also the primary coder API server. This disables any tests that test API passthrough or rely on the app server not being the API server. nolint:revive
Types ¶
type App ¶
type App struct { Username string WorkspaceName string // AgentName is optional, except for when proxying to a port. AgentName is // always ignored when making a path app URL. // // Set WorkspaceName to `workspace.agent` if you want to generate a path app // URL with an agent name. AgentName string AppSlugOrPort string Query string }
App is similar to httpapi.ApplicationURL but with a Query field.
type Deployment ¶
type Deployment struct { Options *DeploymentOptions // SDKClient should be logged in as the admin user. SDKClient *codersdk.Client FirstUser codersdk.CreateFirstUserResponse PathAppBaseURL *url.URL }
Deployment is a license-agnostic deployment with all the fields that apps tests need.
type DeploymentFactory ¶
type DeploymentFactory func(t *testing.T, opts *DeploymentOptions) *Deployment
DeploymentFactory generates a deployment with an API client, a path base URL, and a subdomain app host URL.
type DeploymentOptions ¶
type DeploymentOptions struct { AppHost string DisablePathApps bool DisableSubdomainApps bool DangerousAllowPathAppSharing bool DangerousAllowPathAppSiteOwnerAccess bool // contains filtered or unexported fields }
DeploymentOptions are the options for creating a *Deployment with a DeploymentFactory.
type Details ¶ added in v0.23.0
type Details struct { *Deployment Me codersdk.User Workspace *codersdk.Workspace Agent *codersdk.WorkspaceAgent AppPort uint16 Apps struct { Fake App Owner App Authenticated App Public App Port App } }
Details are the full test details returned from setupProxyTestWithFactory.
func (*Details) AppClient ¶ added in v0.23.0
AppClient returns a *codersdk.Client that will route all requests to the app server. API requests will fail with this client. Any redirect responses are not followed by default.
The client is authenticated as the first user by default.
func (*Details) PathAppURL ¶ added in v0.23.0
PathAppURL returns the URL for the given path app.