Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

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.


public static final String SERVER_LIFECYCLE = "Server";
public static final String CLUSTER_LIFECYCLE = "Cluster";
Expand Down Expand Up @@ -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) {

Choose a reason for hiding this comment

The 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
Expand Down Expand Up @@ -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
Expand All @@ -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) {

Choose a reason for hiding this comment

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

Remove public


String domainName = model.split(":")[1];
String script = model.split(":")[0];
Expand Down Expand Up @@ -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);
}


Expand All @@ -268,7 +267,7 @@ void testSampleDomainInPv(String model) {
@Order(3)
@Test
@DisplayName("Test server lifecycle samples scripts")
void testServerLifecycleScripts() {
public void testServerLifecycleScripts() {

Choose a reason for hiding this comment

The 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";
Expand All @@ -292,7 +291,7 @@ void testServerLifecycleScripts() {
@Order(4)
@Test
@DisplayName("Test server lifecycle samples scripts with constant replica count")
void testServerLifecycleScriptsWithConstantReplicaCount() {
public void testServerLifecycleScriptsWithConstantReplicaCount() {

Choose a reason for hiding this comment

The 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
Expand All @@ -318,7 +317,7 @@ void testServerLifecycleScriptsWithConstantReplicaCount() {
@Order(5)
@Test
@DisplayName("Test cluster lifecycle scripts")
void testClusterLifecycleScripts() {
public void testClusterLifecycleScripts() {

Choose a reason for hiding this comment

The 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);
Expand All @@ -339,7 +338,7 @@ void testClusterLifecycleScripts() {
@Order(6)
@Test
@DisplayName("Test domain lifecycle scripts")
void testDomainLifecycleScripts() {
public void testDomainLifecycleScripts() {

Choose a reason for hiding this comment

The 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++) {
Expand All @@ -363,7 +362,7 @@ void testDomainLifecycleScripts() {
@Order(7)
@Test
@DisplayName("Manage Traefik Ingress Controller with setupLoadBalancer")
void testTraefikIngressController() {
public void testTraefikIngressController() {

Choose a reason for hiding this comment

The 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);
Expand All @@ -376,7 +375,7 @@ void testTraefikIngressController() {
@Order(8)
@Test
@DisplayName("Manage Voyager Ingress Controller with setupLoadBalancer")
void testVoyagerIngressController() {
public void testVoyagerIngressController() {

Choose a reason for hiding this comment

The 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);
Expand All @@ -389,7 +388,7 @@ void testVoyagerIngressController() {
@Order(9)
@Test
@DisplayName("Manage Nginx Ingress Controller with setupLoadBalancer")
void testNginxIngressController() {
public void testNginxIngressController() {

Choose a reason for hiding this comment

The 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);
Expand Down Expand Up @@ -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(),
Expand All @@ -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;
Expand Down