GitHub user HyukjinKwon opened a pull request:

    https://github.com/apache/spark/pull/16433

    [SPARK-19022][TESTS] Fix tests dependent on OS due to different newline 
characters

    ## What changes were proposed in this pull request?
    
    There are two tests failing on Windows due to the different newlines.
    
    ```
     - StreamingQueryProgress - prettyJson *** FAILED *** (0 milliseconds)
     "{
        "id" : "39788670-6722-48b7-a248-df6ba08722ac",
        "runId" : "422282f1-3b81-4b47-a15d-82dda7e69390",
        "name" : "myName",
        ...
      }" did not equal "{
        "id" : "39788670-6722-48b7-a248-df6ba08722ac",
        "runId" : "422282f1-3b81-4b47-a15d-82dda7e69390",
        "name" : "myName",
        ...
      }"
      ...
    ```
    
    ```
     - StreamingQueryStatus - prettyJson *** FAILED *** (0 milliseconds)
     "{
        "message" : "active",
        "isDataAvailable" : true,
        "isTriggerActive" : false
      }" did not equal "{
        "message" : "active",
        "isDataAvailable" : true,
        "isTriggerActive" : false
      }" 
      ...
    ```
    
    The reason is, `pretty` in `org.json4s.pretty` writes OS-dependent newlines 
but the string defined in the tests are `\n`. This ends up with test failures.
    
    This PR proposes to compare these regardless of newline concerns.
    
    ## How was this patch tested?
    
    Manually tested via AppVeyor.
    
    **Before**
    
https://ci.appveyor.com/project/spark-test/spark/build/417-newlines-fix-before
    
    **After**
    https://ci.appveyor.com/project/spark-test/spark/build/418-newlines-fix

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

    $ git pull https://github.com/HyukjinKwon/spark 
tests-StreamingQueryStatusAndProgressSuite

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

    https://github.com/apache/spark/pull/16433.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 #16433
    
----
commit 15f821cadd39027cfd8860309e32d6b06be92833
Author: hyukjinkwon <[email protected]>
Date:   2016-12-29T05:27:05Z

    Fix newline comparison issues

----


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to