Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions internal/pkg/pipeline/task/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 5 additions & 2 deletions test/pipelines/context_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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
Expand All @@ -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
path: output/{{ context "user_name" }}_{{ macro "uuid" }}_record.txt
Loading