Skip to content

Commit

Permalink
fix issues introduced in PR 459
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Aug 26, 2016
1 parent 9e62b16 commit 00a9cd2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
3 changes: 2 additions & 1 deletion scripts/create_test
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,8 @@ OR
args.compiler = args.xml_compiler if args.compiler is None else args.compiler
args.compiler = mach_obj.get_default_compiler() if args.compiler is None else args.compiler
if args.testargs:
test_names = args.testargs
test_names = update_acme_tests.get_full_test_names(args.testargs,
mach_obj.get_machine_name(), args.compiler)
else:
test_data = CIME.test_utils.get_tests_from_xml(args.xml_machine, args.xml_category,
args.xml_compiler, args.xml_testlist,
Expand Down
31 changes: 22 additions & 9 deletions utils/python/tests/scripts_regression_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,10 +468,16 @@ def simple_test(self, expect_works, extra_args):
def test_create_test_rebless_namelist(self):
###############################################################################
# Generate some namelist baselines
self.simple_test(True, "-g -n -b %s -t %s-%s" % (self._baseline_name, self._baseline_name, CIME.utils.get_utc_timestamp()))
if CIME.utils.get_model() == "acme":
genarg = "-g -o -b %s"%self._baseline_name
comparg = "-c -b %s"%self._baseline_name
else:
genarg = "-g %s -o"%self._baseline_name
comparg = "-c %s"%self._baseline_name
self.simple_test(True, "%s -n -t %s-%s" % (genarg,self._baseline_name, CIME.utils.get_utc_timestamp()))

# Basic namelist compare
self.simple_test(True, "-c -n -b %s -t %s-%s" % (self._baseline_name, self._baseline_name, CIME.utils.get_utc_timestamp()))
self.simple_test(True, "%s -n -t %s-%s" % (comparg, self._baseline_name, CIME.utils.get_utc_timestamp()))

# Modify namelist
fake_nl = """
Expand All @@ -493,13 +499,13 @@ def test_create_test_rebless_namelist(self):
nl_file.write(fake_nl)

# Basic namelist compare should now fail
self.simple_test(False, "-c -n -b %s -t %s-%s" % (self._baseline_name, self._baseline_name, CIME.utils.get_utc_timestamp()))
self.simple_test(False, "%s -n -t %s-%s" % (comparg, self._baseline_name, CIME.utils.get_utc_timestamp()))

# Regen
self.simple_test(True, "-g -o -n -b %s -t %s-%s" % (self._baseline_name, self._baseline_name, CIME.utils.get_utc_timestamp()))
self.simple_test(True, "%s -n -t %s-%s" % (genarg, self._baseline_name, CIME.utils.get_utc_timestamp()))

# Basic namelist compare should now pass again
self.simple_test(True, "-c -n -b %s -t %s-%s" % (self._baseline_name, self._baseline_name, CIME.utils.get_utc_timestamp()))
self.simple_test(True, "%s -n -t %s-%s" % (comparg, self._baseline_name, CIME.utils.get_utc_timestamp()))

###############################################################################
class O_TestTestScheduler(TestCreateTestCommon):
Expand Down Expand Up @@ -774,17 +780,24 @@ def simple_test(self, expect_works, extra_args):
def test_bless_test_results(self):
###############################################################################
# Generate some namelist baselines
self.simple_test(True, "-g -b %s -t %s-%s" % (self._baseline_name, self._baseline_name, CIME.utils.get_utc_timestamp()))
if CIME.utils.get_model() == "acme":
genarg = "-g -o -b %s"%self._baseline_name
comparg = "-c -b %s"%self._baseline_name
else:
genarg = "-g %s -o"%self._baseline_name
comparg = "-c %s"%self._baseline_name

self.simple_test(True, "%s -t %s-%s" % (genarg, self._baseline_name, CIME.utils.get_utc_timestamp()))

# Hist compare should pass
self.simple_test(True, "-c -b %s -t %s-%s" % (self._baseline_name, self._baseline_name, CIME.utils.get_utc_timestamp()))
self.simple_test(True, "%s -t %s-%s" % (comparg, self._baseline_name, CIME.utils.get_utc_timestamp()))

# Change behavior
os.environ["TESTRUNDIFF_ALTERNATE"] = "True"

# Hist compare should now fail
test_id = "%s-%s" % (self._baseline_name, CIME.utils.get_utc_timestamp())
self.simple_test(False, "-c -b %s -t %s" % (self._baseline_name, test_id))
self.simple_test(False, "%s -t %s" % (comparg, test_id))

# compare_test_results should detect the fail
cpr_cmd = "%s/compare_test_results -b %s -t %s 2>&1" % (TOOLS_DIR, self._baseline_name, test_id)
Expand All @@ -801,7 +814,7 @@ def test_bless_test_results(self):
run_cmd_no_fail("%s/bless_test_results --hist-only --force -b %s -t %s" % (TOOLS_DIR, self._baseline_name, test_id))

# Hist compare should now pass again
self.simple_test(True, "-c -b %s -t %s-%s" % (self._baseline_name, self._baseline_name, CIME.utils.get_utc_timestamp()))
self.simple_test(True, "%s -t %s-%s" % (comparg, self._baseline_name, CIME.utils.get_utc_timestamp()))

###############################################################################
@unittest.skip("Disabling this test until we figure out how to integrate ACME tests and CIME xml files.")
Expand Down

0 comments on commit 00a9cd2

Please sign in to comment.