We have so much job code dependant on what version of Galaxy created a job. This should help keep track of that without having to hit the job directory and guess.
This replaces a previous (now closed) PR:
https://github.com/galaxyproject/galaxy/pull/8279
A few changes:
- tests for code in galaxy/tool_util moved under test/unit/tool_util
- common parts (used in both tools and tool_util) factored out into
unittest_utils/sample_data.py
- symlink to sample_data.py in test/unit/tool_util/ is needed to make
the tool_util package tests run. This is not an ideal solution, but it
avoids duplication of the sample data used by tests in tools/ and
tool_util/.
Factor out __environ context manager into helper class (and rename).
Move context manager tests into separate test module. Improve tests.
Refactor context manager:
- Change default arg to None
- Simplify: I don't think we need to keep track of new keys;
environ.clear() + environ.update(old_environ) should be sufficient.
We significantly reduce complexity at the minor cost of a little more
space.
- Instead of wrapping in a try/except block, just check if key exists
before deleting.
Modify test_tool_deps to use the new context manager.
There was a bug in a context manager inside a unit test. This caused
nondeterministic behavior of some unit tests after a refactoring.
Bug fixed; added 3 unit tests to test the context manager.
Move galaxy.web.stack.database_heartbeat into galaxy.model - since it was the only thing in galaxy.web.stack that used galaxy.model at all and it didn't import anything else from galaxy.web.stack.
Once that was done, I refactored this whole package (galaxy.web.stack) into galaxy.web_stack. It doesn't use the framework setup or exported by the base galaxy.web package so it wouldn't seem to belong there. It also has very different dependencies than the rest of that. And finally and most importantly, this elimiantes almost all dependency from galaxy.jobs and galaxy.tools and galaxy.workflows to anything in galaxy.web.
PR #8118 - adding to_dict to the dependency manager and an embedded loading of dependency resolution options from galaxy.yml - was really quite poorly thought through.
Certain options could be embedded - but only the resolvers and the actual dictified representation of the DependencyManager couldn't be actually embedded properly in the app config - but this is exactly what I wanted to do on the Pulsar side and it would make no sense to have the exact same options in both apps and configured differently.
So now the actual dictified representation of the whole DependencyManager can be directly embedded in galaxy.yml as the ``dependency_resolution:`` parameter. All the parameters can still be configured at the top level of the YAML file but with 'dependency' in the config option name (some prefixes, some suffixes, etc... a hodgepodge that has grown organically). Give the messiness of the existing options might be better to encourage using ``dependency_resolution:`` in the future.
- to simplify tool testing its of advantage to know
which parameter caused a problem
- for select parameters the illegal value and the
list of legal values is added
- also unified the text of the messages
Co-Authored-By: Marius van den Beek <m.vandenbeek@gmail.com>