From 921b9b3d6e6f78b7d17d2cbd5eaf92c4ea080d77 Mon Sep 17 00:00:00 2001 From: Budhram Gurung Date: Thu, 8 Oct 2015 12:28:24 +0530 Subject: [PATCH 1/2] Fixing test by removing location format * Getting error "App name must be ^[A-Za-z0-9-]+$" as time.Now().Format("2006-01-02T15-04-05-0700") is producing '+' in time("2015-10-08T07-01-56+0000") which regex doesn't allow --- src/atlantis/manager/client/client_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/atlantis/manager/client/client_test.go b/src/atlantis/manager/client/client_test.go index 666b6c6..fc74e6d 100644 --- a/src/atlantis/manager/client/client_test.go +++ b/src/atlantis/manager/client/client_test.go @@ -114,7 +114,7 @@ func checkCommand(t *testing.T, command interface{}, line string, expected inter } func TestRegisterApp(t *testing.T) { - testName := "e2e-test-" + time.Now().Format("2006-01-02T15-04-05-0700") + testName := "e2e-test-" + time.Now().Format("2006-01-02T15-04-05") log.Print("== Registering dummy app ==") registerCommand := &RegisterAppCommand{Name: testName, Repo: "fake-git-repo", Root: "/path/to/app", @@ -163,7 +163,7 @@ func checkUrl(t *testing.T, url, name, expected string) bool { } func TestFullDeploy(t *testing.T) { - testName := "e2e-test-" + time.Now().Format("2006-01-02T15-04-05-0700") + testName := "e2e-test-" + time.Now().Format("2006-01-02T15-04-05") checkCommand(t, &ListAppsCommand{}, "", &ManagerListAppsReply{[]string{"hello-go"}, "OK"}) From 27b7d2f82b7cedebabaadee10a4b6bb5f7a7456b Mon Sep 17 00:00:00 2001 From: Budhram Gurung Date: Mon, 12 Oct 2015 10:58:11 +0000 Subject: [PATCH 2/2] Specific error when port not found in GetAppEnv Command --- src/atlantis/manager/rpc/router.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/atlantis/manager/rpc/router.go b/src/atlantis/manager/rpc/router.go index f005bfc..5324f46 100644 --- a/src/atlantis/manager/rpc/router.go +++ b/src/atlantis/manager/rpc/router.go @@ -61,6 +61,10 @@ func (e *GetAppEnvPortExecutor) Execute(t *Task) (err error) { zrp := datamodel.GetRouterPorts(zkApp.Internal) fmt.Printf("ROUTER PORTS: %+v\n", zrp) portStr := zrp.AppEnvMap[helper.GetAppEnvTrieName(e.arg.App, e.arg.Env)] + if portStr == "" { + return errors.New("port not found") + } + fmt.Printf("PORT STRING: %+v -> %+v\n", helper.GetAppEnvTrieName(e.arg.App, e.arg.Env), portStr) port, err := strconv.ParseUint(portStr, 10, 16) if err != nil {