-
Notifications
You must be signed in to change notification settings - Fork 217
Added tests to use script scaleCluster.sh/ClusterStatus.sh #2350
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
|
||
// restore test env | ||
result = assertDoesNotThrow(() -> | ||
executeLifecycleScript(STOP_SERVER_SCRIPT, SERVER_LIFECYCLE, configServerName), |
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 you use the same script scaleCluster.sh to scale down the cluster instead of stopServer.sh script
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 idea. Wii change
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.
changed
|
||
// restore test env | ||
logger.info("Stop managed server using the script"); | ||
executeLifecycleScript(STOP_SERVER_SCRIPT, SERVER_LIFECYCLE, dynamicServerName); |
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 you use the same script scaleCluster.sh to scale down the cluster instead of stopServer.sh script
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.
will do
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.
changed
executeLifecycleScript(STATUS_CLUSTER_SCRIPT, CLUSTER_LIFECYCLE, CLUSTER_2), | ||
String.format("Failed to run %s", STATUS_CLUSTER_SCRIPT)); | ||
|
||
String regex = ".*" + CLUSTER_2 + "(\\s+)0(\\s+)2(\\s+)2(\\s+)2(\\s+)2"; |
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.
It would help me to have a comment describing what this regex is intended to match.
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.
Just to clarify... I'm looking for a description of the regex expression specifically. What is it intended to match? If someday this test failed and we needed to fix the regex expression I would want to know what it's supposed to match so I could figure out if it is correct.
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 more clearer descriptions
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.
Looking for more information on the regex expressions as described in the comment.
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
// String regex matches below | ||
// cluster min max goal current ready | ||
// clusterName 1 5 1 1 1 | ||
String regex = ".*" + CLUSTER_1 + "(\\s+)1(\\s+)5(\\s+)1(\\s+)1(\\s+)1"; |
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.
What call returns the formatted data given above? I can see how the regex matches this, but this seems really brittle.
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.
I see it's from clusterStatus.sh... Okay, I guess that's what we have to test.
usecase:
Scale the configured/dynamic cluster using the sample script scaleCluster.sh script
Verify that server(s) in the configured/dynamic cluster are scaled up and in RUNNING state.
Verify that server(s) in the dynamic/configured cluster are not affected.
Restore the env
Jenkins job:
https://build.weblogick8s.org:8443/job/weblogic-kubernetes-operator-kind-new/4934 (parallel)
Passed Jenkins job with latest changes
https://build.weblogick8s.org:8443/job/weblogic-kubernetes-operator-kind-new/4954 (parallel)