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

Automatically read test-case config files #100

Merged
merged 5 commits into from
Apr 30, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
3 changes: 0 additions & 3 deletions compass/landice/tests/enthalpy_benchmark/A/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ def configure(self):
"""
Modify the configuration options for this test case
"""
add_config(self.config, 'compass.landice.tests.enthalpy_benchmark.A',
'A.cfg', exception=True)

with path('compass.landice.tests.enthalpy_benchmark', 'README') as \
target:
symlink(str(target), '{}/README'.format(self.work_dir))
Expand Down
3 changes: 0 additions & 3 deletions compass/landice/tests/enthalpy_benchmark/B/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ def configure(self):
"""
Modify the configuration options for this test case
"""
add_config(self.config, 'compass.landice.tests.enthalpy_benchmark.B',
'B.cfg', exception=True)

with path('compass.landice.tests.enthalpy_benchmark', 'README') as \
target:
symlink(str(target), '{}/README'.format(self.work_dir))
Expand Down
3 changes: 0 additions & 3 deletions compass/ocean/tests/global_ocean/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ def configure_global_ocean(test_case, mesh, init=None):
config.set('global_ocean', 'prefix', '{}wISC'.format(
config.get('global_ocean', 'prefix')))

add_config(config, test_case.__module__, '{}.cfg'.format(test_case.name),
exception=False)

# add a description of the initial condition
if init is not None:
initial_condition = init.initial_condition
Expand Down
3 changes: 0 additions & 3 deletions compass/ocean/tests/ice_shelf_2d/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,3 @@ def configure(name, resolution, config):
res_params = res_params[resolution]
for param in res_params:
config.set('ice_shelf_2d', param, '{}'.format(res_params[param]))

add_config(config, 'compass.ocean.tests.ice_shelf_2d.{}'.format(name),
'{}.cfg'.format(name), exception=False)
3 changes: 0 additions & 3 deletions compass/ocean/tests/ziso/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,3 @@ def configure(name, resolution, config):
res_params = res_params[resolution]
for param in res_params:
config.set('ziso', param, '{}'.format(res_params[param]))

add_config(config, 'compass.ocean.tests.ziso.{}'.format(name),
'{}.cfg'.format(name), exception=False)
6 changes: 5 additions & 1 deletion compass/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,15 @@ def setup_case(path, test_case, config_file, machine, work_dir, baseline_dir,
add_config(config, 'compass.{}'.format(mpas_core),
'{}.cfg'.format(mpas_core))

# add the config options for the configuration (if defined)
# add the config options for the test group (if defined)
test_group = test_case.test_group.name
add_config(config, 'compass.{}.tests.{}'.format(mpas_core, test_group),
'{}.cfg'.format(test_group), exception=False)

# add the config options for the test case (if defined)
add_config(config, test_case.__module__,
'{}.cfg'.format(test_case.name), exception=False)

test_case_dir = os.path.join(work_dir, path)
try:
os.makedirs(test_case_dir)
Expand Down