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/06/14 20:28:13 UTC

[trafficcontrol] branch master updated: Fix go CRConfig edgelocations 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/trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new 2d30129  Fix go CRConfig edgelocations test
2d30129 is described below

commit 2d30129d518d7723c8ee5b8d75920c122310a749
Author: Rawlin Peters <ra...@comcast.com>
AuthorDate: Thu Jun 14 14:17:43 2018 -0600

    Fix go CRConfig edgelocations test
    
    Expect two more columns and more Queries.
---
 traffic_ops/traffic_ops_golang/crconfig/edgelocations_test.go | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/traffic_ops/traffic_ops_golang/crconfig/edgelocations_test.go b/traffic_ops/traffic_ops_golang/crconfig/edgelocations_test.go
index a8b4918..aa78141 100644
--- a/traffic_ops/traffic_ops_golang/crconfig/edgelocations_test.go
+++ b/traffic_ops/traffic_ops_golang/crconfig/edgelocations_test.go
@@ -40,14 +40,19 @@ func ExpectedMakeLocations() (map[string]tc.CRConfigLatitudeLongitude, map[strin
 }
 
 func MockMakeLocations(mock sqlmock.Sqlmock, expectedEdgeLocs map[string]tc.CRConfigLatitudeLongitude, expectedRouterLocs map[string]tc.CRConfigLatitudeLongitude, cdn string) {
-	rows := sqlmock.NewRows([]string{"name", "type", "latitude", "longitude"})
+	rows := sqlmock.NewRows([]string{"name", "id", "type", "latitude", "longitude", "fallback_to_closest"})
 	for s, l := range expectedEdgeLocs {
-		rows = rows.AddRow(s, EdgeTypePrefix, l.Lat, l.Lon)
+		rows = rows.AddRow(s, 1, EdgeTypePrefix, l.Lat, l.Lon, false)
 	}
 	for s, l := range expectedRouterLocs {
-		rows = rows.AddRow(s, RouterTypeName, l.Lat, l.Lon)
+		rows = rows.AddRow(s, 1, RouterTypeName, l.Lat, l.Lon, false)
 	}
 	mock.ExpectQuery("select").WithArgs(cdn).WillReturnRows(rows)
+
+	fallbackRows := sqlmock.NewRows([]string{"name"})
+	for range expectedEdgeLocs {
+		mock.ExpectQuery("select").WithArgs(1).WillReturnRows(fallbackRows)
+	}
 }
 
 func TestMakeLocations(t *testing.T) {

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