From fb3980ce9d8bb64c0c97ea6547aacb5cf6c1c111 Mon Sep 17 00:00:00 2001 From: krhubert Date: Thu, 11 Aug 2016 11:41:48 +0200 Subject: [PATCH] Use config.http.addr and config.http.ssl for create baseURL test server --- revel/test.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/revel/test.go b/revel/test.go index 10d5bac..5c8b38b 100644 --- a/revel/test.go +++ b/revel/test.go @@ -97,8 +97,18 @@ func testApp(args []string) { defer cmd.Kill() revel.INFO.Printf("Testing %s (%s) in %s mode\n", revel.AppName, revel.ImportPath, mode) + var httpAddr = revel.HttpAddr + if httpAddr == "" { + httpAddr = "127.0.0.1" + } + + var httpProto = "http" + if revel.HttpSsl { + httpProto = "httpss" + } + // Get a list of tests - var baseURL = fmt.Sprintf("http://127.0.0.1:%d", revel.HTTPPort) + var baseURL = fmt.Sprintf("%s://%s:%d", httpProto, httpAddr, revel.HTTPPort) testSuites, _ := getTestsList(baseURL) // If a specific TestSuite[.Method] is specified, only run that suite/test