You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/06/29 15:11:54 UTC

[GitHub] marcoabreu commented on a change in pull request #11492: [MXNET-612] Optimize RAT setup and move it into PR stage

marcoabreu commented on a change in pull request #11492: [MXNET-612] Optimize RAT setup and move it into PR stage
URL: https://github.com/apache/incubator-mxnet/pull/11492#discussion_r199191474
 
 

 ##########
 File path: ci/docker/runtime_functions.sh
 ##########
 @@ -783,8 +783,26 @@ build_docs() {
 
 #Runs Apache RAT Check on MXNet Source for License Headers
 nightly_test_rat_check() {
-    set -ex
-    ./tests/nightly/apache_rat_license_check/license_check.sh
+    set -e
+    pushd .
+    
+    cd /work/deps/trunk/apache-rat/target
+
+    # Use shell number 5 to duplicate the log output. It get sprinted and stored in $OUTPUT at the same time https://stackoverflow.com/a/12451419
+    exec 5>&1
+    OUTPUT=$(java -jar apache-rat-0.13-SNAPSHOT.jar -E /work/mxnet/tests/nightly/apache_rat_license_check/rat-excludes -d /work/mxnet|tee >(cat - >&5))
 
 Review comment:
   It's basically just an empty shell number. 1 is stdout, 2 is stderr. I think the other ones are unused. This is basically a hack to mirror the output and store it in a variable https://stackoverflow.com/a/12451419f
   
   Exactly. $OUTPUT will contain the output of the RAT check. If there are no problems, it will output what you have seen. If there are any problems, it will contain details and always print the string which is stored in ERROR_MESSAGE. We determine whether the run was successful by checking if the output contains that error message. 

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