MCPcopy Index your code
hub / github.com/devspace-sh/devspace / TestValidateDev

Function TestValidateDev

pkg/devspace/config/versions/validate_test.go:72–175  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

70}
71
72func TestValidateDev(t *testing.T) {
73 // test port forwarding
74 localPort := int(8080)
75 remotePort := int(9090)
76 config := &latest.Config{
77 Dev: map[string]*latest.DevPod{
78 "somename": {
79 Name: "somename",
80 ImageSelector: "selecMe",
81 DevContainer: latest.DevContainer{
82 Container: "fakeContainer",
83 },
84 Ports: []*latest.PortMapping{
85 {
86 Port: fmt.Sprintf("%v:%v", localPort, remotePort),
87 },
88 },
89 },
90 },
91 }
92
93 err := validateDev(config)
94 assert.NilError(t, err)
95
96 // test sync
97 config = &latest.Config{
98 Dev: map[string]*latest.DevPod{
99 "somename": {
100 Name: "somename",
101 LabelSelector: map[string]string{
102 "app": "MeApp",
103 },
104 DevContainer: latest.DevContainer{
105 Container: "fakeContainers",
106 },
107 },
108 },
109 }
110
111 err = validateDev(config)
112 assert.NilError(t, err)
113
114 // test replace pods
115 config = &latest.Config{
116 Dev: map[string]*latest.DevPod{
117 "test": {
118 LabelSelector: map[string]string{
119 "app": "MeApp",
120 },
121 DevContainer: latest.DevContainer{
122 Container: "fakeContainer",
123 },
124 },
125 },
126 }
127
128 err = validateDev(config)
129 assert.NilError(t, err)

Callers

nothing calls this directly

Calls 2

validateDevFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected