Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Plugin.SetOutputTarget method #268

Merged
merged 2 commits into from
Oct 17, 2024

Conversation

atc0005
Copy link
Owner

@atc0005 atc0005 commented Oct 17, 2024

Changes

  • Add test cases for Plugin.SetOutputTarget
    • TestPluginSetOutputTargetIsValidWithValidInput
      • basic assertion to show that the method works as intended with valid/expected input
    • TestPluginSetOutputTargetIsValidWithInvalidInput
      • asserts that when given an invalid output target that the default/fallback output target is used instead
  • Fix Plugin.SetOutputTarget fallback behavior
    • correctly fallback to default output target when an invalid output target is provided

References

New tests:

- `TestPluginSetOutputTargetIsValidWithValidInput`
  - basic assertion to show that the method works as intended
    with valid/expected input
- TestPluginSetOutputTargetIsValidWithInvalidInput
  - asserts that when given an invalid output target that the
    default/fallback output target is used instead

The second test is currently failing, highlighting the logic
bug currently affecting the `Plugin.SetOutputTarget` method.

refs GH-267
Correctly fallback to default output target when an invalid
output target is provided.

refs GH-267
@atc0005 atc0005 added bug Something isn't working output/plugin plugin output intended for monitoring system ingest tests labels Oct 17, 2024
@atc0005 atc0005 added this to the v0.17.0 milestone Oct 17, 2024
@atc0005 atc0005 self-assigned this Oct 17, 2024
@atc0005 atc0005 merged commit a950b62 into master Oct 17, 2024
30 of 31 checks passed
@atc0005 atc0005 deleted the i267-fix-setoutputtarget-arg-handling branch October 17, 2024 22:31
@atc0005 atc0005 restored the i267-fix-setoutputtarget-arg-handling branch October 17, 2024 22:33
@atc0005 atc0005 deleted the i267-fix-setoutputtarget-arg-handling branch October 17, 2024 22:34
atc0005 added a commit that referenced this pull request Oct 20, 2024
Update `TestPluginSetOutputTargetIsValidWithInvalidInput` to
not just assert that plugin.outputSink is set when an invalid
output target is specified, but also that it is specifically
set to the default plugin output target as intended.

- refs GH-268
- refs GH-267
atc0005 added a commit that referenced this pull request Oct 20, 2024
Update `TestPluginSetOutputTargetIsValidWithInvalidInput` to
not just assert that plugin.outputSink is set when an invalid
output target is specified, but also that it is specifically
set to the default plugin output target as intended.

- refs GH-268
- refs GH-267
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working output/plugin plugin output intended for monitoring system ingest tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid custom plugin output target is not handled correctly
1 participant