Skip to content
This repository has been archived by the owner on Jan 24, 2018. It is now read-only.

Improve error logging for HTTP error status assertions #85

Closed
calbach opened this issue Sep 17, 2015 · 0 comments
Closed

Improve error logging for HTTP error status assertions #85

calbach opened this issue Sep 17, 2015 · 0 comments
Assignees

Comments

@calbach
Copy link
Contributor

calbach commented Sep 17, 2015

There's a bug in most places where the compliance tests expect HTTP errors, as the convention is to blindly dereference a caught exception (may be null, if the server returned a 200), thereby potentially causing an irrelevant stack trace.

For example, ReadGroupSetsGetByNameIT.testSearchForBogusNameeFails incorrectly expects the server to a return a 404 if it doesn't know about the bogus name (in actuality, it should expect an empty list of readGroupSets, see ga4gh/ga4gh-schemas#382). I'll file a separate issue for that, but this was difficult to debug because the test code actually attempts to dereference a null:

testSearchForBogusNameFails Error   N/A

java.lang.NullPointerException
at org.ga4gh.cts.api.reads.ReadGroupSetsGetByNameIT.testSearchForBogusNameeFails(ReadGroupSetsGetByNameIT.java:50)
at org.ga4gh.ctk.AntExecutor.executeAntTask(AntExecutor.java:173)
at org.ga4gh.ctk.TestRunner.doTestRun(TestRunner.java:101))
at org.ga4gh.ctk.TestRunner.doTestRun(TestRunner.java:70)
at org.ga4gh.ctk.Application.run(Application.java:70)
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:707)
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:691)
at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:678)
at org.springframework.boot.SpringApplication.doRun(SpringApplication.java:343)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:273)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:971)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:960)
at org.ga4gh.ctk.Application.main(Application.java:53)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:53)
at java.lang.Thread..run(Thread.java:745)

Ideally, the test would instead print an error which explains what the test expects, and what was actually returned.

@hjellinek hjellinek self-assigned this Sep 17, 2015
hjellinek added a commit to hjellinek/compliance that referenced this issue Sep 22, 2015
…rException so it will call fail() with a helpful message if the wrapped code does not throw GAWrapperException when it runs.

Also added missing @category to DatasetIdPropertyIT.
hjellinek added a commit that referenced this issue Sep 22, 2015
Fix for #85: added logging to Utils.catchGAWrapperException
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants