(t *testing.T)
| 223 | } |
| 224 | |
| 225 | func 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 | |
| 262 | func TestHydratorWithPlugin(t *testing.T) { |
| 263 | ctx := Given(t) |
nothing calls this directly
no test coverage detected