Skip to content

Option to test tools on update/install for Galaxy 18.05.#81

Merged
jmchilton merged 1 commit intogalaxyproject:masterfrom
jmchilton:tool_tests
May 8, 2018
Merged

Option to test tools on update/install for Galaxy 18.05.#81
jmchilton merged 1 commit intogalaxyproject:masterfrom
jmchilton:tool_tests

Conversation

@jmchilton
Copy link
Copy Markdown
Member

@jmchilton jmchilton commented Mar 12, 2018

Builds on #78 from @rhpvorderman since it modifies similar files.

While it does run the tests and produce a JSON output file that should be usable with planemo test_reports (http://planemo.readthedocs.io/en/latest/commands.html#test-reports-command) after the next Planemo release, marked as WIP because:

  • The tool tests create a user and a user API key to run tool tests, this should be configurable.
  • It doesn't have any in-ephemeris reporting yet - not display of test results. What do people want to see here? Probably the JSON is not enough?
  • Probably we should break up timing code also and have separate timing for install and testing?
  • Failed tests don't modify the shed-tools exit code.
  • Do we want to do all the installs and then all the tests like this or should we try to interleave them or should we test as we install or should be make this configurable? Lets just stick with doing them at the end and leave things be for now - we can revisit in the future.

Also, what of these questions can we delay to a second iteration?

Implements #76.

@rhpvorderman
Copy link
Copy Markdown
Contributor

@jmchilton can you rebase on master? The commits from #78 are now in.

Comment thread ephemeris/shed_tools.py
"--test",
action="store_true",
dest="test",
help="Run tool tests on install tools, requires Galaxy 18.05 or newer."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This requirement should be hardcoded somewhere
gi.config.get_config()["version_major"] returns the version.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know about this - Nate had mentioned wanting to get this on usegalaxy.org and we were intending to maybe place the Galaxy-side APIs in the usegalaxy branch to allow this testing against our variant of 18.01. I guess we could just hack up ephemeris though if we do get around to setting this up. I'll try to find a spot to make this change.

Comment thread ephemeris/shed_tools.py Outdated
"--test_json",
dest="test_json",
help="If --test is specified, record tool test output to specified file. "
"This file can be turned into nice reports with ``planemo test_reports <output.json>``."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personal taste: I would leave out the word 'nice' here.

Comment thread ephemeris/shed_tools.py
help="If --test is specified, also run tool tests on repositories already installed "
"(i.e. skipped repositories)."
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool!

Comment thread ephemeris/shed_tools.py Outdated
for tool in installed_tools:
galaxy_interactor_kwds = {
"galaxy_url": re.sub('/api', '', self.gi.url),
"master_api_key": self.gi.key,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will self.gi.key always return the key? Also if initiated with email and password. I tested it and it seems to be the case. But is this certain?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/galaxyproject/bioblend/blob/master/bioblend/galaxyclient.py#L202

Yes - as long as login_required=True with get_galaxy_connection - which it is for this command. It'd be nice if galaxy-lib had a variant of the client code that consume and used a bioblend GalaxyInstance but it doesn't yet so I think this is okay for now? I will admit this is a hack though - let me know if you need me to push the hack down a layer into galaxy-lib.

Comment thread ephemeris/shed_tools.py Outdated
log.info("All repositories have been processed.")
log.info("All repositories have been installed.")
if self.test:
installed_tools = []
Copy link
Copy Markdown
Contributor

@rhpvorderman rhpvorderman Mar 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should get its own method? test_repositories. It is a lot of extra code and it has its own specific function.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed - I'll try to make this change.

Comment thread ephemeris/shed_tools.py Outdated
test_results = []

for tool in installed_tools:
galaxy_interactor_kwds = {
Copy link
Copy Markdown
Contributor

@rhpvorderman rhpvorderman Mar 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole code block can be in a test_tool method. This makes it a lot cleaner:

for tool in installed_tools:
  test_information=self.test_tool(tool)
  # Some code to gather all the test information
# Some code to write al the test information to a json

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed - I'll try to make this change.

@rhpvorderman
Copy link
Copy Markdown
Contributor

I am all for integrating the testing within the installation method. But this causes indeed the exit code problem. Doing two things at the same time creates ambiguity.
However, you could argue that if a test fails, this means the tool should not be installed, which means installation has effectively failed.
Also I am in favor of adding a shed-tools test subcommand, which can be regularly by cron, to check if all the installed tools still functions.

@jmchilton
Copy link
Copy Markdown
Member Author

However, you could argue that if a test fails, this means the tool should not be installed, which means installation has effectively failed.

Yes - I think I agree. I'll see if I can make the exit code reflect the testing status.

Also I am in favor of adding a shed-tools test subcommand, which can be regularly by cron, to check if all the installed tools still functions.

Absolutely - this is an excellent idea - I'll try to reorganize this code to do that.

@jmchilton jmchilton changed the title [WIP] Option to test tools on update/install for Galaxy 18.05. Option to test tools on update/install for Galaxy 18.05. Mar 23, 2018
@galaxyproject galaxyproject deleted a comment Mar 23, 2018
@galaxyproject galaxyproject deleted a comment May 7, 2018
@galaxyproject galaxyproject deleted a comment May 7, 2018
@galaxyproject galaxyproject deleted a comment May 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants