Skip to content

Improve formatting of objects in ginkgo failed asserts for lists #10443

@mimowo

Description

@mimowo

What would you like to be cleaned:

When there is a test failing and the assert is on the list we use excessive formatting, see example here:

see example fragment from https://prow.k8s.io/view/gs/kubernetes-ci-logs/pr-logs/pull/kubernetes-sigs_kueue/10082/pull-kueue-test-e2e-multikueue-main/2036403536677310464

            Spec: {
                Volumes: [
                    {
                        Name: "kube-api-access-vm6mc",
                        VolumeSource: {
                            HostPath: nil,
                            EmptyDir: nil,
                            GCEPersistentDisk: nil,
                            AWSElasticBlockStore: nil,
                            GitRepo: nil,
                            Secret: nil,
                            NFS: nil,
                            ISCSI: nil,
                            Glusterfs: nil,
                            PersistentVolumeClaim: nil,
                            RBD: nil,
                            FlexVolume: nil,
                            Cinder: nil,
                            CephFS: nil,
                            Flocker: nil,
                            DownwardAPI: nil,
                            FC: nil,
                            AzureFile: nil,
                            ConfigMap: nil,
                            VsphereVolume: nil,
                            Quobyte: nil,
                            AzureDisk: nil,
                            PhotonPersistentDisk: nil,

We recently optimized the output for single object, so I assume similar optimizaiton could be made here.

Why is this needed:

To make the failures easier to read.

Also long output in case of lists sometimes exceeds the GH limit for 65k characters making it tricky to copy-paste.

Metadata

Metadata

Assignees

Labels

kind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions