galaxyproject / ephemeris

Library for managing Galaxy plugins - tools, index data, and workflows.
https://ephemeris.readthedocs.org/
Other
28 stars 38 forks source link

Testing tools as a non-default user #125

Open monprin opened 5 years ago

monprin commented 5 years ago

Hello,

I was playing around with running ephemeris in parallel and found two interesting issues, first, when starting a concurrent job, the API key for previously running jobs gets revoked and ephemeris reports these as failures, but checking them in the interface shows they actually succeeded. In working around this issue, I found another one:

I can't actually seem to run tests as a specific user (Tried many combos of flags, and the current git dev version). I came up with a dirty solution in the code to test it (src/ephemeris/shed-tools.py L265-L273):

...
        galaxy_interactor_kwds = {
            "galaxy_url": re.sub('/api', '', self.gi.url),
            "master_api_key": test_user_api_key, #self.gi.key,
            "api_key": test_user_api_key,  # TODO
            "keep_outputs_dir": '',
        }
        #if test_user_api_key is None:
        galaxy_interactor_kwds["test_user"] = test_user
        galaxy_interactor = GalaxyInteractorApi(**galaxy_interactor_kwds)
...

Obviously this breaks some other conditionals and what not but I just wanted to confirm this is the issue, and it does seem to be.

If you would like, I could try my hand at cleaning it up a little and submitting a PR, but I wanted to check first if this is in your plans to fix already.

Thank you! Joe

mvdbeek commented 5 years ago

This would probably be fixed by https://github.com/galaxyproject/ephemeris/pull/118/files, let me see if this passes now