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

Test for UnstructureList decode diff between strict and non-strict. #123783

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

benluddy
Copy link
Contributor

@benluddy benluddy commented Mar 6, 2024

What type of PR is this?

/sig api-machinery

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot
Copy link
Contributor

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Instructions 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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Mar 6, 2024
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions 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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Mar 6, 2024
@benluddy
Copy link
Contributor Author

benluddy commented Mar 6, 2024

/test pull-kubernetes-unit

make test WHAT=./staging/src/k8s.io/apimachinery/pkg/runtime/serializer/json
+++ [0306 18:38:10] Set GOMAXPROCS automatically to 20
+++ [0306 18:38:10] Running tests without code coverage and with -race
--- FAIL: TestDecodeUnstructuredList (0.00s)
    unstructured_test.go:44: diff strict lax:
          unstructured.UnstructuredList{
          	Object: map[string]any{
          		"apiVersion": string("json.example.com/v1alpha1"),
        - 		"items":      []any{map[string]any{"spec": map[string]any{"abc": int64(123)}}},
          		"kind":       string("FooList"),
          	},
          	Items: []unstructured.Unstructured{
          		{
          			Object: map[string]any{
        + 				"apiVersion": string("json.example.com/v1alpha1"),
        + 				"kind":       string("Foo"),
          				"spec":       map[string]any{"abc": int64(123)},
          			},
          		},
          	},
          }
FAIL
FAIL	k8s.io/apimachinery/pkg/runtime/serializer/json	0.102s
FAIL

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

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
Copy link
Contributor

@benluddy: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubernetes-unit 073b4ab link true /test pull-kubernetes-unit

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions 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/test-infra repository. I understand the commands that are listed here.

}

if diff := cmp.Diff(listFromStrict, listFromLax); diff != "" {
t.Errorf("diff strict lax:\n%s", diff)
Copy link
Contributor

Choose a reason for hiding this comment

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

 	0s
{Failed;  === RUN   TestDecodeUnstructuredList
    unstructured_test.go:47: diff strict lax:
          unstructured.UnstructuredList{
          	Object: map[string]any{
          		"apiVersion": string("json.example.com/v1alpha1"),
        - 		"items":      []any{map[string]any{"spec": map[string]any{"abc": int64(123)}}},
          		"kind":       string("FooList"),
          	},
          	Items: []unstructured.Unstructured{
          		{
          			Object: map[string]any{
        + 				"apiVersion": string("json.example.com/v1alpha1"),
        + 				"kind":       string("Foo"),
          				"spec":       map[string]any{"abc": int64(123)},
          			},
          		},
          	},
          }
--- FAIL: TestDecodeUnstructuredList (0.00s)
;}

Oh my.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants