Skip to content
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

Windows: many java tests are failing on Windows #1994

Closed
meteorcloudy opened this issue Oct 26, 2016 · 6 comments
Closed

Windows: many java tests are failing on Windows #1994

meteorcloudy opened this issue Oct 26, 2016 · 6 comments
Assignees
Labels
P1 I'll work on this now. (Assignee required) platform: windows type: bug

Comments

@meteorcloudy
Copy link
Member

http://ci.bazel.io/view/Bazel%20bootstrap%20and%20maintenance/job/Bazel/JAVA_VERSION=1.8,PLATFORM_NAME=windows-x86_64/936/consoleFull

There was 1 failure:
1) testGetTargetPathAbsolute(com.google.devtools.build.lib.rules.repository.RepositoryFunctionTest)
java.lang.AssertionError: expected:<A:/b/c> but was:</b/c>
    at org.junit.Assert.fail(Assert.java:88)
    at org.junit.Assert.failNotEquals(Assert.java:743)
    at org.junit.Assert.assertEquals(Assert.java:118)
    at org.junit.Assert.assertEquals(Assert.java:144)

According to some of the error message, my guess the culprit is ca99bb7
//cc @laszlocsomor

@meteorcloudy meteorcloudy added type: bug P1 I'll work on this now. (Assignee required) platform: windows labels Oct 26, 2016
@laszlocsomor laszlocsomor self-assigned this Oct 26, 2016
@meteorcloudy
Copy link
Member Author

I think maybe we need to adjust the test to adapt this change, right?

@laszlocsomor
Copy link
Contributor

Yes

@laszlocsomor
Copy link
Contributor

laszlocsomor commented Oct 26, 2016

One of the failing tests is ArtifactTest.testToDetailString, because we create an artifact at path /a/b/c, which on Windows means A:\b\c.

We've forked some tests already for Windows but I'd rather not do that with even more. So I'll look for a nice, lightweight way to adapt these tests to Windows paths.

@meteorcloudy
Copy link
Member Author

I see, thanks!

@laszlocsomor
Copy link
Contributor

laszlocsomor commented Oct 26, 2016

Found the culprit: thanks to ca99bb7, PathFragment on Windows is being smart about MSYS paths, so "/a/b/c" becomes "A:/b/c".

Wait, no, that's not the actual culprit. Sorry :) I keep looking.

@laszlocsomor
Copy link
Contributor

Well, that was indeed the culprit. I have a bugfix, testing then sending out for review ASAP.

luca-digrazia pushed a commit to luca-digrazia/DatasetCommitsDiffSearch that referenced this issue Sep 5, 2022
    PathFragment no longer parses "/c/foo" as "C:/foo"
    on Windows, but as a driveletter-less absolute
    path. If such a PathFragment is used in creating a
    Path object, the WindowsPath.translatePath method
    will translate it correctly.

    Fixes bazelbuild/bazel#1994

    --
    MOS_MIGRATED_REVID=137283176
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 I'll work on this now. (Assignee required) platform: windows type: bug
Projects
None yet
Development

No branches or pull requests

2 participants