-
Notifications
You must be signed in to change notification settings - Fork 216
Added test for sample script update_domain.sh ( wlst ) #2496
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,7 +70,7 @@ | |
| @TestMethodOrder(MethodOrderer.OrderAnnotation.class) | ||
| @DisplayName("Verify the domain on pv, domain in image samples using wlst and wdt and domain lifecycle scripts") | ||
| @IntegrationTest | ||
| class ItWlsSamples { | ||
| public class ItWlsSamples { | ||
|
|
||
| public static final String SERVER_LIFECYCLE = "Server"; | ||
| public static final String CLUSTER_LIFECYCLE = "Cluster"; | ||
|
|
@@ -155,7 +155,7 @@ public static void initAll(@Namespaces(5) List<String> namespaces) { | |
| @ParameterizedTest | ||
| @MethodSource("paramProvider") | ||
| @DisplayName("Test samples using domain in image") | ||
| void testSampleDomainInImage(String model) { | ||
| public void testSampleDomainInImage(String model) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove public - see earlier comment. |
||
| String domainName = model.split(":")[1]; | ||
| String script = model.split(":")[0]; | ||
| String imageName = (KIND_REPO != null | ||
|
|
@@ -208,7 +208,7 @@ void testSampleDomainInImage(String model) { | |
|
|
||
| /** | ||
| * Test domain in pv samples using domains created by wlst and wdt. | ||
| * In domain on pv using wdt usecase, we also run the update domain script from the samples, | ||
| * In domain on pv using wdt and wlst usecases, we also run the update domain script from the samples, | ||
| * to add a cluster to the domain. | ||
| * | ||
| * @param model domain name and script type to create domain. Acceptable values of format String:wlst|wdt | ||
|
|
@@ -217,7 +217,7 @@ void testSampleDomainInImage(String model) { | |
| @ParameterizedTest | ||
| @MethodSource("paramProvider") | ||
| @DisplayName("Test samples using domain in pv") | ||
| void testSampleDomainInPv(String model) { | ||
| public void testSampleDomainInPv(String model) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove public |
||
|
|
||
| String domainName = model.split(":")[1]; | ||
| String script = model.split(":")[0]; | ||
|
|
@@ -255,10 +255,9 @@ void testSampleDomainInPv(String model) { | |
| // run create-domain.sh to create domain.yaml file, run kubectl to create the domain and verify | ||
| createDomainAndVerify(domainName, sampleBase); | ||
|
|
||
| if (script.equals("wdt")) { | ||
| copyModelFileForUpdateDomain(sampleBase); | ||
| updateDomainAndVerify(domainName, sampleBase, domainNamespace); | ||
| } | ||
| // update the domain to add a new cluster | ||
| copyModelFileForUpdateDomain(sampleBase); | ||
| updateDomainAndVerify(domainName, sampleBase, domainNamespace, script); | ||
| } | ||
|
|
||
|
|
||
|
|
@@ -268,7 +267,7 @@ void testSampleDomainInPv(String model) { | |
| @Order(3) | ||
| @Test | ||
| @DisplayName("Test server lifecycle samples scripts") | ||
| void testServerLifecycleScripts() { | ||
| public void testServerLifecycleScripts() { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove public |
||
|
|
||
| // Verify that stopServer script execution shuts down server pod and replica count is decremented | ||
| String serverName = managedServerNameBase + "1"; | ||
|
|
@@ -292,7 +291,7 @@ void testServerLifecycleScripts() { | |
| @Order(4) | ||
| @Test | ||
| @DisplayName("Test server lifecycle samples scripts with constant replica count") | ||
| void testServerLifecycleScriptsWithConstantReplicaCount() { | ||
| public void testServerLifecycleScriptsWithConstantReplicaCount() { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove public |
||
| String serverName = managedServerNameBase + "1"; | ||
| String keepReplicaCountConstantParameter = "-k"; | ||
| // Verify that replica count is not changed when using "-k" parameter and a replacement server is started | ||
|
|
@@ -318,7 +317,7 @@ void testServerLifecycleScriptsWithConstantReplicaCount() { | |
| @Order(5) | ||
| @Test | ||
| @DisplayName("Test cluster lifecycle scripts") | ||
| void testClusterLifecycleScripts() { | ||
| public void testClusterLifecycleScripts() { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove public |
||
|
|
||
| // Verify all clustered server pods are shut down after stopCluster script execution | ||
| executeLifecycleScript(STOP_CLUSTER_SCRIPT, CLUSTER_LIFECYCLE, clusterName); | ||
|
|
@@ -339,7 +338,7 @@ void testClusterLifecycleScripts() { | |
| @Order(6) | ||
| @Test | ||
| @DisplayName("Test domain lifecycle scripts") | ||
| void testDomainLifecycleScripts() { | ||
| public void testDomainLifecycleScripts() { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove public |
||
| // Verify all WebLogic server instance pods are shut down after stopDomain script execution | ||
| executeLifecycleScript(STOP_DOMAIN_SCRIPT, DOMAIN, null); | ||
| for (int i = 1; i <= replicaCount; i++) { | ||
|
|
@@ -363,7 +362,7 @@ void testDomainLifecycleScripts() { | |
| @Order(7) | ||
| @Test | ||
| @DisplayName("Manage Traefik Ingress Controller with setupLoadBalancer") | ||
| void testTraefikIngressController() { | ||
| public void testTraefikIngressController() { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove public |
||
| setupSample(); | ||
| Path scriptBase = Paths.get(tempSamplePath.toString(), "charts/util"); | ||
| setupLoadBalancer(scriptBase, "traefik", " -c -n " + traefikNamespace); | ||
|
|
@@ -376,7 +375,7 @@ void testTraefikIngressController() { | |
| @Order(8) | ||
| @Test | ||
| @DisplayName("Manage Voyager Ingress Controller with setupLoadBalancer") | ||
| void testVoyagerIngressController() { | ||
| public void testVoyagerIngressController() { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove public |
||
| setupSample(); | ||
| Path scriptBase = Paths.get(tempSamplePath.toString(), "charts/util"); | ||
| setupLoadBalancer(scriptBase, "voyager", " -c -n " + voyagerNamespace); | ||
|
|
@@ -389,7 +388,7 @@ void testVoyagerIngressController() { | |
| @Order(9) | ||
| @Test | ||
| @DisplayName("Manage Nginx Ingress Controller with setupLoadBalancer") | ||
| void testNginxIngressController() { | ||
| public void testNginxIngressController() { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove public |
||
| setupSample(); | ||
| Path scriptBase = Paths.get(tempSamplePath.toString(), "charts/util"); | ||
| setupLoadBalancer(scriptBase, "nginx", " -c -n " + nginxNamespace); | ||
|
|
@@ -621,7 +620,10 @@ private void createDomainAndVerify(String domainName, Path sampleBase, String... | |
| } | ||
| } | ||
|
|
||
| private void updateDomainAndVerify(String domainName, Path sampleBase, String domainNamespace) { | ||
| private void updateDomainAndVerify(String domainName, | ||
| Path sampleBase, | ||
| String domainNamespace, | ||
| String script) { | ||
| //First copy the update model file to wdt dir and rename it wdt-model_dynamic.yaml | ||
| assertDoesNotThrow(() -> { | ||
| copyFile(Paths.get(sampleBase.toString(), UPDATE_MODEL_FILE).toFile(), | ||
|
|
@@ -640,6 +642,20 @@ private void updateDomainAndVerify(String domainName, Path sampleBase, String do | |
| boolean result = Command.withParams(params).execute(); | ||
| assertTrue(result, "Failed to create domain.yaml"); | ||
|
|
||
| // For the domain created by WLST, we have to apply domain.yaml created by update-domain.sh | ||
| // before initiating introspection of the domain to start the second cluster that was just added | ||
| // otherwise the newly added Cluster 'cluster-2' is not added to the domain1. | ||
| if (script.equals("wlst")) { | ||
| // run kubectl to update the domain | ||
| logger.info("Run kubectl to create the domain"); | ||
| params = new CommandParams().defaults(); | ||
| params.command("kubectl apply -f " | ||
| + Paths.get(sampleBase.toString(), "weblogic-domains/" + domainName + "/domain.yaml").toString()); | ||
|
|
||
| result = Command.withParams(params).execute(); | ||
| assertTrue(result, "Failed to create domain custom resource"); | ||
| } | ||
|
|
||
| // Have to initiate introspection of the domain to start the second cluster that was just added | ||
| // Call introspectDomain.sh | ||
| String extraParams = " -d " + domainName + " -n " + domainNamespace; | ||
|
|
||
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 please remove the public from here and also all the test methods?
Ryan merged #2492 to make this change and you are overwriting this change.