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

Function TestApply

pkg/devspace/config/loader/patch/patch_test.go:13–182  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11}
12
13func TestApply(t *testing.T) {
14 testCases := map[string]applyTestCase{
15 // If it were processed, the indentation would be reset to 4 spaces
16 "noop no patches": {
17 input: `
18apiVersion: v1
19kind: Pod
20metadata:
21 name: vela-core-application-test
22 namespace: vela-system
23spec:
24 containers:
25 - command:
26 - /bin/bash
27 - -ec
28 - |2
29
30 set -e
31
32 echo "Application and its components are created"
33 image: oamdev/alpine-k8s:1.18.2
34 imagePullPolicy: IfNotPresent
35 name: vela-core-application-test
36 restartPolicy: Never
37 serviceAccountName: vela-core
38`,
39 output: `
40apiVersion: v1
41kind: Pod
42metadata:
43 name: vela-core-application-test
44 namespace: vela-system
45spec:
46 containers:
47 - command:
48 - /bin/bash
49 - -ec
50 - |2
51
52 set -e
53
54 echo "Application and its components are created"
55 image: oamdev/alpine-k8s:1.18.2
56 imagePullPolicy: IfNotPresent
57 name: vela-core-application-test
58 restartPolicy: Never
59 serviceAccountName: vela-core
60`,
61 },
62 // TODO Failing test cases
63 // "applies patch": {
64 // input: `apiVersion: v1
65 //kind: Pod
66 //metadata:
67 // annotations:
68 // helm.sh/hook: test
69 // helm.sh/hook-delete-policy: hook-succeeded
70 // name: vela-core-application-test

Callers

nothing calls this directly

Calls 2

ApplyMethod · 0.80
ErrorfMethod · 0.45

Tested by

no test coverage detected