Skip to content

Commit e8d675a

Browse files
committed
fixup tests
1 parent ed4410c commit e8d675a

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

coderd/workspaceapps/apptest/apptest.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,9 @@ func Run(t *testing.T, appHostIsPrimary bool, factory DeploymentFactory) {
968968
// Manually specifying a port should override the access url port on
969969
// the app host.
970970
appDetails := setupProxyTest(t, &DeploymentOptions{
971-
AppHost: "*.test.coder.com:4444",
971+
// Just throw both the wsproxy and primary to same url.
972+
AppHost: "*.test.coder.com:4444",
973+
PrimaryAppHost: "*.test.coder.com:4444",
972974
})
973975

974976
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)

coderd/workspaceapps/apptest/setup.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const (
4747
// DeploymentOptions are the options for creating a *Deployment with a
4848
// DeploymentFactory.
4949
type DeploymentOptions struct {
50+
PrimaryAppHost string
5051
AppHost string
5152
DisablePathApps bool
5253
DisableSubdomainApps bool

coderd/workspaceproxies.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/coder/coder/v2/coderd/database"
1212
"github.com/coder/coder/v2/coderd/database/dbauthz"
1313
"github.com/coder/coder/v2/coderd/httpapi"
14+
"github.com/coder/coder/v2/coderd/workspaceapps/appurl"
1415
"github.com/coder/coder/v2/codersdk"
1516
)
1617

@@ -43,7 +44,7 @@ func (api *API) PrimaryRegion(ctx context.Context) (codersdk.Region, error) {
4344
IconURL: proxy.IconUrl,
4445
Healthy: true,
4546
PathAppURL: api.AccessURL.String(),
46-
WildcardHostname: api.AppHostname,
47+
WildcardHostname: appurl.SubdomainAppHost(api.AppHostname, api.AccessURL),
4748
}, nil
4849
}
4950

enterprise/wsproxy/wsproxy_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,10 +449,13 @@ func TestWorkspaceProxyWorkspaceApps(t *testing.T) {
449449
<-proxyStatsCollectorFlushDone
450450
}
451451

452+
if opts.PrimaryAppHost == "" {
453+
opts.PrimaryAppHost = "*.primary.test.coder.com"
454+
}
452455
client, closer, api, user := coderdenttest.NewWithAPI(t, &coderdenttest.Options{
453456
Options: &coderdtest.Options{
454457
DeploymentValues: deploymentValues,
455-
AppHostname: "*.primary.test.coder.com",
458+
AppHostname: opts.PrimaryAppHost,
456459
IncludeProvisionerDaemon: true,
457460
RealIPConfig: &httpmw.RealIPConfig{
458461
TrustedOrigins: []*net.IPNet{{

0 commit comments

Comments
 (0)