@@ -64,6 +64,8 @@ def assert_submission_fails(task):
6464 JobSubmissionModel (task = task )
6565 with pytest .raises (ValueError ):
6666 TransformationSubmissionModel (task = task )
67+ with pytest .raises (ValueError ):
68+ ProductionSubmissionModel (task = task )
6769
6870
6971# -----------------------------------------------------------------------------
@@ -112,54 +114,3 @@ def test_bad_min_max_resource_reqs(bad_min_max_reqs):
112114 step = create_step (run = nest_workflow )
113115 workflow = create_workflow (steps = [step ])
114116 assert_submission_fails (workflow )
115-
116-
117- @pytest .mark .parametrize (
118- ("wf_level_requirements" , "higher_requirements" ),
119- [
120- (ResourceRequirement (coresMax = 2 ), ResourceRequirement (coresMin = 4 )),
121- (ResourceRequirement (ramMax = 512 ), ResourceRequirement (ramMin = 1024 )),
122- (ResourceRequirement (tmpdirMax = 512 ), ResourceRequirement (tmpdirMin = 1024 )),
123- (ResourceRequirement (outdirMax = 256 ), ResourceRequirement (outdirMin = 512 )),
124- ],
125- )
126- def test_bad_wf_level_requirements (wf_level_requirements , higher_requirements ):
127- """Test global requirements conflicts."""
128- # Workflow - WorkflowStep conflict
129- step = create_step (requirements = [higher_requirements ])
130- workflow = create_workflow (requirements = [wf_level_requirements ], steps = [step ])
131- assert_submission_fails (workflow )
132-
133- # Workflow - WorkflowStep.run conflict
134- run = create_commandlinetool (requirements = [higher_requirements ])
135- step = create_step (run = run )
136- workflow = create_workflow (requirements = [wf_level_requirements ], steps = [step ])
137- assert_submission_fails (workflow )
138-
139- # Workflow - NestedWorkflow conflict
140- nest_workflow = create_workflow (requirements = [higher_requirements ])
141- step = create_step (run = nest_workflow )
142- workflow = create_workflow (requirements = [wf_level_requirements ], steps = [step ])
143- assert_submission_fails (workflow )
144-
145-
146- @pytest .mark .parametrize (
147- "requirements" ,
148- [
149- ResourceRequirement (coresMin = 2 , coresMax = 4 ),
150- ResourceRequirement (ramMin = 1024 , ramMax = 2048 ),
151- ResourceRequirement (tmpdirMin = 512 , tmpdirMax = 1024 ),
152- ResourceRequirement (outdirMin = 256 , outdirMax = 512 ),
153- ],
154- )
155- def test_production_requirements (requirements ):
156- """Test production case requirements."""
157- # Production workflows can't have Workflow-level requirements
158- workflow = create_workflow (requirements = [requirements ])
159- with pytest .raises (ValueError ):
160- ProductionSubmissionModel (task = workflow )
161-
162- # Production workflows can have step requirements
163- step = create_step (requirements = [requirements ])
164- workflow = create_workflow (steps = [step ])
165- ProductionSubmissionModel (task = workflow )
0 commit comments