mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Reject async requests in case if MQ is not reachable
This commit is contained in:
committed by
Reed Allman
parent
565f61fe6f
commit
97b0b97bd8
@@ -24,7 +24,7 @@ type routeTestCase struct {
|
||||
|
||||
func (test *routeTestCase) run(t *testing.T, i int, buf *bytes.Buffer) {
|
||||
rnr, cancel := testRunner(t)
|
||||
srv := testServer(test.ds, &mqs.Mock{}, test.logDB, rnr)
|
||||
srv := testServer(test.ds, &mqs.Mock{}, test.logDB, rnr, DefaultEnqueue)
|
||||
|
||||
body := bytes.NewBuffer([]byte(test.body))
|
||||
_, rec := routerRequest(t, srv.Router, test.method, test.path, body)
|
||||
@@ -131,7 +131,7 @@ func TestRouteDelete(t *testing.T) {
|
||||
), logs.NewMock(), "/v1/apps/a/routes/myroute", "", http.StatusOK, nil},
|
||||
} {
|
||||
rnr, cancel := testRunner(t)
|
||||
srv := testServer(test.ds, &mqs.Mock{}, test.logDB, rnr)
|
||||
srv := testServer(test.ds, &mqs.Mock{}, test.logDB, rnr, DefaultEnqueue)
|
||||
_, rec := routerRequest(t, srv.Router, "DELETE", test.path, nil)
|
||||
|
||||
if rec.Code != test.expectedCode {
|
||||
@@ -162,7 +162,7 @@ func TestRouteList(t *testing.T) {
|
||||
ds := datastore.NewMock()
|
||||
fnl := logs.NewMock()
|
||||
|
||||
srv := testServer(ds, &mqs.Mock{}, fnl, rnr)
|
||||
srv := testServer(ds, &mqs.Mock{}, fnl, rnr, DefaultEnqueue)
|
||||
|
||||
for i, test := range []struct {
|
||||
path string
|
||||
@@ -201,7 +201,7 @@ func TestRouteGet(t *testing.T) {
|
||||
ds := datastore.NewMock()
|
||||
fnl := logs.NewMock()
|
||||
|
||||
srv := testServer(ds, &mqs.Mock{}, fnl, rnr)
|
||||
srv := testServer(ds, &mqs.Mock{}, fnl, rnr, DefaultEnqueue)
|
||||
|
||||
for i, test := range []struct {
|
||||
path string
|
||||
|
||||
Reference in New Issue
Block a user