GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — test: add unit coverage for ci writer helpers by Ankitsinghsisodya · Pull Request #3569 · knative/func Conversation
|
| File | Change |
|---|---|
cmd/ci/writer_test.go |
New — 3 test functions for BufferWriter |
TestBufferWriter_WriteAndExist // Exist is false before Write and true after Write TestBufferWriter_Write_StoresPath // Write records the provided path TestBufferWriter_Write_ResetsBuffer // consecutive writes replace content
go test ./cmd/ci/... -v -run TestBufferWriterExpected output: 3 tests PASS, ok knative.dev/func/cmd/ci.
make test passesmake check passes
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Add tests for the fileWriter (DefaultWorkflowWriter) and BufferWriter implementations in cmd/ci/writer.go. Covered: - Write creates all missing parent directories - Write overwrites existing file content (no append) - Exist returns false before any write - Exist returns true after a successful write - BufferWriter.Write stores path and resets buffer on each call - BufferWriter.Exist reflects buffer non-emptiness Fixes zero-coverage on writer.go:26 and writer.go:38.
|
Hi @Ankitsinghsisodya. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Adds unit tests for the CI workflow writer helpers in cmd/ci/writer.go, addressing the lack of coverage noted in #3567.
Changes:
cmd/ci/writer_test.go with unit tests covering fileWriter.Write, fileWriter.Exist, and the BufferWriter test double.💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@ ## main #3569 +/- ## ========================================== + Coverage 55.52% 56.24% +0.72% ========================================== Files 180 180 Lines 20465 20465 ========================================== + Hits 11363 11511 +148 + Misses 7902 7755 -147 + Partials 1200 1199 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
/approve |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Ankitsinghsisodya, matejvasek The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Add unit tests forBufferWriter in cmd/ci/writer.go
There was an error while loading. Please reload this page.