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

Unit tests fail on Windows OS #136

Open
vbauer opened this issue Mar 31, 2015 · 7 comments
Open

Unit tests fail on Windows OS #136

vbauer opened this issue Mar 31, 2015 · 7 comments

Comments

@vbauer
Copy link
Contributor

vbauer commented Mar 31, 2015

No description provided.

@xvik
Copy link

xvik commented Apr 5, 2015

+1

@DALDEI
Copy link

DALDEI commented Apr 6, 2015

Unit tests are working for me on windows 7 pro, Oracle JDK8

@vbauer
Copy link
Contributor Author

vbauer commented Apr 6, 2015

@DALDEI Strange. Are you sure that you run all of them? I'm using Windows 7 Ultimate (SP1) + Oracle JDK 8.

Example 1:

    at junit.framework.Assert.assertEquals(Assert.java:100)
    at junit.framework.Assert.assertEquals(Assert.java:107)
    at com.github.mustachejava.PreTranslateTest.testPretranslate(PreTranslateTest.java:48)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)

Example 2:

testDeferred(com.github.mustachejava.InterpreterTest)  Time elapsed: 0.008 sec  <<< FAILURE!
junit.framework.ComparisonFailure: expected:<...TML="I am calculated[\n\"later\" and divs\nare written out &lt;]\nnow";</script>
]\nnow";</script>
</...>
    at junit.framework.Assert.assertEquals(Assert.java:100)
    at junit.framework.Assert.assertEquals(Assert.java:107)
    at junit.framework.TestCase.assertEquals(TestCase.java:269)
    at com.github.mustachejava.InterpreterTest.testDeferred(InterpreterTest.java:760)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)

Example 3:

    at junit.framework.Assert.assertEquals(Assert.java:100)
    at junit.framework.Assert.assertEquals(Assert.java:107)
    at junit.framework.TestCase.assertEquals(TestCase.java:269)
    at com.github.mustachejava.InterpreterTest.testNestedLatches(InterpreterTest.java:405)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at junit.framework.TestCase.runTest(TestCase.java:176)
    at junit.framework.TestCase.runBare(TestCase.java:141)

Example 4:

</partial> Test>
    at junit.framework.Assert.assertEquals(Assert.java:100)
    at junit.framework.Assert.assertEquals(Assert.java:107)
    at junit.framework.TestCase.assertEquals(TestCase.java:269)
    at com.github.mustachejava.InterpreterTest.testSimpleFiltered(InterpreterTest.java:168)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at junit.framework.TestCase.runTest(TestCase.java:176)

Most of them failed because of incorrect line ending (\n instead of \r\n).

@DALDEI
Copy link

DALDEI commented Apr 7, 2015

Line ending issues are locally configurable by git settings.
I suspect mine are set correctly (I do a lot of windows development from git sources by linux developers).

Try this out and see if it helps
https://help.github.com/articles/dealing-with-line-endings/

@vbauer
Copy link
Contributor Author

vbauer commented Apr 7, 2015

I know how to configure line endings for Git. :) However, don't you think that it is a bug, when template engine produces wrong line endings?

UPD: Sorry, I formulated it wrong. Isn't it a bug when tests depend on the Git environment?

@DALDEI
Copy link

DALDEI commented Apr 8, 2015

EOL management is an inherited hell that the best have been unble to solve to everyone's liking,
Bump it up a level and try to get Unicode uncorrupted end to end through an app and you'll find very few programmers capable of even understanding what's going on. ... I'll l live with EOL issues in test cases

I bitched when Cygwin stopped accepting CRLF in she'll scripts, I still am annoyed at my own OSS tests that fail on base64 or literal escapes when run on different platforms or transformed by SCM.
It's annoying , yes, but "fixing " it is difficult work oft better applied to other tasks.

This is compounded by JUnit test methodology Strongly favoring java string liberals as the result ( no generic EOL escape sequence) but using a tool that reads from the filesystem ... ( outside factors changing EOL at will). Often any atte,pt to reconcile will fail half the time or succeed when it shouldn't,

If it's as simple as setring git or running dos2unix ... Considering the tests are quite large AND inherently unrealistic ( JUint methodology ... E.g not application end to end tests )
I'm happy rpthere are tests at all.

For OSS code , i get more then I'm paying for. ... And I suspect a volunteer to improve or would be welcome ...

@spullara
Copy link
Owner

I'd love to understand what I should be doing for Windows to work perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants