-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #105 from galaxyproject/check_remote_regex_multipl…
…e_matches Fix issue with how default inheritance is applied for multiple files
- Loading branch information
Showing
7 changed files
with
40 additions
and
14 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
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 |
---|---|---|
|
@@ -46,6 +46,12 @@ tools: | |
scheduling: | ||
require: | ||
- pulsar | ||
toolshed.g2.bx.psu.edu/repos/iuc/disco/disco/.*: | ||
env: | ||
DISCO_MORE_PARAMS: "just another param" | ||
scheduling: | ||
require: | ||
- pulsar | ||
|
||
users: | ||
[email protected]: | ||
|
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
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 |
---|---|---|
|
@@ -77,6 +77,8 @@ users: | |
scheduling: | ||
require: | ||
- special_resources | ||
reject: | ||
- pulsar | ||
|
||
destinations: | ||
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 |
---|---|---|
|
@@ -38,7 +38,7 @@ def test_merge_remote_and_local(self): | |
datasets = [mock_galaxy.DatasetAssociation("test", mock_galaxy.Dataset("test.txt", file_size=7*1024**3))] | ||
destination = self._map_to_destination(tool, user, datasets, tpv_config_paths=[config_first, config_second]) | ||
self.assertEqual(destination.id, "k8s_environment") | ||
self.assertEqual([env['value'] for env in destination.env if env['name'] == 'TEST_JOB_SLOTS'], ['2']) | ||
self.assertEqual([env['value'] for env in destination.env if env['name'] == 'TEST_JOB_SLOTS'], ['4']) | ||
self.assertEqual(destination.params['native_spec'], '--mem 8 --cores 2') | ||
self.assertEqual(destination.params['custom_context_remote'], 'remote var') | ||
self.assertEqual(destination.params['custom_context_local'], 'local var') | ||
|
@@ -65,7 +65,7 @@ def test_merge_local_with_local(self): | |
datasets = [mock_galaxy.DatasetAssociation("test", mock_galaxy.Dataset("test.txt", file_size=7*1024**3))] | ||
destination = self._map_to_destination(tool, user, datasets, tpv_config_paths=[config_first, config_second]) | ||
self.assertEqual(destination.id, "k8s_environment") | ||
self.assertEqual([env['value'] for env in destination.env if env['name'] == 'TEST_JOB_SLOTS'], ['2']) | ||
self.assertEqual([env['value'] for env in destination.env if env['name'] == 'TEST_JOB_SLOTS'], ['4']) | ||
self.assertEqual(destination.params['native_spec'], '--mem 8 --cores 2') | ||
self.assertEqual(destination.params['custom_context_remote'], 'remote var') | ||
self.assertEqual(destination.params['custom_context_local'], 'local var') | ||
|
@@ -104,3 +104,20 @@ def test_merge_rules_with_multiple_matches(self): | |
# this var is not overridden by the last defined defaults, and therefore, the remote value of cores*2 applies | ||
self.assertEqual([env['value'] for env in destination.env if env['name'] == 'MORE_JOB_SLOTS'], ['12']) | ||
self.assertEqual(destination.params['native_spec'], '--mem 18 --cores 6') | ||
|
||
def test_merge_rules_local_defaults_do_not_override_remote_tool(self): | ||
tool = mock_galaxy.Tool('toolshed.g2.bx.psu.edu/repos/iuc/disco/disco/v1.0') | ||
user = mock_galaxy.User('ford', '[email protected]') | ||
|
||
config_first = os.path.join(os.path.dirname(__file__), 'fixtures/mapping-merge-multiple-remote.yml') | ||
config_second = os.path.join(os.path.dirname(__file__), 'fixtures/mapping-merge-multiple-local.yml') | ||
|
||
# the disco rules should take effect, with local override winning | ||
datasets = [mock_galaxy.DatasetAssociation("test", mock_galaxy.Dataset("test.txt", file_size=42*1024**3))] | ||
destination = self._map_to_destination(tool, user, datasets, tpv_config_paths=[config_first, config_second]) | ||
self.assertEqual(destination.id, "k8s_environment") | ||
# since the last defined hisat2 contains overridden defaults, those defaults will apply | ||
self.assertEqual([env['value'] for env in destination.env if env['name'] == 'DISCO_MAX_MEMORY'], ['24']) | ||
self.assertEqual([env['value'] for env in destination.env if env['name'] == 'DISCO_MORE_PARAMS'], ['just another param']) | ||
# this var is not overridden by the last defined defaults, and therefore, the remote value applies | ||
self.assertEqual(destination.params['native_spec'], '--mem 24 --cores 8') |
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
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