You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by da...@apache.org on 2018/04/27 20:01:37 UTC

[incubator-trafficcontrol] 02/02: fix config test

This is an automated email from the ASF dual-hosted git repository.

dangogh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit 3f5a7ed25500279a860bb03e836bcd2c00ffb328
Author: Dan Kirkwood <da...@apache.org>
AuthorDate: Thu Apr 26 15:28:18 2018 -0600

    fix config test
---
 traffic_ops/traffic_ops_golang/config/config_test.go | 11 ++++++-----
 traffic_ops/traffic_ops_golang/routing_test.go       |  3 ++-
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/traffic_ops/traffic_ops_golang/config/config_test.go b/traffic_ops/traffic_ops_golang/config/config_test.go
index 7e7ef8f..1bd73d6 100644
--- a/traffic_ops/traffic_ops_golang/config/config_test.go
+++ b/traffic_ops/traffic_ops_golang/config/config_test.go
@@ -167,6 +167,7 @@ const (
 func TestLoadConfig(t *testing.T) {
 	var err error
 	var exp string
+	version := "Test Version"
 
 	// set up config paths
 	badPath := "/invalid-path/no-file-exists-here"
@@ -195,35 +196,35 @@ func TestLoadConfig(t *testing.T) {
 	defer os.Remove(goodRiakCfg) // clean up
 
 	// test bad paths
-	_, err = LoadConfig(badPath, badPath, badPath)
+	_, err = LoadConfig(badPath, badPath, badPath, version)
 	exp = fmt.Sprintf("reading CDN conf '%s'", badPath)
 	if !strings.HasPrefix(err.Error(), exp) {
 		t.Error("expected", exp, "got", err)
 	}
 
 	// bad json in cdn.conf
-	_, err = LoadConfig(badCfg, badCfg, badPath)
+	_, err = LoadConfig(badCfg, badCfg, badPath, version)
 	exp = fmt.Sprintf("unmarshalling '%s'", badCfg)
 	if !strings.HasPrefix(err.Error(), exp) {
 		t.Error("expected", exp, "got", err)
 	}
 
 	// good cdn.conf, bad db conf
-	_, err = LoadConfig(goodCfg, badPath, badPath)
+	_, err = LoadConfig(goodCfg, badPath, badPath, version)
 	exp = fmt.Sprintf("reading db conf '%s'", badPath)
 	if !strings.HasPrefix(err.Error(), exp) {
 		t.Error("expected", exp, "got", err)
 	}
 
 	// good cdn.conf,  bad json in database.conf
-	_, err = LoadConfig(goodCfg, badCfg, badPath)
+	_, err = LoadConfig(goodCfg, badCfg, badPath, version)
 	exp = fmt.Sprintf("unmarshalling '%s'", badCfg)
 	if !strings.HasPrefix(err.Error(), exp) {
 		t.Error("expected", exp, "got", err)
 	}
 
 	// good cdn.conf,  good database.conf
-	cfg, err = LoadConfig(goodCfg, goodDbCfg, goodRiakCfg)
+	cfg, err = LoadConfig(goodCfg, goodDbCfg, goodRiakCfg, version)
 	if err != nil {
 		t.Error("Good config -- unexpected error ", err)
 	}
diff --git a/traffic_ops/traffic_ops_golang/routing_test.go b/traffic_ops/traffic_ops_golang/routing_test.go
index 8537aa1..32a761e 100644
--- a/traffic_ops/traffic_ops_golang/routing_test.go
+++ b/traffic_ops/traffic_ops_golang/routing_test.go
@@ -68,7 +68,8 @@ func TestCreateRouteMap(t *testing.T) {
 		{1.2, http.MethodGet, `path3`, PathThreeHandler, 0, false, []Middleware{}},
 	}
 
-	routeMap := CreateRouteMap(routes, authBase)
+	rawRoutes := []RawRoute{}
+	routeMap := CreateRouteMap(routes, rawRoutes, authBase)
 
 	route1Handler := routeMap["GET"][0].Handler
 

-- 
To stop receiving notification emails like this one, please contact
dangogh@apache.org.