diff --git a/bin/maint/mergexx b/bin/maint/mergexx new file mode 100755 index 0000000000000000000000000000000000000000..6ce1e66ea792e624188104a0d39faa377d0cc3d9 --- /dev/null +++ b/bin/maint/mergexx @@ -0,0 +1,74 @@ +#!/bin/bash + +dest="asterxx" +upstream="asterxx/upstream" +rev="default" + +usage() +{ + echo "usage: mergexx [-h] [--dest=BR] [--upstream=BR] [--rev=REV] TAG" + echo + echo " Update to 'dest', open 'upstream' branch, merge with 'rev' and commit" + echo " using the given 'tag'." + echo + echo " By default, the head of '${rev}' is merged with '${dest}' using" + echo " the working branch '${upstream}'." + echo + exit 1 +} + +_error() +{ + echo "ERROR: ${@}" + echo + usage +} + +run_main() +{ + local tag + + OPTS=$(getopt -o hr:d: --long help,dest:,rev: -n $(basename $0) -- "$@") + if [ $? != 0 ] ; then + _error "invalid arguments." >&2 + fi + eval set -- "$OPTS" + while true; do + case "$1" in + -h | --help ) usage ;; + -d | --dest ) dest="$2"; shift ;; + -u | --upstream ) upstream="$2"; shift ;; + -r | --rev ) rev="$2"; shift ;; + -- ) shift; break ;; + * ) break ;; + esac + shift + done + + [ $# -ne 1 ] && _error "exactly one argument is expected." + tag="$1" + + if [ $(hg status | wc -l) -ne 0 ]; then + _error "uncommitted changes! Please discard or commit first." + fi + + printf "\nupdating on '${dest}' branch...\n" + hg update ${dest} || _error "failed" + + printf "\nopening '${upstream}' branch...\n" + hg branch -f ${upstream} || _error "failed" + + printf "\nmerging '${rev}'..." + hg merge ${rev} || _error "failed" + + msg="[#23037] merge '${rev}' @ ${tag}." + printf "\ncommitting with message '${msg}'...\n" + hg ci -m "${msg}" || _error "failed" + + printf "\nDo forget to submit the new revision!\n" + return ${?} +} + + +run_main "${@}" +exit ${?} diff --git a/lib/aslint/check_files.py b/lib/aslint/check_files.py index e2b8b19393254c51d393e95c708a0a24f65e6490..a38758042cb2cf09b3e49e4c33cffd16a36006af 100644 --- a/lib/aslint/check_files.py +++ b/lib/aslint/check_files.py @@ -195,7 +195,7 @@ def read_waf_parameters(cache_file, prefer_sequential=False): @log_as_important def run_testcase(params_, dry_run=False, is_success=None, force_mpi=False, - add_restart=False): + add_restart=False, no_retry=False): """Run a list of testcases. If batch mode is expected, it separates testcases that must be run in @@ -207,6 +207,8 @@ def run_testcase(params_, dry_run=False, is_success=None, force_mpi=False, is_success (Diag): Execution status that is considered as a success. force_mpi (bool): Force to run sequential testcases with MPI version. add_restart (bool): Automatically add restart at the end of testcases. + no_retry (bool): By default (*False*) give a second chance to the + testcases that fails. If *True*, it disables the second run. Returns: ErrorCode, TestResult: List of errors and object containing the results. @@ -235,7 +237,7 @@ def run_testcase(params_, dry_run=False, is_success=None, force_mpi=False, filters=['--filter="verif_interact" not in testlist']) params['list'] = flist_b change_export_files(params, values) - err_b, res_b = run_testcase_2(params, dry_run, is_success) + err_b, res_b = run_testcase_2(params, dry_run, is_success, no_retry) logger.title(_("running the testcases with 'verif_interact' tag")) filter_list(flist_i, params, filter_mpi, @@ -243,7 +245,7 @@ def run_testcase(params_, dry_run=False, is_success=None, force_mpi=False, params['list'] = flist_i params['mode'] = 'interactif' change_export_files(params, values) - err_i, res_i = run_testcase_2(params, dry_run, is_success) + err_i, res_i = run_testcase_2(params, dry_run, is_success, no_retry) result = TestResult(resudir=None, is_success=is_success) dict_resu = res_b.get_diag() @@ -336,7 +338,7 @@ def run_testcase_1(params, dry_run, is_success): return errcode, result -def run_testcase_2(params, dry_run, is_success): +def run_testcase_2(params, dry_run, is_success, no_retry): """Run a list of testcase (same as `run_testcase_1`), but give a second chance for the testcases that end with an unknown status (supposed to be a server problem)""" @@ -345,7 +347,7 @@ def run_testcase_2(params, dry_run, is_success): # second change for aspic/ascou testcases unk.extend( [ct for ct in result.get_error() \ if ct.startswith('ascou') or ct.startswith('aspic')] ) - if unk: + if not no_retry and unk: logger.info(_("giving a second chance to %d testcases"), len(unk)) tmpf = tempfile.NamedTemporaryFile() tmpf.close() diff --git a/lib/hgaster/maintenance.py b/lib/hgaster/maintenance.py index 0d5e28ef2c27ac82234f38e43fd64480e9c08cfa..ef021b87f7a76311b5a286348c4988066fd5b545 100644 --- a/lib/hgaster/maintenance.py +++ b/lib/hgaster/maintenance.py @@ -456,9 +456,11 @@ class BaseMaintenance(object): logger.title(_("current revision: %s"), desc) logger.stop_important() add_restart = getattr(self.opts, 'add_restart', False) + no_retry = getattr(self.opts, 'no_retry', False) errcode, result = run_testcase(params, is_success=is_success, force_mpi=force_mpi, - add_restart=add_restart) + add_restart=add_restart, + no_retry=no_retry) logger.debug("TestResult summary:".format(result.repr())) list_err = result.get_error() if use_tmp: @@ -879,6 +881,10 @@ class RunTestcases(BaseMaintenance): default=False, help="force the parameters of the testcases to enable " "the parallelism (default: False).") + group.add_option('--no-retry', dest="no_retry", + action='store_true', default=False, + help="do not re-try to pass a testcase after a first " + "failure (default: give a second chance).") group.add_option('--add-restart', dest="add_restart", action='store_true', default=False, help="automatically add a stage with POURSUITE/FIN "