Add annotations to routes and apps (#866)

Adds 'annotations' attribute to Routes and Apps
This commit is contained in:
Owen Cliffe
2018-03-20 18:02:49 +00:00
committed by GitHub
parent 845f40ee86
commit d25b5af59d
31 changed files with 1838 additions and 669 deletions

View File

@@ -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)
}