Skip to content

Conversation

@pjcollins
Copy link
Member

Context: dotnet/android@130905e
Context: https://github.com/xamarin/QualityAssurance/pull/3478

We've recently started running Java.Interop tests on an Android target
as part of the Mono.Android-Tests suite. This has introduced some
seemingly harmless failures[0] when building this suite on Windows and
then running it on Android. We can fix this by converting line endings
before comparing strings.

[0]:

01-02 16:18:11.949 I/NUnit   (23743): Failed tests:
01-02 16:18:11.949 I/NUnit   (23743): 1) Java.InteropTests.JniValueMarshaler_Boolean_ContractTests.JniValueMarshalerContractTests`1.CreateReturnValueFromManagedExpression (Java.Interop-Tests)
01-02 16:18:11.949 I/NUnit   (23743):   Expected string length 111 but was 99. Strings differ at index 1.
01-02 16:18:11.949 I/NUnit   (23743):   Expected: "{\r\n\tJniRuntime __jvm;\r\n\tbool __value;\r\n\r\n\ttry\r\n\t{\r\n\t\treturn _..."
01-02 16:18:11.949 I/NUnit   (23743):   But was:  "{\n\tJniRuntime __jvm;\n\tbool __value;\n\n\ttry\n\t{\n\t\treturn __value..."
01-02 16:18:11.949 I/NUnit   (23743):   -------------^
01-02 16:18:11.949 I/NUnit   (23743):
01-02 16:18:11.949 I/NUnit   (23743):   at Java.InteropTests.JniValueMarshalerContractTests`1[T].CheckExpression (Java.Interop.Expressions.JniValueMarshalerContext context, System.String expected, System.Linq.Expressions.Expression ret) [0x00083] in <59a94475f2544934836dac1b5c1cf1e1>:0

01-02 16:18:11.949 I/NUnit   (23743): 2) Java.InteropTests.JniValueMarshaler_Char_ContractTests.JniValueMarshalerContractTests`1.CreateReturnValueFromManagedExpression (Java.Interop-Tests)
01-02 16:18:11.949 I/NUnit   (23743):   Expected string length 111 but was 99. Strings differ at index 1.
01-02 16:18:11.949 I/NUnit   (23743):   Expected: "{\r\n\tJniRuntime __jvm;\r\n\tchar __value;\r\n\r\n\ttry\r\n\t{\r\n\t\treturn _..."
01-02 16:18:11.949 I/NUnit   (23743):   But was:  "{\n\tJniRuntime __jvm;\n\tchar __value;\n\n\ttry\n\t{\n\t\treturn __value..."
01-02 16:18:11.949 I/NUnit   (23743):   -------------^
01-02 16:18:11.949 I/NUnit   (23743):
01-02 16:18:11.949 I/NUnit   (23743):   at Java.InteropTests.JniValueMarshalerContractTests`1[T].CheckExpression (Java.Interop.Expressions.JniValueMarshalerContext context, System.String expected, System.Linq.Expressions.Expression ret) [0x00083] in <59a94475f2544934836dac1b5c1cf1e1>:0

Context: dotnet/android@130905e
Context: https://github.com/xamarin/QualityAssurance/pull/3478

We've recently started running `Java.Interop` tests on an Android target
as part of the `Mono.Android-Tests` suite. This has introduced some
seemingly harmless failures[0] when building this suite on Windows and
then running it on Android. We can fix this by converting line endings
before comparing strings.

[0]:

    01-02 16:18:11.949 I/NUnit   (23743): Failed tests:
    01-02 16:18:11.949 I/NUnit   (23743): 1) Java.InteropTests.JniValueMarshaler_Boolean_ContractTests.JniValueMarshalerContractTests`1.CreateReturnValueFromManagedExpression (Java.Interop-Tests)
    01-02 16:18:11.949 I/NUnit   (23743):   Expected string length 111 but was 99. Strings differ at index 1.
    01-02 16:18:11.949 I/NUnit   (23743):   Expected: "{\r\n\tJniRuntime __jvm;\r\n\tbool __value;\r\n\r\n\ttry\r\n\t{\r\n\t\treturn _..."
    01-02 16:18:11.949 I/NUnit   (23743):   But was:  "{\n\tJniRuntime __jvm;\n\tbool __value;\n\n\ttry\n\t{\n\t\treturn __value..."
    01-02 16:18:11.949 I/NUnit   (23743):   -------------^
    01-02 16:18:11.949 I/NUnit   (23743):
    01-02 16:18:11.949 I/NUnit   (23743):   at Java.InteropTests.JniValueMarshalerContractTests`1[T].CheckExpression (Java.Interop.Expressions.JniValueMarshalerContext context, System.String expected, System.Linq.Expressions.Expression ret) [0x00083] in <59a94475f2544934836dac1b5c1cf1e1>:0

    01-02 16:18:11.949 I/NUnit   (23743): 2) Java.InteropTests.JniValueMarshaler_Char_ContractTests.JniValueMarshalerContractTests`1.CreateReturnValueFromManagedExpression (Java.Interop-Tests)
    01-02 16:18:11.949 I/NUnit   (23743):   Expected string length 111 but was 99. Strings differ at index 1.
    01-02 16:18:11.949 I/NUnit   (23743):   Expected: "{\r\n\tJniRuntime __jvm;\r\n\tchar __value;\r\n\r\n\ttry\r\n\t{\r\n\t\treturn _..."
    01-02 16:18:11.949 I/NUnit   (23743):   But was:  "{\n\tJniRuntime __jvm;\n\tchar __value;\n\n\ttry\n\t{\n\t\treturn __value..."
    01-02 16:18:11.949 I/NUnit   (23743):   -------------^
    01-02 16:18:11.949 I/NUnit   (23743):
    01-02 16:18:11.949 I/NUnit   (23743):   at Java.InteropTests.JniValueMarshalerContractTests`1[T].CheckExpression (Java.Interop.Expressions.JniValueMarshalerContext context, System.String expected, System.Linq.Expressions.Expression ret) [0x00083] in <59a94475f2544934836dac1b5c1cf1e1>:0
@pjcollins
Copy link
Member Author

This is working for me locally:

01-03 12:50:20.704  3681  3702 I NUnit   : Finish: Java.Interop-Tests, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
01-03 12:50:20.707  3681  3702 I NUnit   : Unit tests completed
01-03 12:50:20.837  3681  3702 I NUnit   : Passed: 745, Failed: 0, Skipped: 2, Inconclusive: 0, Total: 0, Filtered: 0

@pjcollins pjcollins marked this pull request as ready for review January 3, 2020 17:51
@jonathanpeppers jonathanpeppers merged commit 476597b into master Jan 3, 2020
@jonathanpeppers jonathanpeppers deleted the pjcollins_test-lineends branch January 3, 2020 18:30
@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants