You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by infil00p <gi...@git.apache.org> on 2017/02/22 21:46:33 UTC

[GitHub] cordova-android pull request #363: CB-12465: Rewrite of the Unit Tests

GitHub user infil00p opened a pull request:

    https://github.com/apache/cordova-android/pull/363

    CB-12465: Rewrite of the Unit Tests

    <!--
    Please make sure the checklist boxes are all checked before submitting the PR. The checklist
    is intended as a quick reference, for complete details please see our Contributor Guidelines:
    
    http://cordova.apache.org/contribute/contribute_guidelines.html
    
    Thanks!
    -->
    
    ### Platforms affected
    Android
    
    ### What does this PR do?
    Re-writes the Unit Tests so that we have some unit tests.
    
    ### What testing has been done on this change?
    I made sure there were tests.
    
    ### Checklist
    - [x ] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database
    - [x] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
    - [x] Added automated test coverage as appropriate for this change.  (HOLY CRAP, I CAN ACTUALLY CHECK THIS BOX OFF NOW FINALLY!  YAY!!!)


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

    $ git pull https://github.com/infil00p/cordova-android unit_tests

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

    https://github.com/apache/cordova-android/pull/363.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 #363
    
----
commit aaf386b39be894124343c7bd4c345eee4c933351
Author: Joe Bowser <bo...@apache.org>
Date:   2017-02-15T00:45:57Z

    Writing new JUnit Test Instrumentation to replace tests and retire problmatic tests

commit cb9bf631601f0414d8f933a5bf43cfc0e3785ecc
Author: Joe Bowser <bo...@apache.org>
Date:   2017-02-15T19:58:35Z

    Migrating files from old testing instrumentation to new setup and simplifying tests

commit dc945747a07d112bd2321fff6e4a17cef0da9319
Author: Joe Bowser <bo...@apache.org>
Date:   2017-02-16T00:55:38Z

    Adding basic intent tests

commit a12f5dba7af465b902ddde47760c311646178e5d
Author: Joe Bowser <bo...@apache.org>
Date:   2017-02-16T02:06:46Z

    Starting to work on the BackButtonMultipageTest

commit 57d8c90506a5b309e8f9e863aef8b08ddbb232de
Author: Joe Bowser <bo...@apache.org>
Date:   2017-02-16T17:33:51Z

    Got the BackButtonMultipageTest implemented with the new instrumentation

commit cf65be68112556691b732832e3553fbf76bc9b48
Author: Joe Bowser <bo...@apache.org>
Date:   2017-02-16T18:49:43Z

    CB-12465: Added the iFrame Tests

commit 0932d6d6fb9a40672ef1e190b6d9361c782f1e35
Author: Joe Bowser <bo...@apache.org>
Date:   2017-02-16T20:52:43Z

    CB-12465: Tony's crazy voodoo survives the migration.

commit bd50365d84ef6c7ce8cacb2c56a4cd64650acccb
Author: Joe Bowser <bo...@apache.org>
Date:   2017-02-17T18:41:50Z

    CB-12465: Added very basic unit tests for the NativeToJsMessageQueue

commit 50b0dfd81cbb0835029cf948971bca2b2171e073
Author: Joe Bowser <bo...@apache.org>
Date:   2017-02-22T19:38:07Z

    Swapping test directories

commit bf9141fb24d3770620ae098e81d39e5dccc563dd
Author: Joe Bowser <bo...@apache.org>
Date:   2017-02-22T19:38:45Z

    Removing the old tests

----


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-android issue #363: CB-12465: Rewrite of the Unit Tests

Posted by fujunwei <gi...@git.apache.org>.
Github user fujunwei commented on the issue:

    https://github.com/apache/cordova-android/pull/363
  
    All the tests has passed after updating the latest codes, 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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-android issue #363: CB-12465: Rewrite of the Unit Tests

