mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Cleaning API tests from redundant route delete on each test
This commit is contained in:
@@ -62,7 +62,6 @@ func TestCalls(t *testing.T) {
|
|||||||
t.Error("Must fail because `dummy` call does not exist.")
|
t.Error("Must fail because `dummy` call does not exist.")
|
||||||
}
|
}
|
||||||
|
|
||||||
DeleteRoute(t, s.Context, s.Client, s.AppName, s.RoutePath)
|
|
||||||
DeleteApp(t, s.Context, s.Client, s.AppName)
|
DeleteApp(t, s.Context, s.Client, s.AppName)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -97,7 +96,6 @@ func TestCalls(t *testing.T) {
|
|||||||
t.Errorf("Unexpected error occurred: %v.", msg)
|
t.Errorf("Unexpected error occurred: %v.", msg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DeleteRoute(t, s.Context, s.Client, s.AppName, s.RoutePath)
|
|
||||||
DeleteApp(t, s.Context, s.Client, s.AppName)
|
DeleteApp(t, s.Context, s.Client, s.AppName)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -135,7 +133,6 @@ func TestCalls(t *testing.T) {
|
|||||||
t.Errorf("Call path mismatch.\n\tExpected: %v\n\tActual: %v", c.Path, s.RoutePath)
|
t.Errorf("Call path mismatch.\n\tExpected: %v\n\tActual: %v", c.Path, s.RoutePath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DeleteRoute(t, s.Context, s.Client, s.AppName, s.RoutePath)
|
|
||||||
DeleteApp(t, s.Context, s.Client, s.AppName)
|
DeleteApp(t, s.Context, s.Client, s.AppName)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ func TestRouteExecutions(t *testing.T) {
|
|||||||
if !strings.Contains(expectedOutput, output.String()) {
|
if !strings.Contains(expectedOutput, output.String()) {
|
||||||
t.Errorf("Assertion error.\n\tExpected: %v\n\tActual: %v", expectedOutput, output.String())
|
t.Errorf("Assertion error.\n\tExpected: %v\n\tActual: %v", expectedOutput, output.String())
|
||||||
}
|
}
|
||||||
DeleteRoute(t, s.Context, s.Client, s.AppName, s.RoutePath)
|
|
||||||
DeleteApp(t, s.Context, s.Client, s.AppName)
|
DeleteApp(t, s.Context, s.Client, s.AppName)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -105,7 +104,6 @@ func TestRouteExecutions(t *testing.T) {
|
|||||||
if !strings.Contains(expectedOutput, output.String()) {
|
if !strings.Contains(expectedOutput, output.String()) {
|
||||||
t.Errorf("Assertion error.\n\tExpected: %v\n\tActual: %v", expectedOutput, output.String())
|
t.Errorf("Assertion error.\n\tExpected: %v\n\tActual: %v", expectedOutput, output.String())
|
||||||
}
|
}
|
||||||
DeleteRoute(t, s.Context, s.Client, s.AppName, s.RoutePath)
|
|
||||||
DeleteApp(t, s.Context, s.Client, s.AppName)
|
DeleteApp(t, s.Context, s.Client, s.AppName)
|
||||||
|
|
||||||
})
|
})
|
||||||
@@ -132,7 +130,6 @@ func TestRouteExecutions(t *testing.T) {
|
|||||||
CheckRouteResponseError(t, err)
|
CheckRouteResponseError(t, err)
|
||||||
|
|
||||||
CallAsync(t, u, &bytes.Buffer{})
|
CallAsync(t, u, &bytes.Buffer{})
|
||||||
DeleteRoute(t, s.Context, s.Client, s.AppName, s.RoutePath)
|
|
||||||
DeleteApp(t, s.Context, s.Client, s.AppName)
|
DeleteApp(t, s.Context, s.Client, s.AppName)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -188,7 +185,6 @@ func TestRouteExecutions(t *testing.T) {
|
|||||||
t.Errorf("Call object status mismatch.\n\tExpected: %v\n\tActual:%v", "success", callObject.Status)
|
t.Errorf("Call object status mismatch.\n\tExpected: %v\n\tActual:%v", "success", callObject.Status)
|
||||||
}
|
}
|
||||||
|
|
||||||
DeleteRoute(t, s.Context, s.Client, s.AppName, s.RoutePath)
|
|
||||||
DeleteApp(t, s.Context, s.Client, s.AppName)
|
DeleteApp(t, s.Context, s.Client, s.AppName)
|
||||||
|
|
||||||
})
|
})
|
||||||
@@ -237,7 +233,6 @@ func TestRouteExecutions(t *testing.T) {
|
|||||||
"output", "callObj.Payload.Call.Status")
|
"output", "callObj.Payload.Call.Status")
|
||||||
}
|
}
|
||||||
|
|
||||||
DeleteRoute(t, s.Context, s.Client, s.AppName, routePath)
|
|
||||||
DeleteApp(t, s.Context, s.Client, s.AppName)
|
DeleteApp(t, s.Context, s.Client, s.AppName)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -283,7 +278,6 @@ func TestRouteExecutions(t *testing.T) {
|
|||||||
"string, but got: %v", logObj.Payload.Log.Log)
|
"string, but got: %v", logObj.Payload.Log.Log)
|
||||||
}
|
}
|
||||||
|
|
||||||
DeleteRoute(t, s.Context, s.Client, s.AppName, routePath)
|
|
||||||
DeleteApp(t, s.Context, s.Client, s.AppName)
|
DeleteApp(t, s.Context, s.Client, s.AppName)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -354,7 +348,6 @@ func TestRouteExecutions(t *testing.T) {
|
|||||||
t.Errorf("Unexpected error: %s", err)
|
t.Errorf("Unexpected error: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
DeleteRoute(t, s.Context, s.Client, s.AppName, routePath)
|
|
||||||
DeleteApp(t, s.Context, s.Client, s.AppName)
|
DeleteApp(t, s.Context, s.Client, s.AppName)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -399,7 +392,6 @@ func TestRouteExecutions(t *testing.T) {
|
|||||||
t.Errorf("Log entry suppose to be truncated up to expected size %v, got %v",
|
t.Errorf("Log entry suppose to be truncated up to expected size %v, got %v",
|
||||||
size/1024, len(logObj.Payload.Log.Log))
|
size/1024, len(logObj.Payload.Log.Log))
|
||||||
}
|
}
|
||||||
DeleteRoute(t, s.Context, s.Client, s.AppName, routePath)
|
|
||||||
DeleteApp(t, s.Context, s.Client, s.AppName)
|
DeleteApp(t, s.Context, s.Client, s.AppName)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ func TestRoutes(t *testing.T) {
|
|||||||
CreateApp(t, s.Context, s.Client, s.AppName, map[string]string{})
|
CreateApp(t, s.Context, s.Client, s.AppName, map[string]string{})
|
||||||
CreateRoute(t, s.Context, s.Client, s.AppName, s.RoutePath, s.Image, s.RouteType,
|
CreateRoute(t, s.Context, s.Client, s.AppName, s.RoutePath, s.Image, s.RouteType,
|
||||||
s.Format, s.RouteConfig, s.RouteHeaders)
|
s.Format, s.RouteConfig, s.RouteHeaders)
|
||||||
DeleteRoute(t, s.Context, s.Client, s.AppName, s.RoutePath)
|
|
||||||
DeleteApp(t, s.Context, s.Client, s.AppName)
|
DeleteApp(t, s.Context, s.Client, s.AppName)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -42,7 +41,6 @@ func TestRoutes(t *testing.T) {
|
|||||||
if !assertContainsRoute(ListRoutes(t, s.Context, s.Client, s.AppName), s.RoutePath) {
|
if !assertContainsRoute(ListRoutes(t, s.Context, s.Client, s.AppName), s.RoutePath) {
|
||||||
t.Errorf("Unable to find corresponding route `%v` in list", s.RoutePath)
|
t.Errorf("Unable to find corresponding route `%v` in list", s.RoutePath)
|
||||||
}
|
}
|
||||||
DeleteRoute(t, s.Context, s.Client, s.AppName, s.RoutePath)
|
|
||||||
DeleteApp(t, s.Context, s.Client, s.AppName)
|
DeleteApp(t, s.Context, s.Client, s.AppName)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -58,7 +56,6 @@ func TestRoutes(t *testing.T) {
|
|||||||
t.Errorf("Unable to find corresponding route `%v` in list", s.RoutePath)
|
t.Errorf("Unable to find corresponding route `%v` in list", s.RoutePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
DeleteRoute(t, s.Context, s.Client, s.AppName, s.RoutePath)
|
|
||||||
DeleteApp(t, s.Context, s.Client, s.AppName)
|
DeleteApp(t, s.Context, s.Client, s.AppName)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -78,7 +75,6 @@ func TestRoutes(t *testing.T) {
|
|||||||
CheckRouteResponseError(t, err)
|
CheckRouteResponseError(t, err)
|
||||||
assertRouteFields(t, routeResp.Payload.Route, s.RoutePath, s.Image, newRouteType, s.Format)
|
assertRouteFields(t, routeResp.Payload.Route, s.RoutePath, s.Image, newRouteType, s.Format)
|
||||||
|
|
||||||
DeleteRoute(t, s.Context, s.Client, s.AppName, s.RoutePath)
|
|
||||||
DeleteApp(t, s.Context, s.Client, s.AppName)
|
DeleteApp(t, s.Context, s.Client, s.AppName)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -102,7 +98,6 @@ func TestRoutes(t *testing.T) {
|
|||||||
CheckRouteResponseError(t, err)
|
CheckRouteResponseError(t, err)
|
||||||
assertRouteFields(t, routeResp.Payload.Route, s.RoutePath, s.Image, s.RouteType, s.Format)
|
assertRouteFields(t, routeResp.Payload.Route, s.RoutePath, s.Image, s.RouteType, s.Format)
|
||||||
|
|
||||||
DeleteRoute(t, s.Context, s.Client, s.AppName, s.RoutePath)
|
|
||||||
DeleteApp(t, s.Context, s.Client, s.AppName)
|
DeleteApp(t, s.Context, s.Client, s.AppName)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -122,7 +117,6 @@ func TestRoutes(t *testing.T) {
|
|||||||
t.Errorf("Route path suppose to be immutable, but it's not.")
|
t.Errorf("Route path suppose to be immutable, but it's not.")
|
||||||
}
|
}
|
||||||
|
|
||||||
DeleteRoute(t, s.Context, s.Client, s.AppName, s.RoutePath)
|
|
||||||
DeleteApp(t, s.Context, s.Client, s.AppName)
|
DeleteApp(t, s.Context, s.Client, s.AppName)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -138,7 +132,6 @@ func TestRoutes(t *testing.T) {
|
|||||||
t.Errorf("Route duplicate error should appear, but it didn't")
|
t.Errorf("Route duplicate error should appear, but it didn't")
|
||||||
}
|
}
|
||||||
|
|
||||||
DeleteRoute(t, s.Context, s.Client, s.AppName, s.RoutePath)
|
|
||||||
DeleteApp(t, s.Context, s.Client, s.AppName)
|
DeleteApp(t, s.Context, s.Client, s.AppName)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -171,7 +164,6 @@ func TestRoutes(t *testing.T) {
|
|||||||
DeployRoute(t, s.Context, s.Client, s.AppName, s.RoutePath, s.Image, s.RouteType, s.Format, s.RouteConfig, s.RouteHeaders)
|
DeployRoute(t, s.Context, s.Client, s.AppName, s.RoutePath, s.Image, s.RouteType, s.Format, s.RouteConfig, s.RouteHeaders)
|
||||||
GetApp(t, s.Context, s.Client, s.AppName)
|
GetApp(t, s.Context, s.Client, s.AppName)
|
||||||
GetRoute(t, s.Context, s.Client, s.AppName, s.RoutePath)
|
GetRoute(t, s.Context, s.Client, s.AppName, s.RoutePath)
|
||||||
DeleteRoute(t, s.Context, s.Client, s.AppName, s.RoutePath)
|
|
||||||
DeleteApp(t, s.Context, s.Client, s.AppName)
|
DeleteApp(t, s.Context, s.Client, s.AppName)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -181,7 +173,6 @@ func TestRoutes(t *testing.T) {
|
|||||||
DeployRoute(t, s.Context, s.Client, s.AppName, s.RoutePath, s.Image, s.RouteType, s.Format, s.RouteConfig, s.RouteHeaders)
|
DeployRoute(t, s.Context, s.Client, s.AppName, s.RoutePath, s.Image, s.RouteType, s.Format, s.RouteConfig, s.RouteHeaders)
|
||||||
GetApp(t, s.Context, s.Client, s.AppName)
|
GetApp(t, s.Context, s.Client, s.AppName)
|
||||||
GetRoute(t, s.Context, s.Client, s.AppName, s.RoutePath)
|
GetRoute(t, s.Context, s.Client, s.AppName, s.RoutePath)
|
||||||
DeleteRoute(t, s.Context, s.Client, s.AppName, s.RoutePath)
|
|
||||||
DeleteApp(t, s.Context, s.Client, s.AppName)
|
DeleteApp(t, s.Context, s.Client, s.AppName)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -199,8 +190,6 @@ func TestRoutes(t *testing.T) {
|
|||||||
s.Format, s.RouteConfig, s.RouteHeaders)
|
s.Format, s.RouteConfig, s.RouteHeaders)
|
||||||
assertRouteFields(t, updatedRoute, s.RoutePath, s.Image, newRouteType, s.Format)
|
assertRouteFields(t, updatedRoute, s.RoutePath, s.Image, newRouteType, s.Format)
|
||||||
|
|
||||||
DeleteRoute(t, s.Context, s.Client, s.AppName, s.RoutePath)
|
|
||||||
DeleteApp(t, s.Context, s.Client, s.AppName)
|
DeleteApp(t, s.Context, s.Client, s.AppName)
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user