You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: move integration tests to feature packages and sub packages based on type (#2483)
* refactor: integration tests moved to feature packages and sub packages pased on type
Signed-off-by: Attila Mészáros <[email protected]>
* fix resource paths
Signed-off-by: Attila Mészáros <[email protected]>
* fixes
Signed-off-by: Attila Mészáros <[email protected]>
* link and test fixes
Signed-off-by: Attila Mészáros <[email protected]>
* format
Signed-off-by: Attila Mészáros <[email protected]>
* wip
Signed-off-by: Attila Mészáros <[email protected]>
* old service
Signed-off-by: Attila Mészáros <[email protected]>
* test fix
Signed-off-by: Attila Mészáros <[email protected]>
* refactor: remove unneeded classes
Signed-off-by: Chris Laprun <[email protected]>
* fix: typo in package name
Signed-off-by: Chris Laprun <[email protected]>
---------
Signed-off-by: Attila Mészáros <[email protected]>
Signed-off-by: Chris Laprun <[email protected]>
Co-authored-by: Chris Laprun <[email protected]>
@@ -310,7 +310,7 @@ There might be casees, though, where it might be problematic to call the `desire
310
310
- Override the `selectManagedSecondaryResource` method, if your `DependentResource` extends `AbstractDependentResource`.
311
311
This should be relatively simple to override this method to optimize the matching to your needs. You can see an
312
312
example of such an implementation in
313
-
the [`ExternalWithStateDependentResource`](https://github.com/operator-framework/java-operator-sdk/blob/6cd0f884a7c9b60c81bd2d52da54adbd64d6e118/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/externalstate/ExternalWithStateDependentResource.java#L43-L49)
313
+
the [`ExternalWithStateDependentResource`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/externalstate/ExternalWithStateDependentResource.java)
314
314
class.
315
315
- Override the `managedSecondaryResourceID` method, if your `DependentResource` extends `KubernetesDependentResource`,
316
316
where it's very often possible to easily determine the `ResourceID` of the secondary resource. This would probably be
@@ -333,9 +333,9 @@ would look as follows:
333
333
```
334
334
335
335
A sample is provided as an integration test both:
336
-
for [managed](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/MultipleManagedDependentNoDiscriminatorIT.java)
336
+
for [managed](https://github.com/operator-framework/java-operator-sdk/tree/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/multipledrsametypenodiscriminator)
337
337
338
-
For [standalone](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/MultipleDependentResourceIT.java)
338
+
For [standalone](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/multipledependentresource)
339
339
cases.
340
340
341
341
## Bulk Dependent Resources
@@ -352,11 +352,11 @@ implement the
352
352
interface.
353
353
354
354
Various examples are provided
355
-
as [integration tests](https://github.com/java-operator-sdk/java-operator-sdk/tree/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/bulkdependent)
355
+
as [integration tests](https://github.com/operator-framework/java-operator-sdk/tree/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/bulkdependent)
356
356
.
357
357
358
358
To see how bulk dependent resources interact with workflow conditions, please refer to this
@@ -377,11 +377,11 @@ interface. Note that most of the JOSDK-provided dependent resource implementatio
377
377
`PollingDependentResource` or `PerResourcePollingDependentResource` already extends
378
378
`AbstractExternalDependentResource`, thus supporting external state tracking out of the box.
379
379
380
-
See [integration test](https://github.com/java-operator-sdk/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/ExternalStateDependentIT.java)
380
+
See [integration test](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/externalstate/ExternalStateDependentIT.java)
381
381
as a sample.
382
382
383
383
For a better understanding it might be worth to study
384
-
a [sample implementation](https://github.com/java-operator-sdk/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/externalstate/ExternalStateReconciler.java)
384
+
a [sample implementation](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/externalstate/ExternalStateReconciler.java)
385
385
without dependent resources.
386
386
387
387
Please also refer to the [docs](/docs/patterns-and-best-practices#managing-state) for managing state in
@@ -395,7 +395,7 @@ created. For example, if three bulk dependent resources associated with external
395
395
three associated `ConfigMaps` (assuming `ConfigMaps` are used as a state-tracking resource) will
396
396
also be created, one per dependent resource.
397
397
398
-
See [integration test](https://github.com/java-operator-sdk/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/ExternalStateBulkIT.java)
398
+
See [integration test](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/externalstate/externalstatebulkdependent)
399
399
as a sample.
400
400
401
401
## GenericKubernetesResource based Dependent Resources
practice in general) - so for example if there are two config map dependents, either
436
436
there should be a shared event source between them, or a label selector on the event sources
437
437
to select only the relevant events, see
438
-
in [related integration test](https://github.com/java-operator-sdk/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/orderedmanageddependent/ConfigMapDependentResource1.java)
438
+
in [related integration test](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/workflow/orderedmanageddependent/ConfigMapDependentResource2.java)
439
439
.
440
440
441
441
## "Read-only" Dependent Resources vs. Event Source
To contrast, see the same sample, this time [without SSA](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/patchresourceandstatusnossa/PatchResourceAndStatusNoSSAReconciler.java#L16-L16).
To contrast, see the same sample, this time [without SSA](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/patchresourceandstatusnossa/PatchResourceAndStatusNoSSAReconciler.java).
102
102
103
103
Non-SSA based patch is still supported.
104
104
You can control whether or not to use SSA
105
105
using [`ConfigurationServcice.useSSAToPatchPrimaryResource()`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java#L385-L385)
106
106
and the related `ConfigurationServiceOverrider.withUseSSAToPatchPrimaryResource` method.
107
107
Related integration test can be
108
-
found [here](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/patchresourceandstatusnossa/PatchResourceAndStatusNoSSAReconciler.java).
108
+
found [here](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/patchresourceandstatusnossa).
109
109
110
110
Handling resources directly using the client, instead of delegating these updates operations to JOSDK by returning
111
111
an `UpdateControl` at the end of your reconciliation, should work appropriately. However, we do recommend to
@@ -204,7 +204,7 @@ A Controller can be registered for a non-custom resource, so well known Kubernet
204
204
`Ingress`, `Deployment`,...).
205
205
206
206
See
207
-
the [integration test](https://github.com/java-operator-sdk/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/deployment/DeploymentReconciler.java)
207
+
the [integration test](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/deployment)
208
208
for reconciling deployments.
209
209
210
210
```java
@@ -531,7 +531,7 @@ between a primary resource and its associated secondary resources using an imple
531
531
`PrimaryToSecondaryMapper` interface. This is typically needed when there are many-to-one or
532
532
many-to-many relationships between primary and secondary resources, e.g. when the primary resource
533
533
is referencing secondary resources.
534
-
See [PrimaryToSecondaryIT](https://github.com/java-operator-sdk/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/PrimaryToSecondaryIT.java)
534
+
See [PrimaryToSecondaryIT](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/primarytosecondary/PrimaryToSecondaryIT.java)
535
535
integration test for a sample.
536
536
537
537
### Built-in EventSources
@@ -667,7 +667,7 @@ As seen in the above code snippet, the informer will have the initial namespaces
667
667
controller, but also will adjust the target namespaces if it changes for the controller.
668
668
669
669
See also
670
-
the [integration test](https://github.com/java-operator-sdk/java-operator-sdk/blob/ec37025a15046d8f409c77616110024bf32c3416/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/changenamespace/ChangeNamespaceTestReconciler.java)
670
+
the [integration test](https://github.com/operator-framework/java-operator-sdk/tree/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/changenamespace)
that will prevent the associated dependent resource from being activated if the Custom Resource Definition associated
48
48
with the dependent's resource type is not present on the cluster.
49
-
See related [integration test](https://github.com/operator-framework/java-operator-sdk/blob/ba5e33527bf9e3ea0bd33025ccb35e677f9d44b4/operator-framework/src/test/java/io/javaoperatorsdk/operator/CRDPresentActivationConditionIT.java).
49
+
See related [integration test](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/workflow/crdpresentactivation).
50
50
51
51
To have multiple resources of same type with an activation condition is a bit tricky, since you
52
52
don't want to have multiple `InformerEventSource` for the same type, you have to explicitly
@@ -67,7 +67,7 @@ You can access the results for conditions from the `WorkflowResult` instance tha
67
67
evaluated. You can access that result from the `ManagedWorkflowAndDependentResourceContext` accessible from the
68
68
reconciliation `Context`. You can then access individual condition results using the `
69
69
getDependentConditionResult` methods. You can see an example of this
70
-
in [this integration test](https://github.com/operator-framework/java-operator-sdk/blob/fd0e92c0de55c47d5df50658cf4e147ee5e6102d/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/workflowallfeature/WorkflowAllFeatureReconciler.java#L44-L49).
70
+
in [this integration test](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/workflow/workflowallfeature/WorkflowAllFeatureReconciler.java).
71
71
72
72
## Defining Workflows
73
73
@@ -350,7 +350,7 @@ checks that the resource is actually removed or that it, at least, doesn't have
350
350
provides such a delete post-condition implementation in the form of
Also, check usage in an [integration test](https://github.com/java-operator-sdk/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/manageddependentdeletecondition/ManagedDependentDefaultDeleteConditionReconciler.java).
353
+
Also, check usage in an [integration test](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/workflow/manageddependentdeletecondition/ManagedDependentDefaultDeleteConditionReconciler.java).
354
354
355
355
In such cases the Kubernetes Dependent Resource should extend `CRUDNoGCKubernetesDependentResource`
356
356
and NOT `CRUDKubernetesDependentResource` since otherwise the Kubernetes Garbage Collector would delete the resources.
@@ -373,13 +373,13 @@ ManagedWorkflowAndDependentResourceContext` retrieved from the reconciliation `C
373
373
resource reconciler `reconcile` method arguments.
374
374
375
375
See
376
-
related [integration test](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/WorkflowExplicitInvocationIT.java)
376
+
related [integration test](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/workflow/workflowexplicitinvocation)
377
377
for more details.
378
378
379
379
For `cleanup`, if the `Cleaner` interface is implemented, the `cleanupManageWorkflow()` needs to be called explicitly.
380
380
However, if `Cleaner` interface is not implemented, it will be called implicitly.
381
381
See
382
-
related [integration test](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/WorkflowExplicitCleanupIT.java).
382
+
related [integration test](https://github.com/operator-framework/java-operator-sdk/tree/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/workflow/workflowexplicitcleanup).
383
383
384
384
While nothing prevents calling the workflow multiple times in a reconciler, it isn't typical or even recommended to do
385
385
so. Conversely, if explicit invocation is requested but `reconcileManagedWorkflow` is not called in the primary resource
Copy file name to clipboardExpand all lines: operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationServiceOverrider.java
-1Lines changed: 0 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -210,7 +210,6 @@ public boolean checkCRDAndValidateLocalModel() {
0 commit comments