AtlasOfLivingAustralia / image-service

Image repository and tiling services
https://images.ala.org.au
0 stars 17 forks source link

Integration test fails #98

Closed nickdos closed 4 years ago

nickdos commented 5 years ago

ContentNegotiationSpec class with test Test accept: image/jpeg fails with groovyx.net.http.HttpResponseException.

Debugging the test, it turns out the HTTPBuilder call is getting a 404 response, despite sending the correct UUID request path. E.g. http://localhost:60838/image/1e3c64b2-5814-4681-8a8a-67297add98b0.

I think the problem is due to the ImageController#proxyUrl() trying to proxy the image binary via port 8080 instead of port 60838 (although that may not work anyway as it appears to be falling back to Apache/Nginx to serve the images from the FS). See:

image

EDIT: I tried setting grailsApplication.config.imageservice.apache.root = "http://localhost:${serverPort}/store" in the test setup() method but still got 404 result.

It appears there needs to be an additional proxy method for this test so that the raw file can be read from /tmp/image-service/store/b/2/2/f/650a0f33-0509-4e90-a1a9-ebc41b4ff22b/original and served back via the http requested http://localhost:58192/store/b/2/2/f/650a0f33-0509-4e90-a1a9-ebc41b4ff22b/original.

djtfmartin commented 5 years ago

Fixed now on the develop branch. The tests are now passing.

The test now starts a jetty server during the test. Would be better to use nginx with docker to closer emulate production.