-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add integration test for ignoring invalid resource request in tool state
- Loading branch information
Showing
5 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<parameters> | ||
<param label="Compute Resource" name="multi_compute_resource" type="select" | ||
help="Need help selecting a compute resource? Options and limits are explained in detail <a href='https://galaxyproject.org/main/' target='_blank'>in the Galaxy Hub</a>"> | ||
<option value="does not matter">Galaxy cluster</option> | ||
<option value="or this">Jetstream 2</option> | ||
</param> | ||
</parameters> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# job config that fails submission if job resource parameters are requested | ||
runners: | ||
local: | ||
load: galaxy.jobs.runners.local:LocalJobRunner | ||
workers: 1 | ||
dynamic: | ||
rules_module: integration.job_resource_rules | ||
|
||
execution: | ||
default: initial_destination | ||
environments: | ||
initial_destination: | ||
runner: dynamic | ||
type: python | ||
function: local_or_exception | ||
local: | ||
runner: local | ||
|
||
tools: | ||
- class: local | ||
environment: local | ||
resources: upload |
Empty file.
5 changes: 5 additions & 0 deletions
5
test/integration/job_resource_rules/fail_if_job_resource_present.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
def local_or_exception(resource_params): | ||
"""Build environment that fails if resource_params are passed.""" | ||
if resource_params: | ||
raise Exception("boo!") | ||
return "local" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import os | ||
|
||
from galaxy_test.base.populators import ( | ||
DatasetPopulator, | ||
WorkflowPopulator, | ||
) | ||
from galaxy_test.driver import integration_util | ||
|
||
SCRIPT_DIRECTORY = os.path.abspath(os.path.dirname(__file__)) | ||
JOB_RESOURCES_CONFIG_FILE = os.path.join(SCRIPT_DIRECTORY, "dummy_job_resource_parameters.xml") | ||
JOB_CONFIG = os.path.join(SCRIPT_DIRECTORY, "job_resource_error_recovery_job_conf.yml") | ||
|
||
|
||
class TestJobRecoveryBeforeHandledIntegration(integration_util.IntegrationTestCase): | ||
dataset_populator: DatasetPopulator | ||
framework_tool_and_types = True | ||
|
||
def setUp(self) -> None: | ||
super().setUp() | ||
self.dataset_populator = DatasetPopulator(self.galaxy_interactor) | ||
self.workflow_populator = WorkflowPopulator(self.galaxy_interactor) | ||
|
||
@classmethod | ||
def handle_galaxy_config_kwds(cls, config) -> None: | ||
super().handle_galaxy_config_kwds(config) | ||
config["job_config_file"] = JOB_CONFIG | ||
config["job_resource_params_file"] = JOB_RESOURCES_CONFIG_FILE | ||
|
||
def test_recovers_from_job_resource_errors(self): | ||
with self.dataset_populator.test_history() as history_id: | ||
self.workflow_populator.run_workflow( | ||
""" | ||
class: GalaxyWorkflow | ||
steps: | ||
simple_step: | ||
tool_id: create_2 | ||
tool_state: | ||
__job_resource: | ||
__job_resource__select: 'yes' | ||
cores: '32' | ||
""", | ||
history_id=history_id, | ||
) |