redpanda-data / redpanda-data/connect

Unit test target_processors does not accept an array, contrary to documentation

Open
#1,448 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

documentation needs investigation testing ux
Dominant language
Go
Stars
8.8k
Forks
969
Avg merge
1d 13h
Merged PRs (30d)
64

Description

According to current documentation:

A JSON Pointer that identifies the specific processors which should be executed by the test. The target can either be a single processor or an array of processors. Alternatively a resource label can be used to identify a processor.
It is also possible to target processors in a separate file by prefixing the target with a path relative to the test file followed by a # symbol.
Type: string
Default: "/pipeline/processors"

However, in practice, trying to specify an array (or anything other than a string) results in an unmarshalling error:

$ benthos test kafka2kinesis.yaml 
Failed to obtain test targets: failed to parse test definition from '<redacted>l': yaml: unmarshal errors:
  line 53: cannot unmarshal !!seq into string

Line 53 of :
target_processors: ['microbatch_split', 'microbatch_aggregate']

The plurality of 'processors' leads me to believe allowing multiple processors was intended, and that this is indeed a bug (rather than a documentation issue).

Benthos version:

$ benthos --version
Version: 4.6.0
Date: 2022-08-31T18:38:28Z

Of note, this bug exists as far back as 4.3.0, and possibly earlier.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with benthos test kafka2kinesis.yaml and the target_processors array shown in the issue. Start by tracing test-definition parsing and the target_processors field, then inspect existing tests for processor targeting. Done means arrays of processor targets parse and execute as the documentation describes, with regression coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.