# if we ever run into issues where the eval tasks don't fit in memory and we can't afford a machine with bigger memory,
# If we ever run into issues where the eval tasks don't fit in memory and we can't afford a machine with bigger
# we can always modify this plumbing to support that, but i didn't want to include it just yet because overengineering is bad
# memory, we can always modify this plumbing to support that, but I didn't want to include it just yet because
# (or we could make it write the requests to disk and then read them back out again - probably using an sqlite db because of all the moving parts we have
# over-engineering is bad (or we could make it write the requests to disk and then read them back out again
# - probably using an sqlite db because of all the moving parts we have
# TODO: we need unit tests & sanity checks or something to ensure that the return of `validation_docs` is stable
# TODO: we need unit tests & sanity checks or something to ensure that the return of `validation_docs` is stable
docs={}
docs={}
# get lists of each type of requeste
# get lists of each type of request
fortask_name,taskintask_dict_items:
fortask_name,taskintask_dict_items:
versions[task_name]=task.VERSION
versions[task_name]=task.VERSION
#default to test doc, fall back to val doc if validation unavailable
#default to test doc, fall back to val doc if validation unavailable
# TODO: the test-fallback-to-val system isn't final, we should revisit it at some point
# TODO: the test-fallback-to-val system isn't final, we should revisit it at some point
iftask.has_test_docs():
iftask.has_test_docs():
task_doc_func=task.test_docs
task_doc_func=task.test_docs
eliftask.has_validation_docs():
eliftask.has_validation_docs():
task_doc_func=task.validation_docs
task_doc_func=task.validation_docs
else:
raiseRuntimeError("Task has neither test_docs nor validation_docs")
# deterministically shuffle docs and chop off the first `limit` because sometimes docs are in some kind of order
# deterministically shuffle docs and chop off the first `limit` because sometimes docs are in some kind of order