feat: Add --raw-url to coder server postgres-builtin-* commands (#5478)

This commit is contained in:
Mathias Fredriksson
2022-12-20 20:51:17 +02:00
committed by GitHub
parent 50dfc2082b
commit c7ce3e70da
2 changed files with 39 additions and 13 deletions

View File

@ -118,6 +118,19 @@ func TestServer(t *testing.T) {
pty.ExpectMatch("psql")
})
t.Run("BuiltinPostgresURLRaw", func(t *testing.T) {
t.Parallel()
root, _ := clitest.New(t, "server", "postgres-builtin-url", "--raw-url")
pty := ptytest.New(t)
root.SetOutput(pty.Output())
err := root.Execute()
require.NoError(t, err)
got := pty.ReadLine()
if !strings.HasPrefix(got, "postgres://") {
t.Fatalf("expected postgres URL to start with \"postgres://\", got %q", got)
}
})
// Validate that a warning is printed that it may not be externally
// reachable.