Skip to content

Commit 2ebca5b

Browse files
committed
jenkins-ignore consolidate tests
1 parent 5165cc7 commit 2ebca5b

File tree

2 files changed

+17
-134
lines changed

2 files changed

+17
-134
lines changed

integration-tests/USECASES.MD

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,4 @@ Configuration Overrides Usecases
9494
| Server Discovery | Use Case |
9595
| --- | --- |
9696
| Discover a newly started server | stop operator and apply the modified domain.yaml with replicas count increated, restart Operator and verify that the cluster is scaled up accordingly |
97-
| Discover running servers | restart Operator and verify that it discovers running servers and a newly started server by scaling up cluster |
98-
| Discover running servers | restart both Operator and admin server. Verify Operator connects to newly started server by scaling up cluster |
99-
| Liveness probe | restart Operator and verify the liveness probe by killing all managed servers in the cluster |
100-
| Liveness probe | Verify the liveness probe by killing a managed server |
97+
| Liveness probe | restart Operator and verify the liveness probe by killing admin server and all managed servers in the cluster |

integration-tests/src/test/java/oracle/kubernetes/operator/ITServerDiscovery.java

Lines changed: 16 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ public void testOPConnToNewMS() throws Exception {
117117
logger.info("Start a new managed server, managed-server3 using command:\n" + cmd);
118118
TestUtils.exec(cmd);
119119

120-
logger.info("Start the Operator");
120+
logger.info("Restart the Operator");
121121
operator.startUsingReplicas();
122122

123-
logger.info("Check the newly created managed-server3 is running");
123+
logger.info("Check if the newly created managed-server3 is running");
124124
int replicas = 3;
125125
verifyPodReady(replicas);
126126

@@ -132,38 +132,13 @@ public void testOPConnToNewMS() throws Exception {
132132
}
133133

134134
/**
135-
* Stop and restart Operator and verify that it discovers running servers and a newly started
136-
* server by scaling up cluster. Verify that the cluster scale up is not impacted.
135+
* Stop Operator. Kill admin server and all managed servers in domain cluster. Restart Operator.
136+
* Verify that it restarts admin server and all managed servers in domain cluster.
137137
*
138138
* @throws Exception
139139
*/
140140
@Test
141-
public void testOPReconnToRunningMSAndScaleUp() throws Exception {
142-
Assume.assumeFalse(QUICKTEST);
143-
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
144-
logTestBegin(testMethodName);
145-
146-
logger.info("Restart the Operator");
147-
operator.restartUsingReplicas();
148-
149-
int msIncrNum = 1;
150-
scaleUpAndverify(msIncrNum);
151-
152-
// restore the test env
153-
int msDecrNum = 1;
154-
scaleDownAndverify(msDecrNum);
155-
156-
logger.info("SUCCESS - " + testMethodName);
157-
}
158-
159-
/**
160-
* Stop Operator and admin server. Restart Operator. Verify that it restarts admin server and
161-
* discovers running servers. Verify that the cluster scale up is noy impacted.
162-
*
163-
* @throws Exception
164-
*/
165-
@Test
166-
public void testOPAdminReconnToDomain() throws Exception {
141+
public void testOPMSReconnToDomain() throws Exception {
167142
Assume.assumeFalse(QUICKTEST);
168143
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
169144
logTestBegin(testMethodName);
@@ -173,68 +148,39 @@ public void testOPAdminReconnToDomain() throws Exception {
173148
String domainUid = domain.getDomainUid();
174149
String adminServerName = (String) domainMap.get("adminServerName");
175150
String adminServerPodName = domainUid + "-" + adminServerName;
151+
String managedServerNameBase = domainMap.get("managedServerNameBase").toString();
152+
String clusterName = domainMap.get("clusterName").toString();
176153

177154
logger.info("Stop the Operator");
178155
operator.stopUsingReplicas();
179156

157+
// Stop admin server
180158
String cmd = "kubectl delete po/" + adminServerPodName + " -n " + domainNS;
181159
logger.info("Stop admin server <" + adminServerPodName + "> using command:\n" + cmd);
182160
TestUtils.exec(cmd);
183161

184-
logger.info("Checking if admin pod <" + adminServerPodName + "> is deleted");
162+
logger.info("Check if admin pod <" + adminServerPodName + "> is deleted");
185163
TestUtils.checkPodDeleted(adminServerPodName, domainNS);
186164

187-
logger.info("Start the Operator and admin server");
188-
operator.startUsingReplicas();
189-
190-
logger.info("Checking admin server <" + adminServerPodName + "> is running");
191-
TestUtils.checkPodReady(adminServerPodName, domainNS);
192-
193-
int msIncrNum = 1;
194-
scaleUpAndverify(msIncrNum);
195-
196-
// restore the test env
197-
int msDecrNum = 1;
198-
scaleDownAndverify(msDecrNum);
199-
200-
logger.info("SUCCESS - " + testMethodName);
201-
}
202-
203-
/**
204-
* Stop Operator. Kill all managed servers. Restart Operator. Verify that it restarts all managed
205-
* servers.
206-
*
207-
* @throws Exception
208-
*/
209-
@Test
210-
public void testOPMSReconnToDomain() throws Exception {
211-
Assume.assumeFalse(QUICKTEST);
212-
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
213-
logTestBegin(testMethodName);
214-
215-
Map<String, Object> domainMap = domain.getDomainMap();
216-
String domainNS = domainMap.get("namespace").toString();
217-
String managedServerNameBase = domainMap.get("managedServerNameBase").toString();
218-
String domainUid = domain.getDomainUid();
219-
220-
logger.info("Stop the Operator");
221-
operator.stopUsingReplicas();
165+
// Stop all managed servers in the cluster
166+
int replicaCnt = TestUtils.getClusterReplicas(domainUid, clusterName, domainNS);
222167

223-
// Delte all managed servers in the cluster
224-
int replicaCnt = getReplicaCnt();
225168
for (int i = 1; i <= replicaCnt; i++) {
226169
String msPodName = domainUid + "-" + managedServerNameBase + i;
227-
String cmd = "kubectl delete po/" + msPodName + " -n " + domainNS;
170+
cmd = "kubectl delete po/" + msPodName + " -n " + domainNS;
228171
logger.info("Stop managed server <" + msPodName + "> using command:\n" + cmd);
229172
TestUtils.exec(cmd);
230173

231174
logger.info("Checking if ms pod <" + msPodName + "> is deleted");
232175
TestUtils.checkPodDeleted(msPodName, domainNS);
233176
}
234177

235-
logger.info("Start the Operator");
178+
logger.info("Restart the Operator");
236179
operator.startUsingReplicas();
237180

181+
logger.info("Check if admin pod <" + adminServerPodName + "> is running");
182+
TestUtils.checkPodReady(adminServerPodName, domainNS);
183+
238184
for (int i = 1; i <= replicaCnt; i++) {
239185
String msPodName = domainUid + "-" + managedServerNameBase + i;
240186
logger.info("Checking if ms pod <" + msPodName + "> is running");
@@ -244,38 +190,6 @@ public void testOPMSReconnToDomain() throws Exception {
244190
logger.info("SUCCESS - " + testMethodName);
245191
}
246192

247-
/**
248-
* Stop Operator. Kill one managed server. Restart Operator. Verify that it restarts the killed
249-
* managed server.
250-
*
251-
* @throws Exception
252-
*/
253-
@Test
254-
public void testOPRestartDeadMS() throws Exception {
255-
Assume.assumeFalse(QUICKTEST);
256-
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
257-
logTestBegin(testMethodName);
258-
259-
Map<String, Object> domainMap = domain.getDomainMap();
260-
String domainNS = domainMap.get("namespace").toString();
261-
String managedServerNameBase = domainMap.get("managedServerNameBase").toString();
262-
String domainUid = domain.getDomainUid();
263-
264-
// Delte a managed servers in the cluster
265-
String msPodName = domainUid + "-" + managedServerNameBase + "1";
266-
String cmd = "kubectl delete po/" + msPodName + " -n " + domainNS;
267-
logger.info("Stop managed server <" + msPodName + "> using command:\n" + cmd);
268-
TestUtils.exec(cmd);
269-
270-
logger.info("Wait 10 seconds for ms to be restarted");
271-
Thread.sleep(10);
272-
273-
logger.info("Verify that <" + msPodName + "> is restarted by Operator");
274-
TestUtils.checkPodReady(msPodName, domainNS);
275-
276-
logger.info("SUCCESS - " + testMethodName);
277-
}
278-
279193
private void scaleDownAndverify(int decrNum) throws Exception {
280194
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
281195
logTestBegin(testMethodName);
@@ -306,23 +220,6 @@ private void scaleDownAndverify(int decrNum) throws Exception {
306220
}
307221
}
308222

309-
private void scaleUpAndverify(int incrNum) throws Exception {
310-
Map<String, Object> domainMap = domain.getDomainMap();
311-
String domainUid = domain.getDomainUid();
312-
String domainNS = domainMap.get("namespace").toString();
313-
String managedServerNameBase = domainMap.get("managedServerNameBase").toString();
314-
String clusterName = domainMap.get("clusterName").toString();
315-
316-
int replicaCnt = TestUtils.getClusterReplicas(domainUid, clusterName, domainNS);
317-
int replicas = replicaCnt + incrNum;
318-
String podName = domainUid + "-" + managedServerNameBase + replicas;
319-
320-
logger.info("Scale domain " + domainUid + " up to " + replicas + " managed servers");
321-
operator.scale(domainUid, clusterName, replicas);
322-
323-
verifyPodReady(replicas);
324-
}
325-
326223
private void verifyPodReady(int replicas) throws Exception {
327224
Map<String, Object> domainMap = domain.getDomainMap();
328225
String domainUid = domain.getDomainUid();
@@ -350,15 +247,4 @@ private void verifyPodReady(int replicas) throws Exception {
350247
+ replicas);
351248
}
352249
}
353-
354-
private int getReplicaCnt() throws Exception {
355-
Map<String, Object> domainMap = domain.getDomainMap();
356-
String domainUid = domain.getDomainUid();
357-
String domainNS = domainMap.get("namespace").toString();
358-
String clusterName = domainMap.get("clusterName").toString();
359-
360-
int replicaCnt = TestUtils.getClusterReplicas(domainUid, clusterName, domainNS);
361-
362-
return replicaCnt;
363-
}
364250
}

0 commit comments

Comments
 (0)