redpanda-data / redpanda-data/benthos
Benthos tests don't recognise template components
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 571
- Forks
- 120
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 18
Description
Given this foo.tmpl.yaml:
name: foobar
type: processor
fields:
- name: foo
type: string
mapping: |
#!blobl
root.mapping = "root.foo = \"" + this.foo + "\""
And foo.yaml:
input:
generate:
count: 1
mapping: root = ""
pipeline:
processors:
- foobar:
foo: bar
output:
stdout: {}
tests:
- name: example test
target_processors: '/pipeline/processors'
environment: {}
input_batch:
- content: ""
output_batches:
-
- json_equals: '{ "foo": "bar" }'
This command:
$ benthos test -t foo.tmpl.yaml foo.yaml
Fails with:
Failed to execute test target 'foo.yaml': test case 0 failed: failed to initialise processors '/pipeline/processors': failed to initialise processor index '0': processor type of 'foobar' was not recognised
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Run benthos test -t foo.tmpl.yaml foo.yaml with the two issue examples and confirm the unrecognised foobar processor error. Trace how the benthos test command loads template components before initialising /pipeline/processors; done means the test recognises foobar and produces the expected { "foo": "bar" } output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100