mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Add annotations to routes and apps (#866)
Adds 'annotations' attribute to Routes and Apps
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
"testing"
|
||||
|
||||
apiutils "github.com/fnproject/fn/test/fn-api-tests"
|
||||
"github.com/fnproject/fn_go/models"
|
||||
)
|
||||
|
||||
func LB() (string, error) {
|
||||
@@ -23,10 +24,14 @@ func LB() (string, error) {
|
||||
}
|
||||
|
||||
func TestCanExecuteFunction(t *testing.T) {
|
||||
s := apiutils.SetupDefaultSuite()
|
||||
apiutils.CreateApp(t, s.Context, s.Client, s.AppName, map[string]string{})
|
||||
apiutils.CreateRoute(t, s.Context, s.Client, s.AppName, s.RoutePath, s.Image, "sync",
|
||||
s.Format, s.Timeout, s.IdleTimeout, s.RouteConfig, s.RouteHeaders)
|
||||
s := apiutils.SetupHarness()
|
||||
s.GivenAppExists(t, &models.App{Name: s.AppName})
|
||||
defer s.Cleanup()
|
||||
|
||||
rt := s.BasicRoute()
|
||||
rt.Type = "sync"
|
||||
|
||||
s.GivenRouteExists(t, s.AppName, rt)
|
||||
|
||||
lb, err := LB()
|
||||
if err != nil {
|
||||
@@ -48,14 +53,18 @@ func TestCanExecuteFunction(t *testing.T) {
|
||||
if !strings.Contains(expectedOutput, output.String()) {
|
||||
t.Errorf("Assertion error.\n\tExpected: %v\n\tActual: %v", expectedOutput, output.String())
|
||||
}
|
||||
apiutils.DeleteApp(t, s.Context, s.Client, s.AppName)
|
||||
}
|
||||
|
||||
func TestBasicConcurrentExecution(t *testing.T) {
|
||||
s := apiutils.SetupDefaultSuite()
|
||||
apiutils.CreateApp(t, s.Context, s.Client, s.AppName, map[string]string{})
|
||||
apiutils.CreateRoute(t, s.Context, s.Client, s.AppName, s.RoutePath, s.Image, "sync",
|
||||
s.Format, s.Timeout, s.IdleTimeout, s.RouteConfig, s.RouteHeaders)
|
||||
s := apiutils.SetupHarness()
|
||||
|
||||
s.GivenAppExists(t, &models.App{Name: s.AppName})
|
||||
defer s.Cleanup()
|
||||
|
||||
rt := s.BasicRoute()
|
||||
rt.Type = "sync"
|
||||
|
||||
s.GivenRouteExists(t, s.AppName, rt)
|
||||
|
||||
lb, err := LB()
|
||||
if err != nil {
|
||||
@@ -93,5 +102,4 @@ func TestBasicConcurrentExecution(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
apiutils.DeleteApp(t, s.Context, s.Client, s.AppName)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user