Skip to content

Commit 76947fc

Browse files
committed
remove duplicate cleanup code
1 parent 12f1a92 commit 76947fc

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,10 @@ public static String getWeblogicImageServer() {
274274
return weblogicImageServer;
275275
}
276276

277+
public static String getDomainApiVersion() {
278+
return domainApiVersion;
279+
}
280+
277281
public static ExecResult cleanup() throws Exception {
278282
String cmd =
279283
"export RESULT_ROOT="

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

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ private void setupOperatorAndDomain(String operatorGitRelease, String operatorRe
5454
throws Exception {
5555
logger.log(Level.INFO, "+++++++++++++++Beginning Test Setup+++++++++++++++++++++");
5656
initialize(APP_PROPS_FILE);
57-
DOM_TARGET_RELEASE_VERSION = domainApiVersion;
57+
DOM_TARGET_RELEASE_VERSION = getDomainApiVersion();
5858
opUpgradeTmpDir = BaseTest.getResultDir() + "/operatorupgrade";
5959
TestUtils.exec("rm -rf " + Paths.get(opUpgradeTmpDir).toString());
6060
Files.createDirectories(Paths.get(opUpgradeTmpDir));
@@ -100,17 +100,6 @@ public void cleanupOperatorAndDomain() throws Exception {
100100
operator.destroy();
101101
}
102102
ExecResult result = cleanup();
103-
TestUtils.exec(
104-
"kubectl delete pods,services,deployments,replicasets,configmaps,services --all --ignore-not-found -n "
105-
+ OP_NS);
106-
TestUtils.exec(
107-
"kubectl delete pods,services,deployments,replicasets,configmaps,services --all --ignore-not-found -n "
108-
+ DOM_NS);
109-
TestUtils.exec("kubectl delete crd --all --ignore-not-found");
110-
TestUtils.exec("kubectl delete ns " + OP_NS + " --ignore-not-found");
111-
TestUtils.exec("kubectl delete ns " + DOM_NS + " --ignore-not-found");
112-
TestUtils.exec("kubectl get all --all-namespaces");
113-
TestUtils.exec("rm -rf " + Paths.get(opUpgradeTmpDir).toString());
114103
logger.log(Level.INFO, "+++++++++++++++Done AfterTest cleanup+++++++++++++++++++++");
115104
}
116105
}

0 commit comments

Comments
 (0)