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

Function TestHydratorWithDirectory

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

Source from the content-addressed store, hash-verified

223}
224
225func TestHydratorWithDirectory(t *testing.T) {
226 ctx := Given(t)
227 ctx.Path("hydrator-directory").
228 When().
229 CreateFromFile(func(app *Application) {
230 app.Spec.Source = nil
231 app.Spec.SourceHydrator = &SourceHydrator{
232 DrySource: DrySource{
233 RepoURL: fixture.RepoURL(fixture.RepoURLTypeFile),
234 Path: "hydrator-directory",
235 TargetRevision: "HEAD",
236 Directory: &ApplicationSourceDirectory{
237 Recurse: true,
238 },
239 },
240 SyncSource: SyncSource{
241 TargetBranch: "env/test",
242 Path: "hydrator-directory-output",
243 },
244 }
245 }).
246 Refresh(RefreshTypeNormal).
247 Then().
248 Expect(SyncStatusIs(SyncStatusCodeOutOfSync)).
249 When().
250 Sync().
251 Then().
252 Expect(OperationPhaseIs(OperationSucceeded)).
253 Expect(SyncStatusIs(SyncStatusCodeSynced)).
254 And(func(_ *Application) {
255 // Verify that the recurse option was applied by checking the ConfigMap from subdir
256 _, err := fixture.Run("", "kubectl", "-n="+ctx.DeploymentNamespace(),
257 "get", "configmap", "my-map-subdir")
258 require.NoError(t, err)
259 })
260}
261
262func TestHydratorWithPlugin(t *testing.T) {
263 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