mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Gateway trigger support (#1225)
* initial gateway trigger support * Pass Content-Type down to wrapped writer * Move req header setting * Adding call id to responses * add dupe Fn-Call-Id headers
This commit is contained in:
@@ -56,16 +56,16 @@ func testRunner(_ *testing.T, args ...interface{}) (agent.Agent, context.CancelF
|
||||
|
||||
func checkLogs(t *testing.T, tnum int, ds models.LogStore, callID string, expected []string) bool {
|
||||
|
||||
logReader, err := ds.GetLog(context.Background(), "myapp", callID)
|
||||
logReader, err := ds.GetLog(context.Background(), "fnid_not_needed_by_mock", callID)
|
||||
if err != nil {
|
||||
t.Errorf("Test %d: GetLog for call_id:%s returned err %s",
|
||||
t.Errorf("Test %d: GetLog for call_id:'%s' returned err %s",
|
||||
tnum, callID, err.Error())
|
||||
return false
|
||||
}
|
||||
|
||||
logBytes, err := ioutil.ReadAll(logReader)
|
||||
if err != nil {
|
||||
t.Errorf("Test %d: GetLog read IO call_id:%s returned err %s",
|
||||
t.Errorf("Test %d: GetLog read IO call_id:'%s' returned err %s",
|
||||
tnum, callID, err.Error())
|
||||
return false
|
||||
}
|
||||
@@ -398,7 +398,7 @@ func TestTriggerRunnerExecution(t *testing.T) {
|
||||
for name, header := range test.expectedHeaders {
|
||||
if header[0] != rec.Header().Get(name) {
|
||||
isFailure = true
|
||||
t.Errorf("Test %d: Expected header `%s` to be %s but was %s. body: %s",
|
||||
t.Errorf("Test %d: Expected header `%s` to be `%s` but was `%s`. body: `%s`",
|
||||
i, name, header[0], rec.Header().Get(name), respBody)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user