Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade history tools to python #413

Merged
merged 20 commits into from
Aug 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions scripts/Testing/Testcases/NOC_script
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ else
endif

echo "moving relevant history files to suffix with command " >>& $TESTSTATUS_LOG
echo "$SCRIPTSROOT/Tools/component_compare_move.sh -rundir $RUNDIR -testcase $CASE -suffix base" >>& $TESTSTATUS_LOG
echo "$SCRIPTSROOT/Tools/component_compare_move base" >>& $TESTSTATUS_LOG
echo "" >>& $TESTSTATUS_LOG

$SCRIPTSROOT/Tools/component_compare_move.sh -rundir $RUNDIR -testcase $CASE -suffix "base"
$SCRIPTSROOT/Tools/component_compare_move base

#======================================================================
# do an initial run test with NINST 2, with the
Expand Down Expand Up @@ -117,10 +117,10 @@ else
endif

echo "moving relevant history files to suffix with commands " >>& $TESTSTATUS_LOG
echo "$SCRIPTSROOT/Tools/component_compare_move.sh -rundir $RUNDIR -testcase $CASE -suffix inst2mod" >>& $TESTSTATUS_LOG
echo "$SCRIPTSROOT/Tools/component_compare_move inst2mod" >>& $TESTSTATUS_LOG
echo "" >>& $TESTSTATUS_LOG

$SCRIPTSROOT/Tools/component_compare_move.sh -rundir $RUNDIR -testcase $CASE -suffix "inst2mod"
$SCRIPTSROOT/Tools/component_compare_move inst2mod

#======================================================================
# Check test status for all relevant component history files
Expand All @@ -130,10 +130,7 @@ echo "DONE ${CASEBASEID} : (test finished, successful coupler log) " >>& $TESTST
echo "" >>& $TESTSTATUS_LOG

echo "obtaining test functionality from history files with commands " >>& $TESTSTATUS_LOG
echo "$SCRIPTSROOT/Tools/component_compare_test.sh -rundir $RUNDIR -testcase $CASE -testcase_base $CASEBASEID -suffix1 base -suffix2 multiinst -msg compare .base with .inst2mod" >>& $TESTSTATUS_LOG
echo "$SCRIPTSROOT/Tools/component_compare_test base multiinst" >>& $TESTSTATUS_LOG
echo "" >>& $TESTSTATUS_LOG

$SCRIPTSROOT/Tools/component_compare_test.sh -rundir $RUNDIR -testcase $CASE -testcase_base $CASEBASEID -suffix1 "base" -suffix2 "multiinst" -msg "compare .base with .inst2mod" >>& $TESTSTATUS_OUT



$SCRIPTSROOT/Tools/component_compare_test base multiinst >>& $TESTSTATUS_OUT
265 changes: 0 additions & 265 deletions scripts/Tools/baseline_gen_comp

This file was deleted.

14 changes: 9 additions & 5 deletions scripts/Tools/bless_test_results
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ changes, and updating baselines. Purpose is, instead of re-running tests
in generate mode, which is very slow, allow for very fast analsis and
blessing of diffs.

Be aware that restart test will overwrite the original namelist files
with versions of the files that you should not bless.
You may need to load modules for cprnc to work.
"""

from standard_script_setup import *
Expand Down Expand Up @@ -49,6 +48,7 @@ formatter_class=argparse.ArgumentDefaultsHelpFormatter
)

default_baseline_name = CIME.utils.get_current_branch(repo=CIME.utils.get_cime_root())
default_baseline_root = _MACHINE.get_value("CCSM_BASELINE")
default_compiler = _MACHINE.get_default_compiler()
scratch_root = _MACHINE.get_value("CESMSCRATCHROOT")
default_testroot = os.path.join(scratch_root)
Expand All @@ -64,6 +64,9 @@ formatter_class=argparse.ArgumentDefaultsHelpFormatter
parser.add_argument("-b", "--baseline-name", default=default_baseline_name,
help="Name of baselines to use, corresponds to branch used.")

parser.add_argument("--baseline-root", default=default_baseline_root,
help="Root of baselines.")

parser.add_argument("-c", "--compiler", default=default_compiler,
help="Compiler of run you want to bless")

Expand Down Expand Up @@ -91,7 +94,7 @@ formatter_class=argparse.ArgumentDefaultsHelpFormatter
expect(not (args.namelists_only and args.hist_only),
"Makes no sense to use --namelists-only and --hist-only simultaneously")

return args.baseline_name, args.test_root, args.compiler, args.test_id, args.namelists_only, args.hist_only, args.report_only, args.force, args.bless_tests
return args.baseline_name, args.baseline_root, args.test_root, args.compiler, args.test_id, args.namelists_only, args.hist_only, args.report_only, args.force, args.bless_tests

###############################################################################
def _main_func(description):
Expand All @@ -100,10 +103,11 @@ def _main_func(description):
test_results = doctest.testmod(verbose=True)
sys.exit(1 if test_results.failed > 0 else 0)

baseline_name, test_root, compiler, test_id, namelists_only, hist_only, report_only, force, bless_tests = \
baseline_name, baseline_root, test_root, compiler, test_id, namelists_only, hist_only, report_only, force, bless_tests = \
parse_command_line(sys.argv, description)

CIME.bless_test_results.bless_test_results(baseline_name, test_root, compiler, test_id, namelists_only, hist_only, report_only, force, bless_tests)
success = CIME.bless_test_results.bless_test_results(baseline_name, baseline_root, test_root, compiler, test_id, namelists_only, hist_only, report_only, force, bless_tests)
sys.exit(0 if success else 1)

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

Expand Down
Loading