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

Function TestHydratorWithKustomize

test/e2e/hydrator_test.go:186–223  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

184}
185
186func TestHydratorWithKustomize(t *testing.T) {
187 ctx := Given(t)
188 ctx.Path("hydrator-kustomize").
189 When().
190 CreateFromFile(func(app *Application) {
191 app.Spec.Source = nil
192 app.Spec.SourceHydrator = &SourceHydrator{
193 DrySource: DrySource{
194 RepoURL: fixture.RepoURL(fixture.RepoURLTypeFile),
195 Path: "hydrator-kustomize",
196 TargetRevision: "HEAD",
197 Kustomize: &ApplicationSourceKustomize{
198 NameSuffix: "-inline",
199 },
200 },
201 SyncSource: SyncSource{
202 TargetBranch: "env/test",
203 Path: "hydrator-kustomize-output",
204 },
205 }
206 }).
207 Refresh(RefreshTypeNormal).
208 Then().
209 Expect(SyncStatusIs(SyncStatusCodeOutOfSync)).
210 When().
211 Sync().
212 Then().
213 Expect(OperationPhaseIs(OperationSucceeded)).
214 Expect(SyncStatusIs(SyncStatusCodeSynced)).
215 And(func(_ *Application) {
216 // Verify that the inline kustomize nameSuffix was applied
217 // kustomization.yaml has namePrefix: kustomize-, and we added nameSuffix: -inline
218 // So the ConfigMap name should be kustomize-my-map-inline
219 _, err := fixture.Run("", "kubectl", "-n="+ctx.DeploymentNamespace(),
220 "get", "configmap", "kustomize-my-map-inline")
221 require.NoError(t, err)
222 })
223}
224
225func TestHydratorWithDirectory(t *testing.T) {
226 ctx := Given(t)

Callers

nothing calls this directly

Calls 14

RepoURLFunction · 0.92
RunFunction · 0.92
SyncStatusIsFunction · 0.85
OperationPhaseIsFunction · 0.85
RefreshMethod · 0.80
CreateFromFileMethod · 0.80
SyncMethod · 0.65
DeploymentNamespaceMethod · 0.65
GivenFunction · 0.50
AndMethod · 0.45
ExpectMethod · 0.45
ThenMethod · 0.45

Tested by

no test coverage detected