Author: jleroux
Date: Sun Aug 14 21:43:57 2016 New Revision: 1756333 URL: http://svn.apache.org/viewvc?rev=1756333&view=rev Log: Updates merge scripts to use testIntegration instead of test Modified: ofbiz/trunk/tools/functions.sh ofbiz/trunk/tools/mergefromtrunk.bat ofbiz/trunk/tools/mergefromtrunk.sh Modified: ofbiz/trunk/tools/functions.sh URL: http://svn.apache.org/viewvc/ofbiz/trunk/tools/functions.sh?rev=1756333&r1=1756332&r2=1756333&view=diff ============================================================================== --- ofbiz/trunk/tools/functions.sh (original) +++ ofbiz/trunk/tools/functions.sh Sun Aug 14 21:43:57 2016 @@ -1,126 +1,126 @@ -#!/bin/sh -##################################################################### -# 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. -##################################################################### - -# This shell script tries to be as close to POSIX as possible. -# external dependencies: -# mkdir -# tee -# git rev-parse -# git rebase --continue - -set -x -# Simulate mkdir -p, which isn't POSIX; this is modelled after -# 'install', which is what standard unix makefiles tend to use for the -# purpose -_install_dir() { - # POSIX doesn't support the shell 'local' keyword, so simulate - # that with () - ( - IFS="/" - set -- $1 - while [ $# -gt 0 ]; do - [ -d "$1" ] || mkdir "$1" - cd "$1" - shift - done - ) -} -# create the entire directory path. Multiple directories can be given. -install_dir() { - while [ $# -gt 0 ]; do - _install_dir "$1" - shift - done -} - -# args: -# $1: how many loops -# $2-$#: command to call thru each loop -git_rebase_runner() { - install_dir runtime/git-rebase/logs - ( - set -- runtime/git-rebase/logs/* - if [ -e "$1" ]; then - rm "$@" - fi - ) - total_loops="$1" - cleaner="$2" - shift 2 - if [ -e runtime/git-rebase/hook.sh ]; then - runtime/git-rebase/hook.sh start $total_loops || break - fi - eval "$cleaner" - while [ $total_loops -gt 0 ]; do - git_rebase_runner_success=0 - total_loops=$(($total_loops - 1)) - hash="$(git rev-parse HEAD)" - local_log="runtime/git-rebase/logs/$hash.log" - [ -e "$local_log" ] && rm "$local_log" - # POSIX tee does not support -a, so we have to run everything - # inside a single redirection. - { - if [ -e runtime/git-rebase/hook.sh ]; then - runtime/git-rebase/hook.sh pre-run $total_loops || break - fi - eval "$@" || break - eval "$cleaner" || break - if [ -e runtime/git-rebase/hook.sh ]; then - runtime/git-rebase/hook.sh post-run $total_loops || break - fi - } 2>&1 | tee "runtime/git-rebase/logs/$hash.log" - git rebase --continue || break - git_rebase_runner_success=1 - done - if [ -e runtime/git-rebase/hook.sh ]; then - runtime/git-rebase/hook.sh stop $total_loops || break - fi - # POSIX [ doesn't deal well when one of the arguments is empty; this - # could occur if $total_loops = 0. - if [ "z$git_rebase_runner_success" = "z0" ]; then - eval "$cleaner" - while [ $total_loops -gt 0 ]; do - total_loops=$(($total_loops - 1)) - git rebase --continue - done - fi -} - -run_gradlew() { - # POSIX [ doesn't deal well when one of the arguments is empty, and - # [ doesn't support [ ! - if [ "z$USE_LOCAL_ANT" = "z" ]; then - gradlew "$@" - else - ./gradlew "$@" - fi -} - -standard_cleanup() { - run_gradlew cleanAll -} -install_worker() { - run_gradlew loadDefault -} -fulltestsuite_worker() { - run_gradlew loadDefault - run_gradlew test -} -#git_rebase_runner 3 fulltestsuite_cleanup fulltestsuite_worker +#!/bin/sh +##################################################################### +# 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. +##################################################################### + +# This shell script tries to be as close to POSIX as possible. +# external dependencies: +# mkdir +# tee +# git rev-parse +# git rebase --continue + +set -x +# Simulate mkdir -p, which isn't POSIX; this is modelled after +# 'install', which is what standard unix makefiles tend to use for the +# purpose +_install_dir() { + # POSIX doesn't support the shell 'local' keyword, so simulate + # that with () + ( + IFS="/" + set -- $1 + while [ $# -gt 0 ]; do + [ -d "$1" ] || mkdir "$1" + cd "$1" + shift + done + ) +} +# create the entire directory path. Multiple directories can be given. +install_dir() { + while [ $# -gt 0 ]; do + _install_dir "$1" + shift + done +} + +# args: +# $1: how many loops +# $2-$#: command to call thru each loop +git_rebase_runner() { + install_dir runtime/git-rebase/logs + ( + set -- runtime/git-rebase/logs/* + if [ -e "$1" ]; then + rm "$@" + fi + ) + total_loops="$1" + cleaner="$2" + shift 2 + if [ -e runtime/git-rebase/hook.sh ]; then + runtime/git-rebase/hook.sh start $total_loops || break + fi + eval "$cleaner" + while [ $total_loops -gt 0 ]; do + git_rebase_runner_success=0 + total_loops=$(($total_loops - 1)) + hash="$(git rev-parse HEAD)" + local_log="runtime/git-rebase/logs/$hash.log" + [ -e "$local_log" ] && rm "$local_log" + # POSIX tee does not support -a, so we have to run everything + # inside a single redirection. + { + if [ -e runtime/git-rebase/hook.sh ]; then + runtime/git-rebase/hook.sh pre-run $total_loops || break + fi + eval "$@" || break + eval "$cleaner" || break + if [ -e runtime/git-rebase/hook.sh ]; then + runtime/git-rebase/hook.sh post-run $total_loops || break + fi + } 2>&1 | tee "runtime/git-rebase/logs/$hash.log" + git rebase --continue || break + git_rebase_runner_success=1 + done + if [ -e runtime/git-rebase/hook.sh ]; then + runtime/git-rebase/hook.sh stop $total_loops || break + fi + # POSIX [ doesn't deal well when one of the arguments is empty; this + # could occur if $total_loops = 0. + if [ "z$git_rebase_runner_success" = "z0" ]; then + eval "$cleaner" + while [ $total_loops -gt 0 ]; do + total_loops=$(($total_loops - 1)) + git rebase --continue + done + fi +} + +run_gradlew() { + # POSIX [ doesn't deal well when one of the arguments is empty, and + # [ doesn't support [ ! + if [ "z$USE_LOCAL_ANT" = "z" ]; then + gradlew "$@" + else + ./gradlew "$@" + fi +} + +standard_cleanup() { + run_gradlew cleanAll +} +install_worker() { + run_gradlew loadDefault +} +fulltestsuite_worker() { + run_gradlew loadDefault + run_gradlew testIntegration +} +#git_rebase_runner 3 fulltestsuite_cleanup fulltestsuite_worker Modified: ofbiz/trunk/tools/mergefromtrunk.bat URL: http://svn.apache.org/viewvc/ofbiz/trunk/tools/mergefromtrunk.bat?rev=1756333&r1=1756332&r2=1756333&view=diff ============================================================================== --- ofbiz/trunk/tools/mergefromtrunk.bat (original) +++ ofbiz/trunk/tools/mergefromtrunk.bat Sun Aug 14 21:43:57 2016 @@ -56,7 +56,7 @@ goto exit :tests echo on -gradlew cleanAll loadDefault test +gradlew cleanAll loadDefault testIntegration echo off echo You can now do the commit by hand if all is OK. The comment grabbed from trunk by the merge is in the file comment.tmp at root Modified: ofbiz/trunk/tools/mergefromtrunk.sh URL: http://svn.apache.org/viewvc/ofbiz/trunk/tools/mergefromtrunk.sh?rev=1756333&r1=1756332&r2=1756333&view=diff ============================================================================== --- ofbiz/trunk/tools/mergefromtrunk.sh (original) +++ ofbiz/trunk/tools/mergefromtrunk.sh Sun Aug 14 21:43:57 2016 @@ -22,98 +22,96 @@ set -e # this script requires a posix shell; namely, $(( math evaluation. help() { - cat << _EOF_ + cat << _EOF_ $0 [options] -mergefromtrunk.sh merge \$rev Apply revision \$rev from trunk. -mergefromtrunk.sh test Run test suite(clean-all, load-demo, run-tests). -mergefromtrunk.sh commit Commit current fix to svn. -mergefromtrunk.sh abort Abort current merge session. +mergefromtrunk.sh merge \$rev Apply revision \$rev from trunk. +mergefromtrunk.sh test Run test suite(clean-all, load-demo, run-tests). +mergefromtrunk.sh commit Commit current fix to svn. +mergefromtrunk.sh abort Abort current merge session. --h | --help Show this help. +-h | --help Show this help. _EOF_ } cmd="" rev="" while [ $# -gt 0 ]; do - case "$1" in - (-h|--help) - help - exit 0 - ;; - (-*) - echo "Unknown arg ($1)." 1>&2 - help 1>&2 - exit 1 - ;; - (*) - if [ z = "z$cmd" ]; then - cmd="$1" - else - case "$cmd" in - (merge) - rev="$1" - ;; - (*) - echo "Too many arguments." 1>&2 - help 1>&2 - exit 1 - ;; - esac - fi - ;; - esac - shift + case "$1" in + (-h|--help) + help + exit 0 + ;; + (-*) + echo "Unknown arg ($1)." 1>&2 + help 1>&2 + exit 1 + ;; + (*) + if [ z = "z$cmd" ]; then + cmd="$1" + else + case "$cmd" in + (merge) + rev="$1" + ;; + (*) + echo "Too many arguments." 1>&2 + help 1>&2 + exit 1 + ;; + esac + fi + ;; + esac + shift done case "$cmd" in - (merge) - if [ z = "z$rev" ]; then - echo "Need a revision." 1>&2 - help 1>&2 - exit 1 - fi - if [ -d runtime/merge-state ]; then - echo "Merge session already started." 1>&2 - help 1>&2 - exit 1 - fi - mkdir -p runtime/merge-state - echo "$rev" > runtime/merge-state/revision - # do not run any of the following commands in a complex - # chained pipe; if one of the commands in the pipe fails, - # it isn't possible to detect the failure. - printf "Applied fix from trunk for revision: %s \n===\n\n" "$rev" > runtime/merge-state/log-message - svn log https://svn.apache.org/repos/asf/ofbiz/trunk -r "$rev" > runtime/merge-state/log.txt - set -- $(wc -l runtime/merge-state/log.txt) - head -n $(($1 - 1)) < runtime/merge-state/log.txt > runtime/merge-state/log.txt.head - tail -n $(($1 - 4)) < runtime/merge-state/log.txt.head >> runtime/merge-state/log-message - prevRev=$(($rev - 1)) - svn up - svn merge -r "$prevRev:$rev" https://svn.apache.org/repos/asf/ofbiz/trunk - ;; - (test) - ./gradlew cleanAll - ./gradlew loadDefault - ./gradlew test - ;; - (commit) - svn commit -F runtime/merge-state/log-message - rm -rf runtime/merge-state - ;; - (abort) - svn resolved . -R - svn revert . -R - rm -rf runtime/merge-state - ;; - ("") - echo "Need a command and a revision." 1>&2 - help 1>&2 - exit 1 - ;; - (*) - echo "Unknown command($cmd)." 1>&2 - help 1>&2 - exit 1 - ;; + (merge) + if [ z = "z$rev" ]; then + echo "Need a revision." 1>&2 + help 1>&2 + exit 1 + fi + if [ -d runtime/merge-state ]; then + echo "Merge session already started." 1>&2 + help 1>&2 + exit 1 + fi + mkdir -p runtime/merge-state + echo "$rev" > runtime/merge-state/revision + # do not run any of the following commands in a complex + # chained pipe; if one of the commands in the pipe fails, + # it isn't possible to detect the failure. + printf "Applied fix from trunk for revision: %s \n===\n\n" "$rev" > runtime/merge-state/log-message + svn log https://svn.apache.org/repos/asf/ofbiz/trunk -r "$rev" > runtime/merge-state/log.txt + set -- $(wc -l runtime/merge-state/log.txt) + head -n $(($1 - 1)) < runtime/merge-state/log.txt > runtime/merge-state/log.txt.head + tail -n $(($1 - 4)) < runtime/merge-state/log.txt.head >> runtime/merge-state/log-message + prevRev=$(($rev - 1)) + svn up + svn merge -r "$prevRev:$rev" https://svn.apache.org/repos/asf/ofbiz/trunk + ;; + (test) + ./gradlew cleanAll loadDefault testIntegration + ;; + (commit) + svn commit -F runtime/merge-state/log-message + rm -rf runtime/merge-state + ;; + (abort) + svn resolved . -R + svn revert . -R + rm -rf runtime/merge-state + ;; + ("") + echo "Need a command and a revision." 1>&2 + help 1>&2 + exit 1 + ;; + (*) + echo "Unknown command($cmd)." 1>&2 + help 1>&2 + exit 1 + ;; esac |
Free forum by Nabble | Edit this page |