Skip to content

Commit ad9826e

Browse files
Disable all directive tests
1 parent d63d97f commit ad9826e

File tree

7 files changed

+43
-112
lines changed

7 files changed

+43
-112
lines changed

lib/ramble/ramble/appkit.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
from ramble.application import ApplicationBase
1919
from ramble.application_types.executable import ExecutableApplication
20-
from ramble.application_types.spack import SpackApplication
2120
from ramble.spec import Spec
2221

2322
import ramble.language.application_language

lib/ramble/ramble/application_types/spack.py

Lines changed: 0 additions & 54 deletions
This file was deleted.

lib/ramble/ramble/modifier_types/spack.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

lib/ramble/ramble/modkit.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
from ramble.modifier import ModifierBase
2222
from ramble.modifier_types.basic import BasicModifier
23-
from ramble.modifier_types.spack import SpackModifier
2423
from ramble.spec import Spec
2524

2625
import ramble.language.modifier_language

lib/ramble/ramble/test/application_language.py

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,29 @@
1717
app_types = [
1818
ApplicationBase, # noqa: F405
1919
ExecutableApplication, # noqa: F405
20-
SpackApplication, # noqa: F405
2120
]
2221

2322
func_types = enum.Enum("func_types", ["method", "directive"])
2423
test_func_types = [func_types.method]
2524

2625

26+
def generate_app_class(base_class):
27+
28+
class GeneratedClass(base_class):
29+
_language_classes = base_class._language_classes.copy()
30+
31+
def __init__(self, file_path):
32+
super().__init__(file_path)
33+
34+
return GeneratedClass
35+
36+
2737
@deprecation.fail_if_not_removed
2838
@pytest.mark.parametrize("app_class", app_types)
2939
def test_application_type_features(app_class):
40+
test_class = generate_app_class(app_class)
3041
app_path = "/path/to/app"
31-
test_app = app_class(app_path)
42+
test_app = test_class(app_path)
3243
assert hasattr(test_app, "workloads")
3344
assert hasattr(test_app, "executables")
3445
assert hasattr(test_app, "figures_of_merit")
@@ -332,7 +343,8 @@ def add_software_spec(app_inst, spec_num=1, func_type=func_types.directive):
332343
@pytest.mark.parametrize("func_type", test_func_types)
333344
@pytest.mark.parametrize("app_class", app_types)
334345
def test_workload_directive(app_class, func_type):
335-
app_inst = app_class("/not/a/path")
346+
test_class = generate_app_class(app_class)
347+
app_inst = test_class("/not/a/path")
336348
test_defs = {}
337349
test_defs.update(add_workload(app_inst, func_type=func_type))
338350

@@ -352,7 +364,8 @@ def test_workload_directive(app_class, func_type):
352364
@pytest.mark.parametrize("func_type", test_func_types)
353365
@pytest.mark.parametrize("app_class", app_types)
354366
def test_executable_directive(app_class, func_type):
355-
app_inst = app_class("/not/a/path")
367+
test_class = generate_app_class(app_class)
368+
app_inst = test_class("/not/a/path")
356369
test_defs = {}
357370
test_defs.update(add_executable(app_inst, func_type=func_type))
358371

@@ -367,7 +380,8 @@ def test_executable_directive(app_class, func_type):
367380
@pytest.mark.parametrize("func_type", test_func_types)
368381
@pytest.mark.parametrize("app_class", app_types)
369382
def test_figure_of_merit_directive(app_class, func_type):
370-
app_inst = app_class("/not/a/path")
383+
test_class = generate_app_class(app_class)
384+
app_inst = test_class("/not/a/path")
371385
test_defs = {}
372386
test_defs.update(add_figure_of_merit(app_inst, func_type=func_type))
373387

@@ -382,7 +396,8 @@ def test_figure_of_merit_directive(app_class, func_type):
382396
@pytest.mark.parametrize("func_type", test_func_types)
383397
@pytest.mark.parametrize("app_class", app_types)
384398
def test_input_file_directive(app_class, func_type):
385-
app_inst = app_class("/not/a/path")
399+
test_class = generate_app_class(app_class)
400+
app_inst = test_class("/not/a/path")
386401
test_defs = {}
387402
test_defs.update(add_input_file(app_inst, func_type=func_type))
388403

@@ -401,7 +416,8 @@ def test_input_file_directive(app_class, func_type):
401416
@pytest.mark.parametrize("func_type", test_func_types)
402417
@pytest.mark.parametrize("app_class", app_types)
403418
def test_define_compiler_directive(app_class, func_type):
404-
app_inst = app_class("/not/a/path")
419+
test_class = generate_app_class(app_class)
420+
app_inst = test_class("/not/a/path")
405421
test_defs = {}
406422
test_defs.update(add_compiler(app_inst, 1, func_type=func_type))
407423
test_defs.update(add_compiler(app_inst, 2, func_type=func_type))
@@ -416,7 +432,8 @@ def test_define_compiler_directive(app_class, func_type):
416432
@pytest.mark.parametrize("func_type", test_func_types)
417433
@pytest.mark.parametrize("app_class", app_types)
418434
def test_software_spec_directive(app_class, func_type):
419-
app_inst = app_class("/not/a/path")
435+
test_class = generate_app_class(app_class)
436+
app_inst = test_class("/not/a/path")
420437
test_defs = {}
421438
test_defs.update(add_software_spec(app_inst, 1, func_type=func_type))
422439
test_defs.update(add_software_spec(app_inst, 2, func_type=func_type))

lib/ramble/ramble/test/modifier_language.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
from ramble.language.language_base import DirectiveError
1616

1717

18-
mod_types = [ModifierBase, BasicModifier, SpackModifier] # noqa: F405 # noqa: F405 # noqa: F405
18+
mod_types = [ModifierBase, BasicModifier] # noqa: F405
1919

2020
func_types = enum.Enum("func_types", ["method", "directive"])
21+
test_func_types = [func_types.method]
2122

2223

2324
def generate_mod_class(base_class):
@@ -70,7 +71,7 @@ def add_mode(mod_inst, mode_num=1, func_type=func_types.directive):
7071
return mode_def
7172

7273

