You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2022/05/27 00:07:06 UTC

[GitHub] [geode] jchen21 opened a new pull request, #7730: GEODE-10305: Change locator and server dirs

jchen21 opened a new pull request, #7730:
URL: https://github.com/apache/geode/pull/7730

   Instead of saving locator and server logs to a temp dir, which will be deleted at the end of the tests, save the logs to a different dir, so that it will collected in the final artifacts.
   
   <!-- Thank you for submitting a contribution to Apache Geode. -->
   
   <!-- In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken: 
   -->
   
   ### For all changes:
   - [ ] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
   
   - [ ] Has your PR been rebased against the latest commit within the target branch (typically `develop`)?
   
   - [ ] Is your initial contribution a single, squashed commit?
   
   - [ ] Does `gradlew build` run cleanly?
   
   - [ ] Have you written or updated unit tests to verify your changes?
   
   - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
   
   <!-- Note:
   Please ensure that once the PR is submitted, check Concourse for build issues and
   submit an update to your PR as soon as possible. If you need help, please send an
   email to dev@geode.apache.org.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [geode] jchen21 commented on a diff in pull request #7730: GEODE-10305: Change locator and server dirs

Posted by GitBox <gi...@apache.org>.
jchen21 commented on code in PR #7730:
URL: https://github.com/apache/geode/pull/7730#discussion_r887245832


##########
geode-assembly/src/upgradeTest/java/org/apache/geode/session/tests/TomcatSessionBackwardsCompatibilityTestBase.java:
##########
@@ -105,7 +108,10 @@ protected void startServer(String name, String classPath, int locatorPort) throw
   }
 
   protected void startLocator(String name, String classPath, int port) throws Exception {
-    locatorDir = tempFolder.newFolder("locator").getPath();
+    File locatorFile = new File("locator_dir_" + this.getClass().getSimpleName() + "_"
+        + testName.getMethodName().replace("[", "").replace("]", ""));

Review Comment:
   I am not sure what future param will look like. It could be anything as long as the syntax allows for the param. I would leave it for future work. Perhaps someone who introduces a param that has invalid file system character has to handle it. 
   
   The purpose of this change is to keep the logs in case of a test failure. And in case of multiple log files, we should be able to locate the logs based on the test class, method and param. Currently, the logs are in a temp folder which would be automatically deleted at the end of the test, even if there is a failure.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [geode] jchen21 merged pull request #7730: GEODE-10305: Change locator and server dirs

Posted by GitBox <gi...@apache.org>.
jchen21 merged PR #7730:
URL: https://github.com/apache/geode/pull/7730


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [geode] pivotal-jbarrett commented on a diff in pull request #7730: GEODE-10305: Change locator and server dirs

Posted by GitBox <gi...@apache.org>.
pivotal-jbarrett commented on code in PR #7730:
URL: https://github.com/apache/geode/pull/7730#discussion_r886102240


##########
geode-assembly/src/upgradeTest/java/org/apache/geode/session/tests/TomcatSessionBackwardsCompatibilityTestBase.java:
##########
@@ -105,7 +108,10 @@ protected void startServer(String name, String classPath, int locatorPort) throw
   }
 
   protected void startLocator(String name, String classPath, int port) throws Exception {
-    locatorDir = tempFolder.newFolder("locator").getPath();
+    File locatorFile = new File("locator_dir_" + this.getClass().getSimpleName() + "_"
+        + testName.getMethodName().replace("[", "").replace("]", ""));

Review Comment:
   Isn't it possible for the test name to include invalid filesystem characters inside the `[]` part? It looks like the only params might be the version number right now but if someone adds another param to test this could change. Perhaps we should just hash the name or something?



##########
geode-assembly/src/upgradeTest/java/org/apache/geode/session/tests/TomcatSessionBackwardsCompatibilityTestBase.java:
##########
@@ -105,7 +108,10 @@ protected void startServer(String name, String classPath, int locatorPort) throw
   }
 
   protected void startLocator(String name, String classPath, int port) throws Exception {
-    locatorDir = tempFolder.newFolder("locator").getPath();
+    File locatorFile = new File("locator_dir_" + this.getClass().getSimpleName() + "_"
+        + testName.getMethodName().replace("[", "").replace("]", ""));
+    locatorFile.mkdir();

Review Comment:
   What happens if `mkdir` fails?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [geode] jchen21 commented on a diff in pull request #7730: GEODE-10305: Change locator and server dirs

Posted by GitBox <gi...@apache.org>.
jchen21 commented on code in PR #7730:
URL: https://github.com/apache/geode/pull/7730#discussion_r887261495


##########
geode-assembly/src/upgradeTest/java/org/apache/geode/session/tests/TomcatSessionBackwardsCompatibilityTestBase.java:
##########
@@ -105,7 +108,10 @@ protected void startServer(String name, String classPath, int locatorPort) throw
   }
 
   protected void startLocator(String name, String classPath, int port) throws Exception {
-    locatorDir = tempFolder.newFolder("locator").getPath();
+    File locatorFile = new File("locator_dir_" + this.getClass().getSimpleName() + "_"
+        + testName.getMethodName().replace("[", "").replace("]", ""));
+    locatorFile.mkdir();

Review Comment:
   Good point. I have added an IOException.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org