-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use MarshalIndent on json goldenfiles (#856)
For large JSON objects stored as goldenfiles, identifying changes is difficult when it is one large line due to the fact that a single character change shows the entire object as the 1 line diff. This change makes those tests use MarshalIndent so the lines are split up and sets the indent to 0 so that if we change the nesting, the changes don't cascade to the rest of the file simply due to indentation changes (which dont change the object once unmarshalled). Signed-off-by: John Schnake <[email protected]>
- Loading branch information
1 parent
973e782
commit 451b313
Showing
15 changed files
with
502 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 41 additions & 1 deletion
42
pkg/client/results/testdata/mockResults/plugins/ds-junit-01/ds-junit-01.golden.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,41 @@ | ||
{"name":"ds-junit-01","status":"passed","items":[{"name":"global","status":"passed","items":[{"name":"output.xml","status":"passed","meta":{"file":"results/global/output.xml"},"items":[{"name":"[k8s.io] Pods should be submitted and removed [NodeConformance] [Conformance]","status":"passed"},{"name":"[sig-node] ConfigMap should fail to create ConfigMap with empty key [Conformance]","status":"passed"},{"name":"[sig-storage] Downward API volume should set DefaultMode on files [LinuxOnly] [NodeConformance] [Conformance]","status":"passed"},{"name":"[sig-storage] In-tree Volumes [Driver: local][LocalVolumeType: dir-link-bindmounted] [Testpattern: Dynamic PV (default fs)] subPath should support existing directories when readOnly specified in the volumeSource","status":"skipped"},{"name":"[sig-storage] In-tree Volumes [Driver: rbd][Feature:Volumes] [Testpattern: Pre-provisioned PV (default fs)] subPath should support restarting containers using file as subpath [Slow]","status":"skipped"}]}]}]} | ||
{ | ||
"name": "ds-junit-01", | ||
"status": "passed", | ||
"items": [ | ||
{ | ||
"name": "global", | ||
"status": "passed", | ||
"items": [ | ||
{ | ||
"name": "output.xml", | ||
"status": "passed", | ||
"meta": { | ||
"file": "results/global/output.xml" | ||
}, | ||
"items": [ | ||
{ | ||
"name": "[k8s.io] Pods should be submitted and removed [NodeConformance] [Conformance]", | ||
"status": "passed" | ||
}, | ||
{ | ||
"name": "[sig-node] ConfigMap should fail to create ConfigMap with empty key [Conformance]", | ||
"status": "passed" | ||
}, | ||
{ | ||
"name": "[sig-storage] Downward API volume should set DefaultMode on files [LinuxOnly] [NodeConformance] [Conformance]", | ||
"status": "passed" | ||
}, | ||
{ | ||
"name": "[sig-storage] In-tree Volumes [Driver: local][LocalVolumeType: dir-link-bindmounted] [Testpattern: Dynamic PV (default fs)] subPath should support existing directories when readOnly specified in the volumeSource", | ||
"status": "skipped" | ||
}, | ||
{ | ||
"name": "[sig-storage] In-tree Volumes [Driver: rbd][Feature:Volumes] [Testpattern: Pre-provisioned PV (default fs)] subPath should support restarting containers using file as subpath [Slow]", | ||
"status": "skipped" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
71 changes: 70 additions & 1 deletion
71
pkg/client/results/testdata/mockResults/plugins/ds-junit-02/ds-junit-02.golden.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,70 @@ | ||
{"name":"ds-junit-02","status":"failed","items":[{"name":"global","status":"failed","items":[{"name":"output.xml","status":"passed","meta":{"file":"results/global/output.xml"},"items":[{"name":"[k8s.io] Pods should be submitted and removed [NodeConformance] [Conformance]","status":"passed"},{"name":"[sig-node] ConfigMap should fail to create ConfigMap with empty key [Conformance]","status":"passed"},{"name":"[sig-storage] Downward API volume should set DefaultMode on files [LinuxOnly] [NodeConformance] [Conformance]","status":"passed"},{"name":"[sig-storage] In-tree Volumes [Driver: local][LocalVolumeType: dir-link-bindmounted] [Testpattern: Dynamic PV (default fs)] subPath should support existing directories when readOnly specified in the volumeSource","status":"skipped"},{"name":"[sig-storage] In-tree Volumes [Driver: rbd][Feature:Volumes] [Testpattern: Pre-provisioned PV (default fs)] subPath should support restarting containers using file as subpath [Slow]","status":"skipped"}]},{"name":"output2.xml","status":"failed","meta":{"file":"results/global/output2.xml"},"items":[{"name":"[k8s.io] Pods should be submitted and removed [NodeConformance] [Conformance]","status":"passed"},{"name":"[sig-apps] Daemon set [Serial] should rollback without unnecessary restarts [Conformance]","status":"failed","details":{"failure":"/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:696\nConformance test suite needs a cluster with at least 2 nodes.\nExpected\n \u003cint\u003e: 1\nto be \u003e\n \u003cint\u003e: 1\n/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/apps/daemon_set.go:385","system-out":"[BeforeEach] ..."}},{"name":"[sig-storage] In-tree Volumes [Driver: local][LocalVolumeType: dir-link-bindmounted] [Testpattern: Dynamic PV (default fs)] subPath should support existing directories when readOnly specified in the volumeSource","status":"skipped"},{"name":"[sig-storage] In-tree Volumes [Driver: rbd][Feature:Volumes] [Testpattern: Pre-provisioned PV (default fs)] subPath should support restarting containers using file as subpath [Slow]","status":"skipped"}]}]}]} | ||
{ | ||
"name": "ds-junit-02", | ||
"status": "failed", | ||
"items": [ | ||
{ | ||
"name": "global", | ||
"status": "failed", | ||
"items": [ | ||
{ | ||
"name": "output.xml", | ||
"status": "passed", | ||
"meta": { | ||
"file": "results/global/output.xml" | ||
}, | ||
"items": [ | ||
{ | ||
"name": "[k8s.io] Pods should be submitted and removed [NodeConformance] [Conformance]", | ||
"status": "passed" | ||
}, | ||
{ | ||
"name": "[sig-node] ConfigMap should fail to create ConfigMap with empty key [Conformance]", | ||
"status": "passed" | ||
}, | ||
{ | ||
"name": "[sig-storage] Downward API volume should set DefaultMode on files [LinuxOnly] [NodeConformance] [Conformance]", | ||
"status": "passed" | ||
}, | ||
{ | ||
"name": "[sig-storage] In-tree Volumes [Driver: local][LocalVolumeType: dir-link-bindmounted] [Testpattern: Dynamic PV (default fs)] subPath should support existing directories when readOnly specified in the volumeSource", | ||
"status": "skipped" | ||
}, | ||
{ | ||
"name": "[sig-storage] In-tree Volumes [Driver: rbd][Feature:Volumes] [Testpattern: Pre-provisioned PV (default fs)] subPath should support restarting containers using file as subpath [Slow]", | ||
"status": "skipped" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "output2.xml", | ||
"status": "failed", | ||
"meta": { | ||
"file": "results/global/output2.xml" | ||
}, | ||
"items": [ | ||
{ | ||
"name": "[k8s.io] Pods should be submitted and removed [NodeConformance] [Conformance]", | ||
"status": "passed" | ||
}, | ||
{ | ||
"name": "[sig-apps] Daemon set [Serial] should rollback without unnecessary restarts [Conformance]", | ||
"status": "failed", | ||
"details": { | ||
"failure": "/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:696\nConformance test suite needs a cluster with at least 2 nodes.\nExpected\n \u003cint\u003e: 1\nto be \u003e\n \u003cint\u003e: 1\n/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/apps/daemon_set.go:385", | ||
"system-out": "[BeforeEach] ..." | ||
} | ||
}, | ||
{ | ||
"name": "[sig-storage] In-tree Volumes [Driver: local][LocalVolumeType: dir-link-bindmounted] [Testpattern: Dynamic PV (default fs)] subPath should support existing directories when readOnly specified in the volumeSource", | ||
"status": "skipped" | ||
}, | ||
{ | ||
"name": "[sig-storage] In-tree Volumes [Driver: rbd][Feature:Volumes] [Testpattern: Pre-provisioned PV (default fs)] subPath should support restarting containers using file as subpath [Slow]", | ||
"status": "skipped" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
71 changes: 70 additions & 1 deletion
71
pkg/client/results/testdata/mockResults/plugins/ds-junit-03/ds-junit-03.golden.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,70 @@ | ||
{"name":"ds-junit-03","status":"failed","items":[{"name":"global","status":"failed","items":[{"name":"output.xml","status":"passed","meta":{"file":"results/global/output.xml"},"items":[{"name":"[k8s.io] Pods should be submitted and removed [NodeConformance] [Conformance]","status":"passed"},{"name":"[sig-node] ConfigMap should fail to create ConfigMap with empty key [Conformance]","status":"passed"},{"name":"[sig-storage] Downward API volume should set DefaultMode on files [LinuxOnly] [NodeConformance] [Conformance]","status":"passed"},{"name":"[sig-storage] In-tree Volumes [Driver: local][LocalVolumeType: dir-link-bindmounted] [Testpattern: Dynamic PV (default fs)] subPath should support existing directories when readOnly specified in the volumeSource","status":"skipped"},{"name":"[sig-storage] In-tree Volumes [Driver: rbd][Feature:Volumes] [Testpattern: Pre-provisioned PV (default fs)] subPath should support restarting containers using file as subpath [Slow]","status":"skipped"}]},{"name":"output2.xml","status":"failed","meta":{"file":"results/global/output2.xml"},"items":[{"name":"[k8s.io] Pods should be submitted and removed [NodeConformance] [Conformance]","status":"passed"},{"name":"[sig-apps] Daemon set [Serial] should rollback without unnecessary restarts [Conformance]","status":"failed","details":{"failure":"/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:696\nConformance test suite needs a cluster with at least 2 nodes.\nExpected\n \u003cint\u003e: 1\nto be \u003e\n \u003cint\u003e: 1\n/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/apps/daemon_set.go:385","system-out":"[BeforeEach] ..."}},{"name":"[sig-storage] In-tree Volumes [Driver: local][LocalVolumeType: dir-link-bindmounted] [Testpattern: Dynamic PV (default fs)] subPath should support existing directories when readOnly specified in the volumeSource","status":"skipped"},{"name":"[sig-storage] In-tree Volumes [Driver: rbd][Feature:Volumes] [Testpattern: Pre-provisioned PV (default fs)] subPath should support restarting containers using file as subpath [Slow]","status":"skipped"}]}]}]} | ||
{ | ||
"name": "ds-junit-03", | ||
"status": "failed", | ||
"items": [ | ||
{ | ||
"name": "global", | ||
"status": "failed", | ||
"items": [ | ||
{ | ||
"name": "output.xml", | ||
"status": "passed", | ||
"meta": { | ||
"file": "results/global/output.xml" | ||
}, | ||
"items": [ | ||
{ | ||
"name": "[k8s.io] Pods should be submitted and removed [NodeConformance] [Conformance]", | ||
"status": "passed" | ||
}, | ||
{ | ||
"name": "[sig-node] ConfigMap should fail to create ConfigMap with empty key [Conformance]", | ||
"status": "passed" | ||
}, | ||
{ | ||
"name": "[sig-storage] Downward API volume should set DefaultMode on files [LinuxOnly] [NodeConformance] [Conformance]", | ||
"status": "passed" | ||
}, | ||
{ | ||
"name": "[sig-storage] In-tree Volumes [Driver: local][LocalVolumeType: dir-link-bindmounted] [Testpattern: Dynamic PV (default fs)] subPath should support existing directories when readOnly specified in the volumeSource", | ||
"status": "skipped" | ||
}, | ||
{ | ||
"name": "[sig-storage] In-tree Volumes [Driver: rbd][Feature:Volumes] [Testpattern: Pre-provisioned PV (default fs)] subPath should support restarting containers using file as subpath [Slow]", | ||
"status": "skipped" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "output2.xml", | ||
"status": "failed", | ||
"meta": { | ||
"file": "results/global/output2.xml" | ||
}, | ||
"items": [ | ||
{ | ||
"name": "[k8s.io] Pods should be submitted and removed [NodeConformance] [Conformance]", | ||
"status": "passed" | ||
}, | ||
{ | ||
"name": "[sig-apps] Daemon set [Serial] should rollback without unnecessary restarts [Conformance]", | ||
"status": "failed", | ||
"details": { | ||
"failure": "/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:696\nConformance test suite needs a cluster with at least 2 nodes.\nExpected\n \u003cint\u003e: 1\nto be \u003e\n \u003cint\u003e: 1\n/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/apps/daemon_set.go:385", | ||
"system-out": "[BeforeEach] ..." | ||
} | ||
}, | ||
{ | ||
"name": "[sig-storage] In-tree Volumes [Driver: local][LocalVolumeType: dir-link-bindmounted] [Testpattern: Dynamic PV (default fs)] subPath should support existing directories when readOnly specified in the volumeSource", | ||
"status": "skipped" | ||
}, | ||
{ | ||
"name": "[sig-storage] In-tree Volumes [Driver: rbd][Feature:Volumes] [Testpattern: Pre-provisioned PV (default fs)] subPath should support restarting containers using file as subpath [Slow]", | ||
"status": "skipped" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
20 changes: 19 additions & 1 deletion
20
pkg/client/results/testdata/mockResults/plugins/ds-raw-01/ds-raw-01.golden.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,19 @@ | ||
{"name":"ds-raw-01","status":"passed","items":[{"name":"global","status":"passed","items":[{"name":"output.xml","status":"passed","meta":{"file":"results/global/output.xml"}}]}]} | ||
{ | ||
"name": "ds-raw-01", | ||
"status": "passed", | ||
"items": [ | ||
{ | ||
"name": "global", | ||
"status": "passed", | ||
"items": [ | ||
{ | ||
"name": "output.xml", | ||
"status": "passed", | ||
"meta": { | ||
"file": "results/global/output.xml" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} |
27 changes: 26 additions & 1 deletion
27
pkg/client/results/testdata/mockResults/plugins/ds-raw-02/ds-raw-02.golden.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,26 @@ | ||
{"name":"ds-raw-02","status":"passed","items":[{"name":"global","status":"passed","items":[{"name":"output.xml","status":"passed","meta":{"file":"results/global/output.xml"}},{"name":"output2.xml","status":"passed","meta":{"file":"results/global/output2.xml"}}]}]} | ||
{ | ||
"name": "ds-raw-02", | ||
"status": "passed", | ||
"items": [ | ||
{ | ||
"name": "global", | ||
"status": "passed", | ||
"items": [ | ||
{ | ||
"name": "output.xml", | ||
"status": "passed", | ||
"meta": { | ||
"file": "results/global/output.xml" | ||
} | ||
}, | ||
{ | ||
"name": "output2.xml", | ||
"status": "passed", | ||
"meta": { | ||
"file": "results/global/output2.xml" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} |
27 changes: 26 additions & 1 deletion
27
pkg/client/results/testdata/mockResults/plugins/ds-raw-03/ds-raw-03.golden.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,26 @@ | ||
{"name":"ds-raw-03","status":"passed","items":[{"name":"global","status":"passed","items":[{"name":"output.xml","status":"passed","meta":{"file":"results/global/output.xml"}},{"name":"output2.xml","status":"passed","meta":{"file":"results/global/output2.xml"}}]}]} | ||
{ | ||
"name": "ds-raw-03", | ||
"status": "passed", | ||
"items": [ | ||
{ | ||
"name": "global", | ||
"status": "passed", | ||
"items": [ | ||
{ | ||
"name": "output.xml", | ||
"status": "passed", | ||
"meta": { | ||
"file": "results/global/output.xml" | ||
} | ||
}, | ||
{ | ||
"name": "output2.xml", | ||
"status": "passed", | ||
"meta": { | ||
"file": "results/global/output2.xml" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} |
14 changes: 13 additions & 1 deletion
14
pkg/client/results/testdata/mockResults/plugins/job-default-01/job-default-01.golden.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,13 @@ | ||
{"name":"job-default-01","status":"passed","items":[{"name":"output.xml","status":"passed","meta":{"file":"results/global/output.xml"}}]} | ||
{ | ||
"name": "job-default-01", | ||
"status": "passed", | ||
"items": [ | ||
{ | ||
"name": "output.xml", | ||
"status": "passed", | ||
"meta": { | ||
"file": "results/global/output.xml" | ||
} | ||
} | ||
] | ||
} |
21 changes: 20 additions & 1 deletion
21
pkg/client/results/testdata/mockResults/plugins/job-default-02/job-default-02.golden.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,20 @@ | ||
{"name":"job-default-02","status":"passed","items":[{"name":"output.xml","status":"passed","meta":{"file":"results/global/output.xml"}},{"name":"output2.xml","status":"passed","meta":{"file":"results/global/output2.xml"}}]} | ||
{ | ||
"name": "job-default-02", | ||
"status": "passed", | ||
"items": [ | ||
{ | ||
"name": "output.xml", | ||
"status": "passed", | ||
"meta": { | ||
"file": "results/global/output.xml" | ||
} | ||
}, | ||
{ | ||
"name": "output2.xml", | ||
"status": "passed", | ||
"meta": { | ||
"file": "results/global/output2.xml" | ||
} | ||
} | ||
] | ||
} |
36 changes: 35 additions & 1 deletion
36
pkg/client/results/testdata/mockResults/plugins/job-junit-01/job-junit-01.golden.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,35 @@ | ||
{"name":"job-junit-01","status":"passed","items":[{"name":"output.xml","status":"passed","meta":{"file":"results/global/output.xml"},"items":[{"name":"[k8s.io] Pods should be submitted and removed [NodeConformance] [Conformance]","status":"passed"},{"name":"[sig-node] ConfigMap should fail to create ConfigMap with empty key [Conformance]","status":"passed"},{"name":"[sig-storage] Downward API volume should set DefaultMode on files [LinuxOnly] [NodeConformance] [Conformance]","status":"passed"},{"name":"[sig-storage] In-tree Volumes [Driver: local][LocalVolumeType: dir-link-bindmounted] [Testpattern: Dynamic PV (default fs)] subPath should support existing directories when readOnly specified in the volumeSource","status":"skipped"},{"name":"[sig-storage] In-tree Volumes [Driver: rbd][Feature:Volumes] [Testpattern: Pre-provisioned PV (default fs)] subPath should support restarting containers using file as subpath [Slow]","status":"skipped"}]}]} | ||
{ | ||
"name": "job-junit-01", | ||
"status": "passed", | ||
"items": [ | ||
{ | ||
"name": "output.xml", | ||
"status": "passed", | ||
"meta": { | ||
"file": "results/global/output.xml" | ||
}, | ||
"items": [ | ||
{ | ||
"name": "[k8s.io] Pods should be submitted and removed [NodeConformance] [Conformance]", | ||
"status": "passed" | ||
}, | ||
{ | ||
"name": "[sig-node] ConfigMap should fail to create ConfigMap with empty key [Conformance]", | ||
"status": "passed" | ||
}, | ||
{ | ||
"name": "[sig-storage] Downward API volume should set DefaultMode on files [LinuxOnly] [NodeConformance] [Conformance]", | ||
"status": "passed" | ||
}, | ||
{ | ||
"name": "[sig-storage] In-tree Volumes [Driver: local][LocalVolumeType: dir-link-bindmounted] [Testpattern: Dynamic PV (default fs)] subPath should support existing directories when readOnly specified in the volumeSource", | ||
"status": "skipped" | ||
}, | ||
{ | ||
"name": "[sig-storage] In-tree Volumes [Driver: rbd][Feature:Volumes] [Testpattern: Pre-provisioned PV (default fs)] subPath should support restarting containers using file as subpath [Slow]", | ||
"status": "skipped" | ||
} | ||
] | ||
} | ||
] | ||
} |
Oops, something went wrong.