From 857640a6392547985395bfb413a2b5bca592c1f1 Mon Sep 17 00:00:00 2001 From: Dean Sheather Date: Fri, 21 Apr 2023 10:14:41 +0000 Subject: [PATCH] chore: fix lint in main caused by incompatible merge --- enterprise/coderd/workspaceproxy_test.go | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/enterprise/coderd/workspaceproxy_test.go b/enterprise/coderd/workspaceproxy_test.go index e9a41cf5da31a..ea391dfee63af 100644 --- a/enterprise/coderd/workspaceproxy_test.go +++ b/enterprise/coderd/workspaceproxy_test.go @@ -214,7 +214,7 @@ func TestReconnectingPTYSignedToken(t *testing.T) { } db, pubsub := dbtestutil.NewDB(t) - client := coderdenttest.New(t, &coderdenttest.Options{ + client, closer, api := coderdenttest.NewWithAPI(t, &coderdenttest.Options{ Options: &coderdtest.Options{ DeploymentValues: dv, Database: db, @@ -222,6 +222,9 @@ func TestReconnectingPTYSignedToken(t *testing.T) { IncludeProvisionerDaemon: true, }, }) + t.Cleanup(func() { + closer.Close() + }) user := coderdtest.CreateFirstUser(t, client) _ = coderdenttest.AddLicense(t, client, coderdenttest.LicenseOptions{ @@ -253,19 +256,18 @@ func TestReconnectingPTYSignedToken(t *testing.T) { t.Cleanup(func() { _ = agentCloser.Close() }) - coderdtest.AwaitWorkspaceAgents(t, client, workspace.ID) - createProxyCtx := testutil.Context(t, testutil.WaitLong) - proxyRes, err := client.CreateWorkspaceProxy(createProxyCtx, codersdk.CreateWorkspaceProxyRequest{ - Name: namesgenerator.GetRandomName(1), - Icon: "/emojis/flag.png", - URL: "https://" + namesgenerator.GetRandomName(1) + ".com", - WildcardHostname: "*.sub.example.com", - }) + proxyURL, err := url.Parse(fmt.Sprintf("https://%s.com", namesgenerator.GetRandomName(1))) require.NoError(t, err) - u, err := url.Parse(proxyRes.Proxy.URL) + _ = coderdenttest.NewWorkspaceProxy(t, api, client, &coderdenttest.ProxyOptions{ + Name: namesgenerator.GetRandomName(1), + ProxyURL: proxyURL, + AppHostname: "*.sub.example.com", + }) + + u, err := url.Parse(proxyURL.String()) require.NoError(t, err) if u.Scheme == "https" { u.Scheme = "wss"