flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uce <...@git.apache.org>
Subject [GitHub] flink pull request: [FLINK-1166] Add qa-check.sh tool
Date Thu, 05 Feb 2015 17:11:48 GMT
Github user uce commented on a diff in the pull request:

    https://github.com/apache/flink/pull/366#discussion_r24179312
  
    --- Diff: tools/qa-check.sh ---
    @@ -0,0 +1,175 @@
    +#!/usr/bin/env bash
    +
    +#
    +# Licensed to the Apache Software Foundation (ASF) under one or more
    +# contributor license agreements.  See the NOTICE file distributed with
    +# this work for additional information regarding copyright ownership.
    +# The ASF licenses this file to You under the Apache License, Version 2.0
    +# (the "License"); you may not use this file except in compliance with
    +# the License.  You may obtain a copy of the License at
    +#
    +#    http://www.apache.org/licenses/LICENSE-2.0
    +#
    +# Unless required by applicable law or agreed to in writing, software
    +# distributed under the License is distributed on an "AS IS" BASIS,
    +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +# See the License for the specific language governing permissions and
    +# limitations under the License.
    +#
    +
    +
    +#
    +# QA check your changes.
    +# Possible options:
    +# BRANCH set a another branch as the "check" reference
    +#
    +#
    +# Use the tool like this "BRANCH=release-0.8 ./tools/qa-check.sh"
    +#
    +
    +
    +BRANCH=${BRANCH:-origin/master}
    +
    +
    +
    +here="`dirname \"$0\"`"				# relative
    +here="`( cd \"$here\" && pwd )`" 	# absolutized and normalized
    +if [ -z "$here" ] ; then
    +	# error; for some reason, the path is not accessible
    +	# to the script (e.g. permissions re-evaled after suid)
    +	exit 1  # fail
    +fi
    +flink_home="`dirname \"$here\"`"
    +
    +echo "flink_home=$flink_home here=$here"
    +cd $here
    +
    +if [ ! -d  "_qa_workdir" ] ; then
    +	echo "_qa_workdir doesnt exist. Creating it"
    +	mkdir _qa_workdir
    +fi
    +# attention, it overwrites
    +echo "_qa_workdir" > .gitignore
    +
    +cd _qa_workdir
    +
    +if [ ! -d  "flink" ] ; then
    +	echo "There is no flink copy in the workdir. Cloning flink"
    +	git clone https://github.com/apache/flink.git flink
    +	cd flink
    +	
    +fi
    +cd flink
    +git fetch origin
    +git checkout $BRANCH
    +cd $here
    +# go to refrence flink directory
    +
    +cd _qa_workdir
    +VAR_DIR=`pwd`
    +cd flink
    +
    +# Initialize variables
    +export TESTS_PASSED=true
    +export MESSAGES="Flink QA-Check results:"$'\n'
    +
    +goToTestDirectory() {
    +	cd $flink_home
    +}
    +
    +############################ Methods ############################
    +
    +############ Javadocs ############
    +JAVADOC_MVN_COMMAND="mvn javadoc:aggregate -Pdocs-and-source -Dmaven.javadoc.failOnError=false
-Dquiet=false | grep  \"WARNING\|warning\|error\" | wc -l"
    +
    +referenceJavadocsErrors() {
    +	eval $JAVADOC_MVN_COMMAND > "$VAR_DIR/_JAVADOCS_NUM_WARNINGS"
    +}
    +
    +
    +checkJavadocsErrors() {
    +	OLD_JAVADOC_ERR_CNT=`cat $VAR_DIR/_JAVADOCS_NUM_WARNINGS` 
    +	NEW_JAVADOC_ERR_CNT=`eval $JAVADOC_MVN_COMMAND`
    +	if [ "$NEW_JAVADOC_ERR_CNT" -gt "$OLD_JAVADOC_ERR_CNT" ]; then
    +		MESSAGES+=":-1: The change increases the number of javadoc errors from $OLD_JAVADOC_ERR_CNT
to $NEW_JAVADOC_ERR_CNT"$'\n'
    +		TESTS_PASSED=false
    +	else
    +		MESSAGES+=":+1: The number of javadoc errors was $OLD_JAVADOC_ERR_CNT and is now $NEW_JAVADOC_ERR_CNT"$'\n'
    +	fi
    +}
    +
    +
    +############ Compiler warnings ############
    +COMPILER_WARN_MVN_COMMAND="mvn clean compile -Dmaven.compiler.showWarning=true -Dmaven.compiler.showDeprecation=true
| grep \"WARNING\" | wc -l"
    +referenceCompilerWarnings() {
    +	eval $COMPILER_WARN_MVN_COMMAND > "$VAR_DIR/_COMPILER_NUM_WARNINGS"
    +}
    +
    +checkCompilerWarnings() {
    +	OLD_COMPILER_ERR_CNT=`cat $VAR_DIR/_COMPILER_NUM_WARNINGS` 
    +	NEW_COMPILER_ERR_CNT=`eval $COMPILER_WARN_MVN_COMMAND`
    +	if [ "$NEW_COMPILER_ERR_CNT" -gt "$OLD_COMPILER_ERR_CNT" ]; then
    +		MESSAGES+=":-1: The change increases the number of compiler warnings from $OLD_COMPILER_ERR_CNT
to $NEW_COMPILER_ERR_CNT"$'\n'
    +		TESTS_PASSED=false
    +	else
    +		MESSAGES+=":+1: The number of compiler warnings was $OLD_COMPILER_ERR_CNT and is now
$NEW_COMPILER_ERR_CNT"$'\n'
    +	fi
    +}
    +
    +############ Files in lib ############
    +BUILD_MVN_COMMAND="mvn clean package -DskipTests"
    --- End diff --
    
    we could also skip Javadocs here with `-Dmaven.javadoc.skip=true`


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

Mime
View raw message