apptest
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Index¶
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
funcRun¶
func Run(t *testing.T, appHostIsPrimarybool, factoryDeploymentFactory)
Run runs the entire workspace app test suite against deployments mintedby the provided factory.
appHostIsPrimary is true if the app host is also the primary coder APIserver. This disables any tests that test API passthrough or rely on theapp server not being the API server.nolint:revive
Types¶
typeApp¶
type App struct {UsernamestringWorkspaceNamestring// 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.AgentNamestringAppSlugOrPortstringQuerystring}
App is similar to httpapi.ApplicationURL but with a Query field.
typeDeployment¶
type Deployment struct {Options *DeploymentOptions// SDKClient should be logged in as the admin user.SDKClient *codersdk.ClientFirstUsercodersdk.CreateFirstUserResponsePathAppBaseURL *url.URL}
Deployment is a license-agnostic deployment with all the fields that appstests need.
typeDeploymentFactory¶
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.
typeDeploymentOptions¶
type DeploymentOptions struct {AppHoststringDisablePathAppsboolDisableSubdomainAppsboolDangerousAllowPathAppSharingboolDangerousAllowPathAppSiteOwnerAccessboolServeHTTPSbool// contains filtered or unexported fields}
DeploymentOptions are the options for creating a *Deployment with aDeploymentFactory.
typeDetails¶added inv0.23.0
type Details struct {*DeploymentMecodersdk.UserWorkspace *codersdk.WorkspaceAgent *codersdk.WorkspaceAgentAppPortuint16Apps struct {FakeAppOwnerAppAuthenticatedAppPublicAppPortApp}}
Details are the full test details returned from setupProxyTestWithFactory.
func (*Details)AppClient¶added inv0.23.0
AppClient returns a *codersdk.Client that will route all requests to theapp server. API requests will fail with this client. Any redirect responsesare not followed by default.
The client is authenticated as the first user by default.
func (*Details)PathAppURL¶added inv0.23.0
PathAppURL returns the URL for the given path app.