Commit 893ef63f authored by Leo Gao's avatar Leo Gao
Browse files

Test training docs too and don't cache downloads

parent 7cbd0bba
...@@ -21,10 +21,9 @@ jobs: ...@@ -21,10 +21,9 @@ jobs:
with: with:
# A list of files, directories, and wildcard patterns to cache and restore # A list of files, directories, and wildcard patterns to cache and restore
path: | path: |
data
~/.cache ~/.cache
# An explicit key for restoring and saving the cache # An explicit key for restoring and saving the cache
key: evaldata-cache-2 key: evaldata-cache-3
- name: Set up Python 3.9 - name: Set up Python 3.9
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
......
...@@ -28,6 +28,7 @@ def test_basic_interface(taskname, Task): ...@@ -28,6 +28,7 @@ def test_basic_interface(taskname, Task):
# (don't test train because it's slow) # (don't test train because it's slow)
task2 = Task() task2 = Task()
limit = None limit = None
if task.has_validation_docs(): if task.has_validation_docs():
arr = list(islice(task.validation_docs(), limit)) arr = list(islice(task.validation_docs(), limit))
...@@ -51,6 +52,17 @@ def test_basic_interface(taskname, Task): ...@@ -51,6 +52,17 @@ def test_basic_interface(taskname, Task):
assert reqs == reqs2 assert reqs == reqs2
if taskname.has_training_docs():
arr = list(islice(task.training_docs(), limit))
arr2 = list(islice(task2.training_docs(), limit))
assert arr == arr2
reqs = [task.construct_requests(doc, task.doc_to_text(doc)) for doc in arr]
reqs2 = [task2.construct_requests(doc, task2.doc_to_text(doc)) for doc in arr2]
assert reqs == reqs2
@pytest.mark.parametrize("taskname,Task", tasks.TASK_REGISTRY.items()) @pytest.mark.parametrize("taskname,Task", tasks.TASK_REGISTRY.items())
def test_documents_and_requests(taskname, Task): def test_documents_and_requests(taskname, Task):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment