Open dmarra opened 1 month ago
Hi @dmarra, thanks for raising this.
My assumption is that the application takes whatever OutputLocation
is given, downloads the result from S3 and does whatever it needs to do with the result.
Would it work if Moto would actually write the configured query results to S3? Then the actual OutputLocation
doesn't matter, and the only test setup is to configure the expected results via the static/athena/query-results
endpoint.
That could work! The only issue with that is that the Athena output JSON is.... perhaps a bit overengineered. It's a pain to mock many rows of data in that format. But that being said, if this is the easiest way to get the enhancement in, then I think its way better than nothing. Makes sense too, since it works with the current design.
To clarify:
We are able to mock Athena query results via:
But there is no way to mock the output of
get_execution_results
. this poses a few problems:I am more interested in the latter. This would be a lot more useful if we could somehow assign results via a CSV, and have the
query-results
mocked from that. But in the simplest case, being able to control that datapoint to point to a file we have put to a mock bucket would go a long way in the case where the code under test needs to access the file directly.Here is an example of how I had to hack this into my tests:
The above works, but its pretty janky. I suppose this is more of a feature request than anything. Or even better yet, having a way to control execution id (not with seeding, thats still too unpredictable and fragile) such that it can be explicitly set.