-
Notifications
You must be signed in to change notification settings - Fork 216
PR: server scope podrestart-java-integ-test #978
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
Conversation
Because of the last "@maggiehe00 |
BaseTest.getUserProjectsDir() + "/weblogic-domains/" + domainUid + "/domain_new.yaml"); | ||
|
||
// append the file with changed property to the end of domain_new.yaml | ||
TestUtils.concatFile( |
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.
You can use Files.write(path, bytes, StandardOpenOption.APPEND);. Take a look at appendToDomainYamlAndCreate in Domain.java, you can refactor that if you want.
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.
Done
// firstly ensure that original domain.yaml doesn't include the property-to-be-added | ||
String domainFileName = | ||
BaseTest.getUserProjectsDir() + "/weblogic-domains/" + domainUid + "/domain.yaml"; | ||
boolean result = TestUtils.checkFileIncludeProperty("fsGroup: 1000", domainFileName); |
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.
TestUtils.checkFileIncludeProperty("fsGroup: 1000", domainFileName);
can be replaced with
(new String(Files.readAllBytes(Paths.get(domainFileName)))).contains("fsGroup: 1000");
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.
Done
logger.info("Inside findServerPropertyChange"); | ||
// get runtime server pod yaml file | ||
String outDir = BaseTest.getUserProjectsDir() + "/weblogic-domains/" + domainUid + "/"; | ||
StringBuffer command = new StringBuffer(); |
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.
As you are already executing a command, you can change it to
kubectl get pod <podname> -o yaml -n ns | grep changedProperty
instead of saving the file and looking for a string later..
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.
Done
* @throws Exception - IOException when file is copied or errors occurred if the tested server is | ||
* not restarted | ||
*/ | ||
public void testDomainServerPodRestart(String fileNameWithChangedProperty) throws Exception { |
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.
change the method name to verifyDomainServerPodRestart or some such....we want to keep the test methods in IT classes or BaseTest.java
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.
Done
BaseTest.getUserProjectsDir() + "/weblogic-domains/" + domainUid + "/domain_new.yaml"); | ||
|
||
// kubectl apply the new constructed domain_new.yaml | ||
TestUtils.kubectlapply( |
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.
You can call the existing TestUtils.exec()
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.
Done
I'm going to sync to the latest develop branch and resolve integration-tests/README.md conflict. |
@markxnelson @anpanigr Please kindly review the code. Thanks! |
Approved |
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.
Approved
The latest Jenkins clean run: http://****/view/weblogic-operator/job/weblogic-kubernetes-operator-javatest/1447/consoleFull