ci: enable gocognit (#9359)

And, bring the server under 300:

* Removed the undocumented "disable" STUN address in favor of the
--disable-direct flag.
This commit is contained in:
Ammar Bandukwala
2023-08-27 14:46:44 -05:00
committed by GitHub
parent 173aac959c
commit 6ba92ef924
14 changed files with 263 additions and 272 deletions
-25
View File
@@ -1496,31 +1496,6 @@ func TestServer(t *testing.T) {
w.RequireSuccess()
})
})
t.Run("DisableDERP", func(t *testing.T) {
t.Parallel()
// Make sure that $CODER_DERP_SERVER_STUN_ADDRESSES can be set to
// disable STUN.
inv, cfg := clitest.New(t,
"server",
"--in-memory",
"--http-address", ":0",
"--access-url", "https://example.com",
)
inv.Environ.Set("CODER_DERP_SERVER_STUN_ADDRESSES", "disable")
ptytest.New(t).Attach(inv)
clitest.Start(t, inv)
gotURL := waitAccessURL(t, cfg)
client := codersdk.New(gotURL)
ctx := testutil.Context(t, testutil.WaitMedium)
_ = coderdtest.CreateFirstUser(t, client)
gotConfig, err := client.DeploymentConfig(ctx)
require.NoError(t, err)
require.Len(t, gotConfig.Values.DERP.Server.STUNAddresses, 0)
})
}
func TestServer_Production(t *testing.T) {