Skip to content

Commit

Permalink
Clean up diagnostic tests so they require fewer models runs to finish.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Hannah committed Nov 17, 2016
1 parent 68a3657 commit 62e9e88
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 2 additions & 8 deletions tools/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from dump_all_diagnostics import dump_diags
from experiment import create_experiments, exp_id_from_path

experiment_dict = create_experiments()

def pytest_addoption(parser):
parser.addoption('--exps', default=None,
help="""comma-separated no spaces list of experiments to
Expand All @@ -15,11 +17,6 @@ def pytest_addoption(parser):
help="""Run on all experiments/test cases. By default
tests are run on a 'fast' subset of experiments.
Note that this overrides the --exps option.""")
parser.addoption('--platform', default='raijin',
help="""Which machine we're on. This determines how
the model is built. Currently supported options
are 'raijin' and 'ubuntu'.""")


def pytest_generate_tests(metafunc):
"""
Expand All @@ -28,8 +25,6 @@ def pytest_generate_tests(metafunc):

print("Calling pytest_generate_tests")

experiment_dict = create_experiments(metafunc.config.option.platform)

if 'exp' in metafunc.fixturenames:
if metafunc.config.option.full:
# Run tests on all experiments.
Expand All @@ -53,7 +48,6 @@ def exp(request):
Called before each test, use this to dump all the experiment data.
"""
exp = request.param
print("pytest fixture exp: {}".format(exp))

# Run the experiment to get latest code changes. This will do nothing if
# the experiment has already been run.
Expand Down
2 changes: 1 addition & 1 deletion tools/tests/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ def __hash__(self):
('ocean_model', 'fsitherm'),
('ocean_model', 'total_seaice_melt'),
('ocean_model', 'heat_restore'),
('ocean_model', 'heat_added'),
('ocean_model', 'total_heat_restore'),
('ocean_model', 'total_heat_adjustment'),
('ocean_model_z_new', 'TKE_to_Kd'),
('ice_model', 'Cor_ui'),
('ice_model', 'Cor_vi'),
('ice_model', 'OBI'),
Expand Down

0 comments on commit 62e9e88

Please sign in to comment.