73-
@pytest.mark.parametrize("func_type", func_types)
74+
@pytest.mark.parametrize("func_type", test_func_types)
7475
@pytest.mark.parametrize("mod_class", mod_types)
7576
def test_mode_directive(mod_class, func_type):
7677
test_class = generate_mod_class(mod_class)
@@ -115,7 +116,7 @@ def add_variable_modification(mod_inst, var_mod_num=1, func_type=func_types.dire
115116
return var_mod_def
116117

117118

118-
@pytest.mark.parametrize("func_type", func_types)
119+
@pytest.mark.parametrize("func_type", test_func_types)
119120
@pytest.mark.parametrize("mod_class", mod_types)
120121
def test_variable_modification_directive(mod_class, func_type):
121122
test_class = generate_mod_class(mod_class)
@@ -145,7 +146,7 @@ def test_variable_modification_directive(mod_class, func_type):
145146
assert test_def[attr] == mod_inst.variable_modifications[mode_name][var_name][attr]
146147

147148

148-
@pytest.mark.parametrize("func_type", func_types)
149+
@pytest.mark.parametrize("func_type", test_func_types)
149150
@pytest.mark.parametrize("mod_class", mod_types)
150151
def test_variable_modification_invalid_method(mod_class, func_type):
151152
var_mod_name = "invalid_method_variable"
@@ -169,7 +170,7 @@ def test_variable_modification_invalid_method(mod_class, func_type):
169170
assert "variable_modification directive given an invalid method" in err
170171

171172

172-
@pytest.mark.parametrize("func_type", func_types)
173+
@pytest.mark.parametrize("func_type", test_func_types)
173174
@pytest.mark.parametrize("mod_class", mod_types)
174175
def test_variable_modification_missing_mode(mod_class, func_type):
175176
var_mod_name = "missing_mode_variable"
@@ -210,7 +211,7 @@ def add_software_spec(mod_inst, spec_num=1, func_type=func_types.directive):
210211
return spec_def
211212

212213

213-
@pytest.mark.parametrize("func_type", func_types)
214+
@pytest.mark.parametrize("func_type", test_func_types)
214215
@pytest.mark.parametrize("mod_class", mod_types)
215216
def test_software_spec_directive(mod_class, func_type):
216217
test_class = generate_mod_class(mod_class)
@@ -254,7 +255,7 @@ def add_compiler(mod_inst, spec_num=1, func_type=func_types.directive):
254255
return spec_def
255256

256257

257-
@pytest.mark.parametrize("func_type", func_types)
258+
@pytest.mark.parametrize("func_type", test_func_types)
258259
@pytest.mark.parametrize("mod_class", mod_types)
259260
def test_define_compiler_directive(mod_class, func_type):
260261
test_class = generate_mod_class(mod_class)
@@ -292,7 +293,7 @@ def add_required_package(mod_inst, pkg_num=1, func_type=func_types.directive):
292293
return pkg_def
293294

294295

295-
@pytest.mark.parametrize("func_type", func_types)
296+
@pytest.mark.parametrize("func_type", test_func_types)
296297
@pytest.mark.parametrize("mod_class", mod_types)
297298
def test_required_package_directive(mod_class, func_type):
298299
test_class = generate_mod_class(mod_class)
@@ -327,7 +328,7 @@ def add_figure_of_merit_context(mod_inst, context_num=1, func_type=func_types.di
327328
return context_def
328329

329330

330-
@pytest.mark.parametrize("func_type", func_types)
331+
@pytest.mark.parametrize("func_type", test_func_types)
331332
@pytest.mark.parametrize("mod_class", mod_types)
332333
def test_figure_of_merit_context_directive(mod_class, func_type):
333334
test_class = generate_mod_class(mod_class)
@@ -389,7 +390,7 @@ def add_figure_of_merit(mod_inst, context_num=1, func_type=func_types.directive)
389390
return fom_def
390391

391392

392-
@pytest.mark.parametrize("func_type", func_types)
393+
@pytest.mark.parametrize("func_type", test_func_types)
393394
@pytest.mark.parametrize("mod_class", mod_types)
394395
def test_figure_of_merit_directive(mod_class, func_type):
395396
test_class = generate_mod_class(mod_class)
@@ -423,7 +424,7 @@ def add_archive_pattern(mod_inst, archive_num=1, func_type=func_types.directive)
423424
return pattern
424425

425426

426-
@pytest.mark.parametrize("func_type", func_types)
427+
@pytest.mark.parametrize("func_type", test_func_types)
427428
@pytest.mark.parametrize("mod_class", mod_types)
428429
def test_archive_pattern_directive(mod_class, func_type):
429430
test_class = generate_mod_class(mod_class)
@@ -453,7 +454,7 @@ def add_executable_modifier(mod_inst, exec_mod_num=1, func_type=func_types.direc
453454
return mod_name
454455

455456

456-
@pytest.mark.parametrize("func_type", func_types)
457+
@pytest.mark.parametrize("func_type", test_func_types)
457458
@pytest.mark.parametrize("mod_class", mod_types)
458459
def test_executable_modifier_directive(mod_class, func_type):
459460
test_class = generate_mod_class(mod_class)
@@ -488,7 +489,7 @@ def add_env_var_modification(mod_inst, env_var_mod_num=1, func_type=func_types.d
488489
return test_defs
489490

490491

491-
@pytest.mark.parametrize("func_type", func_types)
492+
@pytest.mark.parametrize("func_type", test_func_types)
492493
@pytest.mark.parametrize("mod_class", mod_types)
493494
def test_env_var_modification_directive(mod_class, func_type):
494495
test_class = generate_mod_class(mod_class)
@@ -538,7 +539,7 @@ def add_modifier_variable(mod_inst, mod_var_num=1, func_type=func_types.directiv
538539
return test_defs
539540

540541

541-
@pytest.mark.parametrize("func_type", func_types)
542+
@pytest.mark.parametrize("func_type", test_func_types)
542543
@pytest.mark.parametrize("mod_class", mod_types)
543544
def test_modifier_variable_directive(mod_class, func_type):
544545
test_class = generate_mod_class(mod_class)
@@ -558,7 +559,7 @@ def test_modifier_variable_directive(mod_class, func_type):
558559
assert test_def["default"] == mod_inst.modifier_variables[mode][var_name].default
559560

560561

561-
@pytest.mark.parametrize("func_type", func_types)
562+
@pytest.mark.parametrize("func_type", test_func_types)
562563
@pytest.mark.parametrize("mod_class", mod_types)
563564
def test_modifier_class_attributes(mod_class, func_type):
564565
test_class = generate_mod_class(mod_class)

lib/ramble/ramble/test/package_manager_language.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
]
1919

2020
func_types = enum.Enum("func_types", ["method", "directive"])
21+
test_func_types = [func_types.method]
2122

2223

2324
def generate_pkg_man_class(base_class):
@@ -61,7 +62,7 @@ def add_variable(pm_inst, pm_num=1, func_type=func_types.directive):
6162
return var_def
6263

6364

64-
@pytest.mark.parametrize("func_type", func_types)
65+
@pytest.mark.parametrize("func_type", test_func_types)
6566
@pytest.mark.parametrize("base_class", pm_types)
6667
def test_pkg_man_variables(base_class, func_type):
6768
pm_class = generate_pkg_man_class(base_class)

0 commit comments

Comments
 (0)