You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by gi...@git.apache.org on 2017/09/13 19:24:32 UTC

[GitHub] filmaj opened a new pull request #405: Running Java unit tests more easily

filmaj opened a new pull request #405: Running Java unit tests more easily
URL: https://github.com/apache/cordova-android/pull/405
 
 
   ### What does this PR do?
   
   Trying to make it easy for both humans and our CI systems to run the Java unit tests. In particular, I wanted to seamlessly handle building the gradle wrapper and invoking `gradlew test` on both *nix and Windows systems.
   
   Changes include:
   - added a node script in the `test/` project directory, `run_java_unit_tests.js`, that wraps up building the gradle wrapper for the test project and invoking the unit tests (`gradlew test`)
   - wrapped up running that script in the `npm run java-unit-tests` helper
   - include `npm run java-unit-tests` in the top-level `npm test` script
   - now runs java unit tests in travis and appveyor
   - small refactor in `gradlebuilder.js` to support building the gradle wrapper more easily - kept the defaults and behaviour of gradlebuilder functions as before, just parameterized the .gradle file as part of the `runGradleWrapper` helper method.
   - don't explicitly build gradlew on appveyor CI as now `npm test` will do it for you
   
   ### What testing has been done on this change?
   
   I tested this on both Windows 10 and Mac OS 10.12, in both the fresh-clone and fully-loaded cordova-android repo cases. That is, in the fresh-clone situation, `npm run java-unit-tests` will a) download the proper gradle version, b) build the gradle wrapper and finally c) run the java unit tests. The fully-loaded case will skip right to c).
   
   # Worth Noting
   
   I dropped a TODO regarding the flow of promises from `GradleBuilder` - the helper method `runGradleWrapper` returns a promise in the case that it needs to build the gradle wrapper, but if the gradle wrapper is already built, it returns nothing. So, I had to handle this discrepancy in the `run_java_unit_tests.js` file. For cleanliness, it may be worth having the `runGradleWrapper` method always return a promise. I'm happy to make those changes if we deem it appropriate after a review.
   
   Please review (or at least, FYI): @infil00p, @alsorokin, @stevengill, @dpogue, @macdonst, @purplecabbage, @jcesarmobile 
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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