Skip to content

Commit

Permalink
add --allow-baseline-overwrite flag to create_test
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Aug 24, 2016
1 parent c09ed15 commit f7a5dd4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
15 changes: 10 additions & 5 deletions scripts/create_test
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ OR
parser.add_argument("--testfile",
help="A file containing an ascii list of tests to run")

parser.add_argument("--allow-baseline-overwrite", action="store_true",
help="If the generate baseline option is specified with a baseline directory option "
"existing tests in that directory will not be overwritten unless this flag is provided.")

args = parser.parse_args(args[1:])

CIME.utils.handle_standard_logging_options(args)
Expand Down Expand Up @@ -228,7 +232,7 @@ OR
args.test_root, args.baseline_root, args.clean, args.compare, args.generate, \
args.baseline_name, args.namelists_only, args.project, args.test_id, args.parallel_jobs, \
args.xml_machine, args.xml_compiler, args.xml_category, args.xml_testlist, args.walltime, \
args.single_submit, args.proc_pool, args.use_existing, args.save_timing, args.queue
args.single_submit, args.proc_pool, args.use_existing, args.save_timing, args.queue, args.allow_baseline_overwrite

###############################################################################
def single_submit_impl(machine_name, test_id, proc_pool, project, args, job_cost_map, wall_time, test_root):
Expand Down Expand Up @@ -334,7 +338,7 @@ def create_test(testargs, compiler, machine_name, no_run, no_build, no_setup, no
baseline_root, clean, compare, generate,
baseline_name, namelists_only, project, test_id, parallel_jobs,
xml_machine, xml_compiler, xml_category, xml_testlist, walltime,
single_submit, proc_pool, use_existing, save_timing, queue):
single_submit, proc_pool, use_existing, save_timing, queue, allow_baseline_overwrite):
###############################################################################
if testargs and machine_name is None and compiler is None:
for test in testargs:
Expand All @@ -356,7 +360,7 @@ def create_test(testargs, compiler, machine_name, no_run, no_build, no_setup, no
xml_machine=xml_machine, xml_compiler=xml_compiler,
xml_category=xml_category, xml_testlist=xml_testlist, walltime=walltime,
proc_pool=proc_pool, use_existing=use_existing, save_timing=save_timing,
queue=queue)
queue=queue, allow_baseline_overwrite=allow_baseline_overwrite)

success = impl.run_tests()

Expand Down Expand Up @@ -395,13 +399,14 @@ def _main_func(description):
testargs, compiler, machine_name, no_run, no_build, no_setup, no_batch, test_root, baseline_root, clean, \
compare, generate, baseline_name, namelists_only, project, test_id, parallel_jobs, \
xml_machine, xml_compiler, xml_category, xml_testlist, walltime, single_submit, proc_pool, \
use_existing, save_timing, queue \
use_existing, save_timing, queue, allow_baseline_overwrite \
= parse_command_line(sys.argv, description)

sys.exit(create_test(testargs, compiler, machine_name, no_run, no_build, no_setup, no_batch, test_root,
baseline_root, clean, compare, generate, baseline_name, namelists_only,
project, test_id, parallel_jobs, xml_machine, xml_compiler, xml_category,
xml_testlist, walltime, single_submit, proc_pool, use_existing, save_timing, queue))
xml_testlist, walltime, single_submit, proc_pool, use_existing, save_timing,
queue, allow_baseline_overwrite))

###############################################################################

Expand Down
4 changes: 2 additions & 2 deletions utils/python/CIME/test_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(self, test_names,
project=None, parallel_jobs=None,
xml_machine=None, xml_compiler=None, xml_category=None,
xml_testlist=None, walltime=None, proc_pool=None,
use_existing=False, save_timing=False, queue=None):
use_existing=False, save_timing=False, queue=None, allow_baseline_overwrite=False):
###########################################################################
self._cime_root = CIME.utils.get_cime_root()
self._cime_model = CIME.utils.get_model()
Expand Down Expand Up @@ -148,7 +148,7 @@ def __init__(self, test_names,
if generate is not None and isinstance(generate, str):
self._baseline_gen_name = generate
self._generate = True
self._overwrite_baselines = False
self._overwrite_baselines = allow_baseline_overwrite
if self._compare and self._baseline_cmp_name is None:
branch_name = CIME.utils.get_current_branch(repo=self._cime_root)
expect(branch_name is not None,
Expand Down

0 comments on commit f7a5dd4

Please sign in to comment.