@@ -87,8 +87,8 @@ type App struct {
87
87
Query string
88
88
}
89
89
90
- // AppDetails are the full test details returned from setupProxyTestWithFactory.
91
- type AppDetails struct {
90
+ // Details are the full test details returned from setupProxyTestWithFactory.
91
+ type Details struct {
92
92
* Deployment
93
93
94
94
Me codersdk.User
@@ -112,7 +112,7 @@ type AppDetails struct {
112
112
// are not followed by default.
113
113
//
114
114
// The client is authenticated as the first user by default.
115
- func (d * AppDetails ) AppClient (t * testing.T ) * codersdk.Client {
115
+ func (d * Details ) AppClient (t * testing.T ) * codersdk.Client {
116
116
client := codersdk .New (d .PathAppBaseURL )
117
117
client .SetSessionToken (d .SDKClient .SessionToken ())
118
118
forceURLTransport (t , client )
@@ -124,7 +124,7 @@ func (d *AppDetails) AppClient(t *testing.T) *codersdk.Client {
124
124
}
125
125
126
126
// PathAppURL returns the URL for the given path app.
127
- func (d * AppDetails ) PathAppURL (app App ) * url.URL {
127
+ func (d * Details ) PathAppURL (app App ) * url.URL {
128
128
appPath := fmt .Sprintf ("/@%s/%s/apps/%s" , app .Username , app .WorkspaceName , app .AppSlugOrPort )
129
129
130
130
u := * d .PathAppBaseURL
@@ -135,7 +135,7 @@ func (d *AppDetails) PathAppURL(app App) *url.URL {
135
135
}
136
136
137
137
// SubdomainAppURL returns the URL for the given subdomain app.
138
- func (d * AppDetails ) SubdomainAppURL (app App ) * url.URL {
138
+ func (d * Details ) SubdomainAppURL (app App ) * url.URL {
139
139
host := fmt .Sprintf ("%s--%s--%s--%s" , app .AppSlugOrPort , app .AgentName , app .WorkspaceName , app .Username )
140
140
141
141
u := * d .PathAppBaseURL
@@ -151,7 +151,7 @@ func (d *AppDetails) SubdomainAppURL(app App) *url.URL {
151
151
// 3. Create a template version, template and workspace with many apps.
152
152
// 4. Start a workspace agent.
153
153
// 5. Returns details about the deployment and its apps.
154
- func setupProxyTestWithFactory (t * testing.T , factory DeploymentFactory , opts * DeploymentOptions ) * AppDetails {
154
+ func setupProxyTestWithFactory (t * testing.T , factory DeploymentFactory , opts * DeploymentOptions ) * Details {
155
155
if opts == nil {
156
156
opts = & DeploymentOptions {}
157
157
}
@@ -178,7 +178,7 @@ func setupProxyTestWithFactory(t *testing.T, factory DeploymentFactory, opts *De
178
178
require .NoError (t , err )
179
179
180
180
if opts .noWorkspace {
181
- return & AppDetails {
181
+ return & Details {
182
182
Deployment : deployment ,
183
183
Me : me ,
184
184
}
@@ -189,7 +189,7 @@ func setupProxyTestWithFactory(t *testing.T, factory DeploymentFactory, opts *De
189
189
}
190
190
workspace , agnt := createWorkspaceWithApps (t , deployment .SDKClient , deployment .FirstUser .OrganizationID , me , opts .port )
191
191
192
- return & AppDetails {
192
+ return & Details {
193
193
Deployment : deployment ,
194
194
Me : me ,
195
195
Workspace : & workspace ,
@@ -336,8 +336,12 @@ func createWorkspaceWithApps(t *testing.T, client *codersdk.Client, orgID uuid.U
336
336
agentClient .SetSessionToken (authToken )
337
337
338
338
// TODO (@dean): currently, the primary app host is used when generating
339
- // this URL and we don't have any plans to change that until we let
340
- // templates pick which proxy they want to use.
339
+ // the port URL we tell the agent to use. We don't have any plans to change
340
+ // that until we let templates pick which proxy they want to use in the
341
+ // terraform.
342
+ //
343
+ // This means that all port URLs generated in code-server etc. will be sent
344
+ // to the primary.
341
345
appHostCtx := testutil .Context (t , testutil .WaitLong )
342
346
primaryAppHost , err := client .AppHost (appHostCtx )
343
347
require .NoError (t , err )
0 commit comments