Skip to content

Commit

Permalink
Move testing dicts to yaml (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebachmeier authored Feb 21, 2025
1 parent 1d36b3f commit 9e34a68
Show file tree
Hide file tree
Showing 34 changed files with 503 additions and 757 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
**0.1.6 - 2/21/25**

- Move test dictionaries to yaml files

**0.1.5 - 2/20/25**

- Fix handling of templated steps when no looping or parallelism is requested
Expand Down
4 changes: 2 additions & 2 deletions src/easylink/pipeline_schema_constants/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

TESTING_SCHEMA_PARAMS = {
"integration": testing.SINGLE_STEP_SCHEMA_PARAMS,
"combined_bad_topology": testing.BAD_COMBINED_TOPOLOGY_SCHEMA_PARAMS,
"combined_bad_implementation_names": testing.BAD_COMBINED_TOPOLOGY_SCHEMA_PARAMS,
"combine_bad_topology": testing.BAD_COMBINED_TOPOLOGY_SCHEMA_PARAMS,
"combine_bad_implementation_names": testing.BAD_COMBINED_TOPOLOGY_SCHEMA_PARAMS,
"nested_templated_steps": testing.NESTED_TEMPLATED_STEPS_SCHEMA_PARAMS,
}
7 changes: 3 additions & 4 deletions src/easylink/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ def set_configuration_state(
Notes
-----
A ``TemplatedStep`` is always assigned a :class:`NonLeafConfigurationState`
A ``TemplatedStep`` is *always* assigned a :class:`NonLeafConfigurationState`
even if it has no multiplicity since (despite having no copies to make) we
still need to traverse the sub-``Steps`` to get to the one with a single
:class:`~easylink.implementation.Implementation`, i.e. the one with a
Expand Down Expand Up @@ -851,9 +851,8 @@ def set_configuration_state(
self.slot_mappings = self._update_slot_mappings(num_repeats)
# Manually set the configuration state to non-leaf instead of relying
# on super().get_configuration_state() because that method will erroneously
# set to leaf state when we have no multiplicity (because in that case the
# user didn't actually include the config_key in the pipeline specification
# file, hence num_repeats == 1)
# set to leaf state in the event the user didn't include the config_key
# in the pipeline specification.
self._configuration_state = NonLeafConfigurationState(
self, expanded_config, combined_implementations, input_data_config
)
Expand Down
2 changes: 2 additions & 0 deletions tests/specifications/unit/environment_minimum.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
computing_environment: local
container_engine: undefined
15 changes: 15 additions & 0 deletions tests/specifications/unit/environment_spark_slurm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
computing_environment: slurm
container_engine: singularity
slurm:
account: some-account
partition: some-partition
implementation_resources:
memory: 42
cpus: 42
time_limit: 42
spark:
workers:
num_workers: 42
cpus_per_node: 42
mem_per_node: 42
time_limit: 42
15 changes: 15 additions & 0 deletions tests/specifications/unit/pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
steps:
step_1:
implementation:
name: step_1_python_pandas
step_2:
implementation:
name: step_2_python_pandas
step_3:
implementation:
name: step_3_python_pandas
choice_section:
type: simple
step_4:
implementation:
name: step_4_python_pandas
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
steps:
step_1:
implementation:
name: step_1_python_pandas
step_2:
implementation:
name: step_2_python_pandas
step_3:
combined_implementation_key: foo
choice_section:
type: simple
step_4:
implementation:
name: step_4_python_pandas
15 changes: 15 additions & 0 deletions tests/specifications/unit/pipeline_bad_implementation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
steps:
step_1:
implementation:
name: foo # not a valid/supported implementation
step_2:
implementation:
name: step_2_python_pandas
step_3:
implementation:
name: step_3_python_pandas
choice_section:
type: simple
step_4:
implementation:
name: step_4_python_pandas
15 changes: 15 additions & 0 deletions tests/specifications/unit/pipeline_bad_loop_formatting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
steps:
step_1:
implementation:
name: step_1_python_pandas
step_2:
implementation:
name: step_2_python_pandas
step_3:
iterate:
implementation: step_3_python_pandas
choice_section:
type: simple
step_4:
implementation:
name: step_4_python_pandas
18 changes: 18 additions & 0 deletions tests/specifications/unit/pipeline_bad_step.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
steps:
foo:
implementation:
name: step_1_python_pandas
step_1:
implementation:
name: step_1_python_pandas
step_2:
implementation:
name: step_2_python_pandas
step_3:
implementation:
name: step_3_python_pandas
choice_section:
type: simple
step_4:
implementation:
name: step_4_python_pandas
15 changes: 15 additions & 0 deletions tests/specifications/unit/pipeline_bad_type_key.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
steps:
step_1:
implementation:
name: step_1_python_pandas
step_2:
implementation:
name: step_2_python_pandas
step_3:
implementation:
name: step_3_python_pandas
choice_section:
type: foo # not a supported type
step_4:
implementation:
name: step_4_python_pandas
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
steps:
step_1:
implementation:
name: step_1_python_pandas
step_2:
implementation:
name: step_2_python_pandas
combined_implementation_key: step_3_4 # incorrect key
step_3:
implementation:
name: step_3_python_pandas
choice_section:
type: simple
step_4:
combined_implementation_key: step_3_4
combined_implementations:
step_3_4:
name: step_3_and_step_4_combined_python_pandas
18 changes: 18 additions & 0 deletions tests/specifications/unit/pipeline_combine_bad_topology.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
steps:
step_1:
iterate:
- substeps:
step_1a:
implementation:
name: step_1a_python_pandas
step_1b:
combined_implementation_key: step_1a_1b
- substeps:
step_1a:
combined_implementation_key: step_1a_1b
step_1b:
implementation:
name: step_1b_python_pandas
combined_implementations:
step_1a_1b:
name: step_1a_and_step_1b_combined_python_pandas
16 changes: 16 additions & 0 deletions tests/specifications/unit/pipeline_combine_two_steps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
steps:
step_1:
implementation:
name: step_1_python_pandas
step_2:
implementation:
name: step_2_python_pandas
step_3:
combined_implementation_key: step_3_4
choice_section:
type: simple
step_4:
combined_implementation_key: step_3_4
combined_implementations:
step_3_4:
name: step_3_and_step_4_combined_python_pandas
15 changes: 15 additions & 0 deletions tests/specifications/unit/pipeline_combine_with_extra_node.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
steps:
step_1:
implementation:
name: step_1_python_pandas
step_2:
combined_implementation_key: step_3_4
step_3:
combined_implementation_key: step_3_4
choice_section:
type: simple
step_4:
combined_implementation_key: step_3_4
combined_implementations:
step_3_4:
name: step_3_and_step_4_combined_python_pandas
19 changes: 19 additions & 0 deletions tests/specifications/unit/pipeline_combine_with_iteration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
steps:
step_1:
implementation:
name: step_1_python_pandas
step_2:
implementation:
name: step_2_python_pandas
step_3:
iterate:
- implementation:
name: step_3_python_pandas
- combined_implementation_key: step_3_4
choice_section:
type: simple
step_4:
combined_implementation_key: step_3_4
combined_implementations:
step_3_4:
name: step_3_and_step_4_combined_python_pandas
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
steps:
step_1:
implementation:
name: step_1_python_pandas
step_2:
implementation:
name: step_2_python_pandas
step_3:
iterate:
- combined_implementation_key: step_3_4
- implementation:
name: step_3_python_pandas
choice_section:
type: simple
step_4:
combined_implementation_key: step_3_4
combined_implementations:
step_3_4:
name: step_3_and_step_4_combined_python_pandas
17 changes: 17 additions & 0 deletions tests/specifications/unit/pipeline_combine_with_missing_node.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
steps:
step_1:
implementation:
name: step_1_python_pandas
step_2:
implementation:
name: step_2_python_pandas
step_3:
implementation:
name: step_3_python_pandas
choice_section:
type: simple
step_4:
combined_implementation_key: step_3_4
combined_implementations:
step_3_4:
name: step_3_and_step_4_combined_python_pandas
24 changes: 24 additions & 0 deletions tests/specifications/unit/pipeline_combine_with_parallel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
steps:
step_1:
parallel:
- input_data_file: file1
implementation:
name: step_1_python_pandas
- input_data_file: file2
implementation:
name: step_1_python_pandas
- input_data_file: file2
combined_implementation_key: steps_1_and_2_combined
step_2:
combined_implementation_key: steps_1_and_2_combined
step_3:
implementation:
name: step_3_python_pandas
choice_section:
type: simple
step_4:
implementation:
name: step_4_python_pandas
combined_implementations:
steps_1_and_2_combined:
name: step_1_and_step_2_combined_python_pandas
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
steps:
step_1:
implementation:
foo: bar # missing name key
step_2:
implementation:
name: step_2_python_pandas
step_3:
implementation:
name: step_3_python_pandas
choice_section:
type: simple
step_4:
implementation:
name: step_4_python_pandas
14 changes: 14 additions & 0 deletions tests/specifications/unit/pipeline_missing_implementations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
steps:
step_1:
foo: bar # missing implementation key
step_2:
implementation:
name: step_2_python_pandas
step_3:
implementation:
name: step_3_python_pandas
choice_section:
type: simple
step_4:
implementation:
name: step_4_python_pandas
14 changes: 14 additions & 0 deletions tests/specifications/unit/pipeline_missing_loop_nodes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
steps:
step_1:
implementation:
name: step_1_python_pandas
step_2:
implementation:
name: step_2_python_pandas
step_3:
iterate: []
choice_section:
type: simple
step_4:
implementation:
name: step_4_python_pandas
4 changes: 4 additions & 0 deletions tests/specifications/unit/pipeline_missing_step.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
steps:
step_2:
implementation:
name: step_2_python_pandas
17 changes: 17 additions & 0 deletions tests/specifications/unit/pipeline_missing_substeps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
steps:
step_1:
implementation:
name: step_1_python_pandas
step_2:
implementation:
name: step_2_python_pandas
step_3:
implementation:
name: step_3_python_pandas
choice_section:
type: simple
step_4:
substeps:
step_4a:
implementation: foo # missing name key
# missing step_4b
15 changes: 15 additions & 0 deletions tests/specifications/unit/pipeline_missing_type_key.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
steps:
step_1:
implementation:
name: step_1_python_pandas
step_2:
implementation:
name: step_2_python_pandas
step_3:
implementation:
name: step_3_python_pandas
choice_section:
# missing 'type' key
step_4:
implementation:
name: step_4_python_pandas
Loading

0 comments on commit 9e34a68

Please sign in to comment.