Skip to content

backend: cmd: Add error path test for MarshalCustomObject#6102

Merged
illume merged 1 commit into
kubernetes-sigs:mainfrom
CygnusMaximillian:backend/cmdStatelessTest
Jun 24, 2026
Merged

backend: cmd: Add error path test for MarshalCustomObject#6102
illume merged 1 commit into
kubernetes-sigs:mainfrom
CygnusMaximillian:backend/cmdStatelessTest

Conversation

@CygnusMaximillian

Copy link
Copy Markdown
Contributor

PR description

Adds an isolated test case to ensure MarshalCustomObject correctly handles and surfaces errors when provided with invalid JSON data.

Changes:

updated backend/cmd/stateless_test.go with TestMarshalCustomObject_InvalidJSON Steps to

Test:

Navigate to the backend directory.
Run npm run backend:test and verify it passes. Notes for the Reviewer: A simple, backward-compatible test that covers the previously untested error branches when handling invalid runtime.Unknown objects.

Screenshots

image after running it in my local machine

Signed-off-by: CygnusMaximillian <dprajjwal11@gmail.com>
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 19, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: CygnusMaximillian
Once this PR has been reviewed and has the lgtm label, please assign sniok for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 19, 2026
@illume illume requested a review from Copilot June 23, 2026 15:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a focused backend unit test to ensure MarshalCustomObject returns an error when given a runtime.Unknown whose Raw contains invalid JSON, covering an error path that can otherwise be missed.

Changes:

  • Add TestMarshalCustomObject_InvalidJSON to validate error surfacing for invalid runtime.Unknown.Raw data.

@illume illume left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 thanks!

@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CygnusMaximillian, illume

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow kubernetes-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 24, 2026
@illume illume merged commit 253997d into kubernetes-sigs:main Jun 24, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants