-
Notifications
You must be signed in to change notification settings - Fork 217
Add tests for overrideDistributionStrategy #1768
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…es-operator into distribution-strategy
…es-operator into distribution-strategy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
+ "{\"op\": \"add\",\"path\": \"/spec/clusters/-\", \"value\": " | ||
+ " {\"clusterName\" : \"" + clusterName + "\", \"replicas\": 2, \"serverStartState\": \"RUNNING\"}" | ||
+ "}," | ||
+ "{\"op\": \"add\", \"path\": \"/spec/introspectVersion\", \"value\": \"4\"}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we get the current Introspect version and bump it instead of hard-coding to 4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Added a new utility method getNextIntrospectVersion to auto increment the introspectVersion.
new-integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIntrospectVersion.java
Show resolved
Hide resolved
assertTrue(patchDomainCustomResource(domainUid, domainNamespace, patch, V1Patch.PATCH_FORMAT_JSON_PATCH), | ||
"Failed to patch domain"); | ||
|
||
//does changing overrideDistributionStrategy needs restart of server pods? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a TODO comment to make it visible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a TODO comment
assertTrue(patchDomainCustomResource(domainUid, domainNamespace, patch, V1Patch.PATCH_FORMAT_JSON_PATCH), | ||
"Failed to patch domain"); | ||
|
||
//does changing overrideDistributionStrategy needs restart of server pods? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add TODO Comments or the BUG/JIRA Number
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a TODO comment
...integration-tests/src/test/java/oracle/weblogic/kubernetes/ItConfigDistributionStrategy.java
Show resolved
Hide resolved
...integration-tests/src/test/java/oracle/weblogic/kubernetes/ItConfigDistributionStrategy.java
Show resolved
Hide resolved
...integration-tests/src/test/java/oracle/weblogic/kubernetes/ItConfigDistributionStrategy.java
Show resolved
Hide resolved
* @param domainUid domain UID | ||
* @throws IOException when creating pv path fails | ||
*/ | ||
private void createPV(String pvName, String domainUid) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Common Test Utility candidate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like Bhavani's comments I need to refactor some more classes to use methods from CommonTestUtils for the operations. Will do it in separate PR.
…test failures in kind cluster runs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hi Sankar - Is there a test that corresponds to the use case you described in your comment on Russ' latest candidate pull fix? Namely: Have two override files in an overridesConfig map and verify they work. Then redeploy the cm where one is kept the same and the other's content is changed (while keeping the same name). Then change the introspectVersion, and verify (a) none of the servers 'rolled', (b) that the changed override file is taking effect, and finally (c) that the override from an unchanged override file is still taking effect. |
content and applying the override through introspection
Added tests to verify the overrideDistributionStrategy for configuration overrides.
The following tests are added.
For overrideDistributionStrategy with a DEFAULT settings(not values set for field)
For overrideDistributionStrategy with a DYNAMIC setting
For overrideDistributionStrategy with a ON_RESTART setting
For overrideDistributionStrategy with a RESTART setting - invalid value
Tests override config.xml and JDBC datasource entities and verifies the overrides are applied when overridesConfigMap is specified with a configmap containing override files.
Also verification is done whether the overrides files are removed from pods when overridesConfigMap is deleted from domain resource.
Test Result.
https://build.weblogick8s.org:8443/job/weblogic-kubernetes-operator-kind-new/616/testReport/oracle.weblogic.kubernetes/
https://build.weblogick8s.org:8443/job/weblogic-kubernetes-operator-kind-new/617/testReport/oracle.weblogic.kubernetes/