Posted by infil00p <gi...@git.apache.org>.
Github user infil00p commented on the issue:

    https://github.com/apache/cordova-android/pull/363
  
    @fujunwei Well, when you debug the test, it's clear that it's not redirecting to the error page that the intent defines, and instead it's going to some other page or showing a dialog window.  This isn't a huge failure (in fact, this is probably a minor or trivial priority bug, since it's still a html not found error page, which should never happen on a Cordova app), but it should actually fail.


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-android issue #363: CB-12465: Rewrite of the Unit Tests

Posted by fujunwei <gi...@git.apache.org>.
Github user fujunwei commented on the issue:

    https://github.com/apache/cordova-android/pull/363
  
    Do you mean the failed test will be continue to fix?


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-android issue #363: CB-12465: Rewrite of the Unit Tests

Posted by fujunwei <gi...@git.apache.org>.
Github user fujunwei commented on the issue:

    https://github.com/apache/cordova-android/pull/363
  
    There is a test failed on SM-G9250.
    > org.apache.cordova.unittests.IFrameTest > iFrameHistory[SM-G9250 - 6.0.1] FAILED 
    at junit.framework.Assert.fail(Assert.java:48)
    
    And there are two tests failed on Android Things platform.
    >  org.apache.cordova.unittests.BackButtonMultipageTest > testViaBackButtonOnView[iot_joule - 7.0] FAILED  at android.support.test.espresso.NoActivityResumedException: No activities in stage RESUMED. Did you forget to launch the activity. (test.getActivity() or similar)?
    
    > org.apache.cordova.unittests.IFrameTest > iFrameHistory[iot_joule - 7.0] FAILED at android.support.test.espresso.NoActivityResumedException: No activities in stage RESUMED. Did you forget to launch the activity. (test.getActivity() or similar)?


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-android issue #363: CB-12465: Rewrite of the Unit Tests

Posted by infil00p <gi...@git.apache.org>.
Github user infil00p commented on the issue:

    https://github.com/apache/cordova-android/pull/363
  
    @fujunwei I don't think the test should hang, but that's technically a failure of the test and not a problem with the test itself.


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-android issue #363: CB-12465: Rewrite of the Unit Tests

Posted by infil00p <gi...@git.apache.org>.
Github user infil00p commented on the issue:

    https://github.com/apache/cordova-android/pull/363
  
    @fujunwei OK, yeah, this is a minor mistake.  The errorUrl wasn't correct in the config.xml, the test passes and it no longer hangs.


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-android issue #363: CB-12465: Rewrite of the Unit Tests

Posted by infil00p <gi...@git.apache.org>.
Github user infil00p commented on the issue:

    https://github.com/apache/cordova-android/pull/363
  
    FYI: I'll be collapsing the commits on Friday when I merge this thing in.


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-android issue #363: CB-12465: Rewrite of the Unit Tests

Posted by infil00p <gi...@git.apache.org>.
Github user infil00p commented on the issue:

    https://github.com/apache/cordova-android/pull/363
  
    @fujunwei There's a threading/concurrency issue with Espresso and checking the WebView's URI.  I'm trying to adopt Espresso to reduce the amount of code in the test, but there's no docs on how to check the URI of a WebView, which I find utterly bizzare.  It'd be good to get rid of all the runOnUriThread wrappers on that method somhow.  That being said, throwing a sleep does brute force the test to work for now.
    
    I don't have any devices running Android Things yet.  I'm going to see about fixing that today.


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-android issue #363: CB-12465: Rewrite of the Unit Tests

Posted by fujunwei <gi...@git.apache.org>.
Github user fujunwei commented on the issue:

    https://github.com/apache/cordova-android/pull/363
  
    It hangs on running unit tests with `./gradlew connectedAndroidTest`, the output logs:
    > org.apache.cordova.unittests E/AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/htmlnotfound/index.html


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-android issue #363: CB-12465: Rewrite of the Unit Tests

Posted by codecov-io <gi...@git.apache.org>.
Github user codecov-io commented on the issue:

    https://github.com/apache/cordova-android/pull/363
  
    # [Codecov](https://codecov.io/gh/apache/cordova-android/pull/363?src=pr&el=h1) Report
    > Merging [#363](https://codecov.io/gh/apache/cordova-android/pull/363?src=pr&el=desc) into [master](https://codecov.io/gh/apache/cordova-android/commit/5591a1a4e896ed8693abd5234cb2370ead20ed5d?src=pr&el=desc) will **not change** coverage.
    > The diff coverage is `n/a`.
    
    
    ```diff
    @@           Coverage Diff           @@
    ##           master     #363   +/-   ##
    =======================================
      Coverage   35.58%   35.58%           
    =======================================
      Files          12       12           
      Lines        1037     1037           
      Branches      173      173           
    =======================================
      Hits          369      369           
      Misses        668      668
    ```
    
    
    
    ------
    
    [Continue to review full report at Codecov](https://codecov.io/gh/apache/cordova-android/pull/363?src=pr&el=continue).
    > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
    > `\u0394 = absolute <relative> (impact)`, `� = not affected`, `? = missing data`
    > Powered by [Codecov](https://codecov.io/gh/apache/cordova-android/pull/363?src=pr&el=footer). Last update [5591a1a...34bd385](https://codecov.io/gh/apache/cordova-android/compare/5591a1a4e896ed8693abd5234cb2370ead20ed5d...34bd385ef28b563f1ee07e8377909f27c5c2f37d?src=pr&el=footer&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-android issue #363: CB-12465: Rewrite of the Unit Tests

Posted by fujunwei <gi...@git.apache.org>.
Github user fujunwei commented on the issue:

    https://github.com/apache/cordova-android/pull/363
  
    LGTM


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-android pull request #363: CB-12465: Rewrite of the Unit Tests

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

    https://github.com/apache/cordova-android/pull/363


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org