MCPcopy
hub / github.com/argoproj/argo-cd / TestSelectiveSyncWithoutNamespace

Function TestSelectiveSyncWithoutNamespace

test/e2e/selective_sync_test.go:53–80  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

51}
52
53func TestSelectiveSyncWithoutNamespace(t *testing.T) {
54 selectedResourceNamespace := getNewNamespace(t)
55 defer func() {
56 if !t.Skipped() {
57 errors.NewHandler(t).FailOnErr(fixture.Run("", "kubectl", "delete", "namespace", selectedResourceNamespace))
58 }
59 }()
60 ctx := Given(t)
61 ctx.Prune(true).
62 Path("guestbook-with-namespace").
63 And(func() {
64 errors.NewHandler(t).FailOnErr(fixture.Run("", "kubectl", "create", "namespace", selectedResourceNamespace))
65 }).
66 SelectedResource("apps:Deployment:guestbook-ui").
67 When().
68 PatchFile("guestbook-ui-deployment-ns.yaml", fmt.Sprintf(`[{"op": "replace", "path": "/metadata/namespace", "value": %q}]`, selectedResourceNamespace)).
69 PatchFile("guestbook-ui-svc-ns.yaml", fmt.Sprintf(`[{"op": "replace", "path": "/metadata/namespace", "value": %q}]`, selectedResourceNamespace)).
70 CreateApp().
71 Sync().
72 Then().
73 Expect(Success("")).
74 Expect(OperationPhaseIs(OperationSucceeded)).
75 Expect(SyncStatusIs(SyncStatusCodeOutOfSync)).
76 Expect(ResourceHealthWithNamespaceIs("Deployment", "guestbook-ui", selectedResourceNamespace, health.HealthStatusHealthy)).
77 Expect(ResourceHealthWithNamespaceIs("Deployment", "guestbook-ui", ctx.DeploymentNamespace(), health.HealthStatusHealthy)).
78 Expect(ResourceSyncStatusWithNamespaceIs("Deployment", "guestbook-ui", selectedResourceNamespace, SyncStatusCodeSynced)).
79 Expect(ResourceSyncStatusWithNamespaceIs("Deployment", "guestbook-ui", ctx.DeploymentNamespace(), SyncStatusCodeSynced))
80}
81
82// In selectedResource to sync, namespace is provided
83func TestSelectiveSyncWithNamespace(t *testing.T) {

Callers

nothing calls this directly

Calls 15

NewHandlerFunction · 0.92
RunFunction · 0.92
getNewNamespaceFunction · 0.85
OperationPhaseIsFunction · 0.85
SyncStatusIsFunction · 0.85
FailOnErrMethod · 0.80
CreateAppMethod · 0.80
PatchFileMethod · 0.80
SelectedResourceMethod · 0.80
PruneMethod · 0.80

Tested by

no test coverage detected