Skip to content
Snippets Groups Projects
Commit 84e533a6 authored by Daniel Skýpala's avatar Daniel Skýpala
Browse files

Refresh: Add refresh

parent 4d191b31
No related branches found
No related tags found
No related merge requests found
from copy import deepcopy
from git import Repo
from random import shuffle
import os
import task_autotest.config as config
from task_autotest.util import path_to_str
from task_autotest.test import test_task_commit
def refresh() -> None:
repo = Repo(config.REPO_DIR)
repo.remotes.origin.pull()
tasks = deepcopy(config.TASKS)
shuffle(tasks)
for branch, task in tasks:
repo.git.checkout(branch)
commit_hash = repo.head.commit.hexsha
if not os.path.exists(os.path.join(config.DATA_DIR, path_to_str(task), commit_hash)):
return test_task_commit(task, commit_hash)
return None
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment