diff --git a/internal/pkg/pipeline/task/http/http.go b/internal/pkg/pipeline/task/http/http.go index ae69d60..a923c72 100644 --- a/internal/pkg/pipeline/task/http/http.go +++ b/internal/pkg/pipeline/task/http/http.go @@ -87,6 +87,11 @@ func New() (task.Task, error) { func (h *httpCore) newFromInput(data []byte) (*httpCore, error) { newHttp := &httpCore{ + Base: task.Base{ + Name: h.Name, + Type: h.Type, + Context: h.Context, + }, Method: h.Method, Endpoint: h.Endpoint, ExpectedStatuses: h.ExpectedStatuses, diff --git a/test/pipelines/context_test.yaml b/test/pipelines/context_test.yaml index 5fa6563..b9831df 100644 --- a/test/pipelines/context_test.yaml +++ b/test/pipelines/context_test.yaml @@ -7,7 +7,7 @@ tasks: user_name: ".data | fromjson | .name" user_email: ".data | fromjson | .email" user_company: ".data | fromjson | .company.name" - + - name: form_posts_endpoint_with_context type: jq path: | @@ -21,6 +21,8 @@ tasks: - name: hit_endpoint_with_context type: http + context: + "number_of_posts": ".data | fromjson | length" - name: transform_with_context_jq type: jq @@ -32,9 +34,10 @@ tasks: "user_company": "{{ context "user_company" }}", "headers_content_type": "{{ context "http-header-Content-Type" }}", "headers_age": "{{ context "http-header-Age" }}", + "number_of_posts": {{ context "number_of_posts" }}, "original_data": . } - name: file_with_context type: file - path: output/{{ context "user_name" }}_{{ macro "uuid" }}_record.txt \ No newline at end of file + path: output/{{ context "user_name" }}_{{ macro "uuid" }}_record.txt