MCPcopy Index your code
hub / github.com/databus23/helm-diff / TestStructuredOutputSuppressedKind

Function TestStructuredOutputSuppressedKind

diff/diff_test.go:683–717  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

681}
682
683func TestStructuredOutputSuppressedKind(t *testing.T) {
684 ansi.DisableColors(true)
685 opts := &Options{
686 OutputFormat: "structured",
687 SuppressedKinds: []string{"Secret"},
688 }
689 oldManifest := `
690apiVersion: v1
691kind: Secret
692metadata:
693 name: creds
694data:
695 password: c29tZQ==
696`
697 newManifest := `
698apiVersion: v1
699kind: Secret
700metadata:
701 name: creds
702data:
703 password: Zm9v
704`
705 oldIndex := manifest.Parse([]byte(oldManifest), "default", true)
706 newIndex := manifest.Parse([]byte(newManifest), "default", true)
707
708 var buf bytes.Buffer
709 changed := Manifests(oldIndex, newIndex, opts, &buf)
710 require.True(t, changed)
711
712 var entries []StructuredEntry
713 require.NoError(t, json.Unmarshal(buf.Bytes(), &entries))
714 require.Len(t, entries, 1)
715 require.True(t, entries[0].ChangesSuppressed)
716 require.Empty(t, entries[0].Changes)
717}
718
719func findChange(changes []FieldChange, path, field string) (FieldChange, bool) {
720 for _, change := range changes {

Callers

nothing calls this directly

Calls 2

ParseFunction · 0.92
ManifestsFunction · 0.85

Tested by

no test coverage detected