[Linaro-validation] RFC Patch: lava with no media files
zygmunt.krynicki at linaro.org
Fri Apr 20 23:53:44 UTC 2012
W dniu 21.04.2012 01:10, Andy Doan pisze:
> I was trying to get my local LAVA instance to work with our lab's data
> base dump. So I had the DB, but not all the media files. LAVA almost
> works when you do this, but I hit two small issues that prevented me
> from looking at bundle streams and it their test runs.
> I realize this is an edge case, but its handy for when you want to test
> with a real database, but don't want all the media files. I'm not sure
> this is the exact way we want to fix this, so rather than do a merge
> proposal I thought I'd get your thoughts on the patch first.
> There were two main issues in the code:
> bundle_detail wants to get the "document format" for the media file
> associated with the bundle. Since the file didn't exist we hit an
> exception. I added a small check to the get_document_format to handle
> this by returning "n/a".
> bundle_detail and test_run_detail wanted to display the size of media
> files. This calls a new function content_size which will catch an error
> if the file doesn't exist and simply return 0.
> I'm not sure if this patch is doing to good a job of hiding the fact an
> error does exist. Maybe we should put a conditional in the template file
> to display an error when the file doesn't exist also?
Are we going to review patches on the mailing list? I don't think our
current tools are up to the task.
As for your patches, I like the intent, though the motivation is
somewhat non-production. There is something that you may want to use
that allows you to work with just the database dump and pull the media
files from production on demand. There's a django app for that.
Document format should be in the database, a proper fix would pull it
out. Current code will also fail when the document is bonkers and just
does not parse as JSON.
File size can also fail in the template so we should double check that
we don't call any file size filters in any of the html files. (it looks
More information about the linaro-validation