MCPcopy Index your code
hub / github.com/coder/coder / TestServerYAMLConfig

Function TestServerYAMLConfig

cli/server_test.go:2396–2419  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2394}
2395
2396func TestServerYAMLConfig(t *testing.T) {
2397 t.Parallel()
2398
2399 var deployValues codersdk.DeploymentValues
2400 opts := deployValues.Options()
2401
2402 err := opts.SetDefaults()
2403 require.NoError(t, err)
2404
2405 n, err := opts.MarshalYAML()
2406 require.NoError(t, err)
2407
2408 // Sanity-check that we can read the config back in.
2409 err = opts.UnmarshalYAML(n.(*yaml.Node))
2410 require.NoError(t, err)
2411
2412 var wantBuf bytes.Buffer
2413 enc := yaml.NewEncoder(&wantBuf)
2414 enc.SetIndent(2)
2415 err = enc.Encode(n)
2416 require.NoError(t, err)
2417
2418 clitest.TestGoldenFile(t, "server-config.yaml", wantBuf.Bytes(), nil)
2419}
2420
2421func TestConnectToPostgres(t *testing.T) {
2422 t.Parallel()

Callers

nothing calls this directly

Calls 4

OptionsMethod · 0.95
TestGoldenFileFunction · 0.92
EncodeMethod · 0.80
BytesMethod · 0.45

Tested by

no test coverage detected