Movatterモバイル変換


[0]ホーム

URL:


apptest

package
v2.23.0Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2025 License:AGPL-3.0Imports:39Imported by:0

Details

Repository

github.com/coder/coder

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.AgentNamestringAppSlugOrPortstring// Prefix should have ---.PrefixstringQuerystring}

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.URLFlushStats     func()}

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 {PrimaryAppHoststringAppHoststringDisablePathAppsboolDisableSubdomainAppsboolDangerousAllowPathAppSharingboolDangerousAllowPathAppSiteOwnerAccessboolServeHTTPSboolStatsCollectorOptionsworkspaceapps.StatsCollectorOptions// contains filtered or unexported fields}

DeploymentOptions are the options for creating a *Deployment with aDeploymentFactory.

typeDetails

type Details struct {*DeploymentMecodersdk.UserWorkspace *codersdk.WorkspaceAgent     *codersdk.WorkspaceAgentAppPortuint16Apps struct {FakeAppOwnerAppAuthenticatedAppPublicAppPortAppPortHTTPSApp}}

Details are the full test details returned from setupProxyTestWithFactory.

func (*Details)AppClient

func (d *Details) AppClient(t *testing.T) *codersdk.Client

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

func (d *Details) PathAppURL(appApp) *url.URL

PathAppURL returns the URL for the given path app.

func (*Details)SubdomainAppURL

func (d *Details) SubdomainAppURL(appApp) *url.URL

SubdomainAppURL returns the URL for the given subdomain app.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp