-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvements to tool test error handling. #19009
base: dev
Are you sure you want to change the base?
Conversation
try: | ||
result = response.json() | ||
except Exception as e: | ||
raise Exception( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you dump the status code and response.text ? I would prefer this over a guess
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only time we know this will happen is Galaxies without this patch - so there will be a huge dump of HTML. I think we keep the guess but also I'll dump that huge page I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, and even our expected error messages are json dumps. Maybe move the response.json to below the statsu code check on the next line ? Then I'm fine with not dumping in the text.
ec3ec61
to
73487cc
Compare
exc = None | ||
try: | ||
data_path = self.galaxy_interactor.test_data_path("cat1", "1.bed") | ||
print(data_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print(data_path) |
- Add integration test for invalid admin key. - Add tool test to ensure error message is valid JSON. - Swap order of require_admin and expose_api - expose_api sets environment so require_admin knows it should return JSON and not HTML. This is the bug fix.
73487cc
to
02a817d
Compare
How to test the changes?
(Select all options that apply)
License