Skip to content

refactor: address PR review feedback on tests, bridge error handling, and schema consistency#11

Merged
intel352 merged 2 commits intofeat/issue-2-unit-testsfrom
copilot/sub-pr-10
Feb 23, 2026
Merged

refactor: address PR review feedback on tests, bridge error handling, and schema consistency#11
intel352 merged 2 commits intofeat/issue-2-unit-testsfrom
copilot/sub-pr-10

Conversation

Copy link
Contributor

Copilot AI commented Feb 23, 2026

Addresses all actionable review comments from the initial test PR: silent error discard, weak round-trip assertions, list-format YAML bug, schema/implementation mismatch, brittle type assertions, and cross-file mock coupling.

Changes

  • bridge.go: Propagate MetaWalkMut error instead of discarding with _

    if err := msg.MetaWalkMut(func(key string, value any) error {
        meta[key] = value
        return nil
    }); err != nil {
        return nil, fmt.Errorf("copy message metadata: %w", err)
    }
  • bridge_test.go: Round-trip test now asserts body fields and metadata key/value are preserved, not just that the result is non-nil

  • processor_step_test.go: Fixed context-cancellation test — was using YAML list format (- bloblang: ...) which AddProcessorYAML rejects, so the test never exercised cancellation; switched to single-object format and uses errors.Is for the wrapped error

  • plugin.go: Removed Required: true from processors schema field — the constructor accepts nil as pass-through, so the schema was incorrectly signaling the field is mandatory

  • plugin_test.go: Replaced all NewBentoPlugin().(*bentoPlugin) type assertions with SDK interface assertions (sdk.ModuleProvider, sdk.StepProvider, sdk.TriggerProvider, sdk.SchemaProvider); panics on future implementation changes instead of silently passing

  • mocks_test.go (new): mockPublisher / mockSubscriber extracted from input_module_test.go into a dedicated shared file, eliminating implicit compilation dependencies across test files


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…actoring

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Copilot AI changed the title [WIP] Add unit tests for bento plugin modules, steps, and triggers refactor: address PR review feedback on tests, bridge error handling, and schema consistency Feb 23, 2026
Copilot AI requested a review from intel352 February 23, 2026 14:06
@intel352 intel352 marked this pull request as ready for review February 23, 2026 14:27
@intel352 intel352 merged commit af6eab3 into feat/issue-2-unit-tests Feb 23, 2026
@intel352 intel352 deleted the copilot/sub-pr-10 branch February 23, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants