Skip to content

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

Merged
merged 3 commits into from
May 7, 2021

Conversation

hzhao-github
Copy link
Member

@hzhao-github hzhao-github commented Apr 30, 2021

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)

@hzhao-github hzhao-github requested review from anpanigr and ankedia May 3, 2021 10:26
@hzhao-github hzhao-github marked this pull request as ready for review May 3, 2021 10:26

// restore test env
result = assertDoesNotThrow(() ->
executeLifecycleScript(STOP_SERVER_SCRIPT, SERVER_LIFECYCLE, configServerName),
Copy link
Member

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea. Wii change

Copy link
Member Author

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);
Copy link
Member

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do

Copy link
Member Author

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";
Copy link
Member

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.

Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added more clearer descriptions

Copy link
Member

@rjeberhard rjeberhard left a 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.

Copy link
Member

@anpanigr anpanigr left a 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";
Copy link
Member

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.

Copy link
Member

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.

@rjeberhard rjeberhard merged commit 527d923 into main May 7, 2021
@robertpatrick robertpatrick deleted the scale-cluster branch January 31, 2022 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants