github.com/argoproj/argo-cd@v1.8.7/test/e2e/diff_test.go (about) 1 package e2e 2 3 import ( 4 "testing" 5 6 . "github.com/argoproj/gitops-engine/pkg/sync/common" 7 8 . "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1" 9 . "github.com/argoproj/argo-cd/test/e2e/fixture/app" 10 "github.com/argoproj/argo-cd/test/fixture/test" 11 ) 12 13 func TestPatch(t *testing.T) { 14 test.LocalOnly(t) 15 Given(t). 16 Path("two-nice-pods"). 17 When(). 18 AddFile("pod-3.yaml", `apiVersion: v1 19 kind: Pod 20 metadata: 21 name: pod-3 22 spec: 23 containers: 24 - name: main 25 image: alpine:3.10.2 26 imagePullPolicy: IfNotPresent 27 command: 28 - "true" 29 restartPolicy: Never 30 `). 31 Create(). 32 Sync(). 33 Then(). 34 Expect(OperationPhaseIs(OperationSucceeded)). 35 Expect(SyncStatusIs(SyncStatusCodeSynced)). 36 When(). 37 DeleteFile("pod-1.yaml"). 38 PatchFile("pod-2.yaml", `[{"op": "add", "path": "/metadata/annotations", "value": {"bar": "Baz"}}]`). 39 AddFile("pod-4.yaml", `apiVersion: v1 40 kind: Pod 41 metadata: 42 name: pod-4 43 spec: 44 containers: 45 - name: main 46 image: alpine:3.10.2 47 imagePullPolicy: IfNotPresent 48 command: 49 - "true" 50 restartPolicy: Never 51 `). 52 Refresh(RefreshTypeHard). 53 Then(). 54 Expect(SyncStatusIs(SyncStatusCodeOutOfSync)) 55 }