You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by GabrielBrascher <gi...@git.apache.org> on 2016/04/16 20:54:01 UTC

[GitHub] cloudstack pull request: Test fails in Widows as the file separato...

GitHub user GabrielBrascher opened a pull request:

    https://github.com/apache/cloudstack/pull/1498

    Test fails in Widows as the file separator "/" is different from "\"

    **Problem:**
    File separator in windows ("\") is different from the expected in the test ("/"); thus, the test *com.cloud.utils.SwiftUtilTest.testSplitSwiftPath()* will fail in Windows systems.
    
    The problem is that the input of the test is *"container/object"* but the tested method uses the *File.separator* (that depends on from the OS), in the windows the tested method (*com.cloud.utils.SwiftUtil.splitSwiftPath(String)*) looks for a "\", as the string does not contain "\" it returns an empty string and consequently results in a test failure.
    
    **Solution:**
    - Create a string `String input = "container" + File.separator + "object";` (before it was `String input = "container/object";`); thus, independent of the OS, the test will validate the tested method in a manner that the file separator does not disturb the result;

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/GabrielBrascher/cloudstack lrg-cs-hackday-038

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cloudstack/pull/1498.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1498
    
----
commit a83514041cd865b06bee33d2440ea42b1e7c1337
Author: gabrascher <ga...@hotmail.com>
Date:   2016-04-16T18:35:17Z

    Test fails in Widows as the file separator "/" is different from "\"
    
    File separator in windows is different from linux (the expected in the
    test); thus, the test
    *com.cloud.utils.SwiftUtilTest.testSplitSwiftPath()* will fail in
    windows. The problem is that the input of the test is
    *"container/object"* but the tested method uses the *File.separator*
    (that depends from the OS), in the windows the tested method
    (*com.cloud.utils.SwiftUtil.splitSwiftPath(String)*) looks for a "\" in
    windows systems, resulting in an empty string and consequently a failure
    in the test.
    
    Some solutions:
    - the simple way is to create a string `String input = "container" +
    File.separator + "object";`, thus independent of the OS, the test will
    succeed.
    - a tricky solution is to mock the final static variable
    *File.separator* and return "/".
    
    I picked the easy way.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-9352: Test fails in Widows as ...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cloudstack/pull/1498


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-9352: Test fails in Widows as ...

Posted by swill <gi...@git.apache.org>.
Github user swill commented on the pull request:

    https://github.com/apache/cloudstack/pull/1498#issuecomment-212964858
  
    I need one more LGTM and if you can post some proof this is working as expected, I will feel better about merging it.  Thanks...  :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-9352: Test fails in Widows as ...

Posted by GabrielBrascher <gi...@git.apache.org>.
Github user GabrielBrascher commented on the pull request:

    https://github.com/apache/cloudstack/pull/1498#issuecomment-212984070
  
    @swill it succesfully builds in windows: [build-result.txt](https://github.com/apache/cloudstack/files/230237/build-result.txt);
    
    Not sure it if helps, but there is also a print showing the test failing, after the adjustment the test is ok: ![testrun](https://cloud.githubusercontent.com/assets/5025148/14715361/edf33914-07be-11e6-89db-b59028a539fe.png)
    
    Let me know if you need more information :)
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-9352: Test fails in Widows as ...

Posted by cloudsadhu <gi...@git.apache.org>.
Github user cloudsadhu commented on the pull request:

    https://github.com/apache/cloudstack/pull/1498#issuecomment-212828874
  
    reviewed your code change and looks good. Please post  the test result.
    LGTM based on code review !!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-9352: Test fails in Widows as ...

Posted by swill <gi...@git.apache.org>.
Github user swill commented on the pull request:

    https://github.com/apache/cloudstack/pull/1498#issuecomment-212985885
  
    That is what I was looking for.  Thank you sir...  :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---