MCPcopy
hub / github.com/kptdev/kpt / TestKptGetSet

Function TestKptGetSet

e2e/e2e_test.go:34–221  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

32)
33
34func TestKptGetSet(t *testing.T) {
35 type testCase struct {
36 name string
37 subdir string
38 tag string
39 branch string
40 setBy string
41 dataset string
42 replacements map[string][]string
43
44 // the upstream doesn't have a kptfile
45 noKptfile bool
46 }
47
48 tests := []testCase{
49 {name: "subdir", subdir: "helloworld-set",
50 dataset: testutil.HelloWorldSet,
51 replacements: map[string][]string{
52 "deploy.yaml": {"replicas: 5", "replicas: 7"},
53 "Kptfile": {
54 ` setBy: package-default
55 value: "5"`,
56 ` value: "7"
57 isSet: true`,
58 },
59 },
60 },
61 {name: "tag-subdir", tag: "v0.1.0", subdir: "helloworld-set",
62 dataset: testutil.HelloWorldSet,
63 replacements: map[string][]string{
64 "deploy.yaml": {"replicas: 5", "replicas: 7"},
65 "Kptfile": {
66 ` setBy: package-default
67 value: "5"`,
68 ` value: "7"
69 isSet: true`,
70 },
71 },
72 },
73 {name: "tag", tag: "v0.1.0", dataset: testutil.HelloWorldSet,
74 replacements: map[string][]string{
75 "deploy.yaml": {"replicas: 5", "replicas: 7"},
76 "Kptfile": {
77 ` setBy: package-default
78 value: "5"`,
79 ` value: "7"
80 isSet: true`,
81 },
82 },
83 },
84 {name: "branch", branch: "master",
85 dataset: testutil.HelloWorldSet,
86 replacements: map[string][]string{
87 "deploy.yaml": {"replicas: 5", "replicas: 7"},
88 "Kptfile": {
89 ` setBy: package-default
90 value: "5"`,
91 ` value: "7"

Callers

nothing calls this directly

Calls 12

SetupGitRepoFunction · 0.92
CopyDataFunction · 0.92
CommitFunction · 0.92
TagFunction · 0.92
GetMainFunction · 0.92
ExecFunction · 0.92
CopyKptfileFunction · 0.92
AssertPkgEqualFunction · 0.92
ReplaceFunction · 0.92
CompareFunction · 0.92
RunMethod · 0.45
RemoveAllMethod · 0.45

Tested by

no test coverage detected