Skip to content

Commit

Permalink
Fix unit test breakage due to the last commits
Browse files Browse the repository at this point in the history
  • Loading branch information
Carrotman42 committed Mar 15, 2017
1 parent e0df965 commit 8805f88
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions cmd/cloud_sql_proxy/proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,28 @@ func TestCreateInstanceConfigs(t *testing.T) {
"", true, nil, "", true,
}, {
"setting -fuse, -dir, and -instances",
"dir", true, []string{"x"}, "", true,
"dir", true, []string{"proj:reg:x"}, "", true,
}, {
"setting -fuse, -dir, and -instances_metadata",
"dir", true, nil, "md", true,
}, {
"setting -dir and -instances (unix socket)",
"dir", false, []string{"x"}, "", false,
"dir", false, []string{"proj:reg:x"}, "", false,
}, {
"Seting -instance (unix socket)",
"", false, []string{"x"}, "", true,
"", false, []string{"proj:reg:x"}, "", true,
}, {
"setting -instance (tcp socket)",
"", false, []string{"x=tcp:1234"}, "", false,
"", false, []string{"proj:reg:x=tcp:1234"}, "", false,
}, {
"setting -instance (tcp socket) and -instances_metadata",
"", false, []string{"x=tcp:1234"}, "md", true,
"", false, []string{"proj:reg:x=tcp:1234"}, "md", true,
}, {
"setting -dir, -instance (tcp socket), and -instances_metadata",
"dir", false, []string{"x=tcp:1234"}, "md", false,
"dir", false, []string{"proj:reg:x=tcp:1234"}, "md", false,
}, {
"setting -dir, -instance (unix socket), and -instances_metadata",
"dir", false, []string{"x"}, "md", false,
"dir", false, []string{"proj:reg:x"}, "md", false,
}, {
"setting -dir and -instances_metadata",
"dir", false, nil, "md", false,
Expand Down Expand Up @@ -103,31 +103,31 @@ func TestParseInstanceConfig(t *testing.T) {
wantErr bool
}{
{
"/x", "my-instance",
instanceConfig{"my-instance", "unix", "/x/my-instance"},
"/x", "my-proj:my-reg:my-instance",
instanceConfig{"my-proj:my-reg:my-instance", "unix", "/x/my-proj:my-reg:my-instance"},
false,
}, {
"/x", "my-instance=tcp:1234",
instanceConfig{"my-instance", "tcp", "127.0.0.1:1234"},
"/x", "my-proj:my-reg:my-instance=tcp:1234",
instanceConfig{"my-proj:my-reg:my-instance", "tcp", "127.0.0.1:1234"},
false,
}, {
"/x", "my-instance=tcp:my-host:1111",
instanceConfig{"my-instance", "tcp", "my-host:1111"},
"/x", "my-proj:my-reg:my-instance=tcp:my-host:1111",
instanceConfig{"my-proj:my-reg:my-instance", "tcp", "my-host:1111"},
false,
}, {
"/x", "my-instance=",
"/x", "my-proj:my-reg:my-instance=",
instanceConfig{},
true,
}, {
"/x", "my-instance=cool network",
"/x", "my-proj:my-reg:my-instance=cool network",
instanceConfig{},
true,
}, {
"/x", "my-instance=cool network:1234",
"/x", "my-proj:my-reg:my-instance=cool network:1234",
instanceConfig{},
true,
}, {
"/x", "my-instance=oh:so:many:colons",
"/x", "my-proj:my-reg:my-instance=oh:so:many:colons",
instanceConfig{},
true,
},
Expand All @@ -138,6 +138,9 @@ func TestParseInstanceConfig(t *testing.T) {
t.Errorf("parseInstanceConfig(%s, %s) = %+v, wanted error", got)
}
continue
} else if err != nil {
t.Errorf("parseInstanceConfig(%s, %s) had unexpected error: %v", v.dir, v.instance, err)
continue
}
if got != v.wantCfg {
t.Errorf("parseInstanceConfig(%s, %s) = %+v, want %+v", v.dir, v.instance, got, v.wantCfg)
Expand Down

0 comments on commit 8805f88

Please sign in to comment.