Skip to content

Add tests for webhook sender and stageLogPersister#6594

Open
AshishSingh1503 wants to merge 1 commit intopipe-cd:masterfrom
AshishSingh1503:add-tests-webhook-stagelogpersister
Open

Add tests for webhook sender and stageLogPersister#6594
AshishSingh1503 wants to merge 1 commit intopipe-cd:masterfrom
AshishSingh1503:add-tests-webhook-stagelogpersister

Conversation

@AshishSingh1503
Copy link
Copy Markdown

What this PR does:
Adds missing unit tests for two previously untested files in pkg/:

  • pkg/app/piped/notifier/webhook_test.go — tests for newWebhookSender, sendEvent (using httptest.Server), Notify buffering, Run loop cancellation, and Close draining remaining events.
  • pkg/app/piped/logpersister/stagelogpersister_test.go — tests for all log severity methods (Info, Infof, Success, Successf, Error, Errorf, Write), index increment ordering, all branches of isStale, and Complete timeout/success paths.

Why we need it:
These files had zero test coverage. Adding tests improves confidence when refactoring and helps catch regressions.

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

  • How are users affected by this change: No user-facing change. Test-only addition.
  • Is this breaking change: No
  • How to migrate (if breaking change): N/A

Signed-off-by: AshishSingh1503 <23bec025@nith.ac.in>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant