Commit ff4b80a6 authored by Alan Marchiori's avatar Alan Marchiori
Browse files

increased timeout

parent 2912c0ca
......@@ -97,8 +97,8 @@ class Checker:
error("Locate specified but no \{ \} in command! Check rubric!")
if to > 3:
warn("Running {} with timeout {}s, please wait!".format(
cmd, to
warn("Running command with timeout {}s, please wait!".format(
to
))
if 'remote' in check and 'depends' in check:
......@@ -148,7 +148,7 @@ class Checker:
lab_relative_path,
cmd
)
print("Remote exec: {}".format(cmd))
debug("Remote exec: {}".format(cmd))
c,t = run(cmd, shell=False, input=instr, timeout=to)
else:
# locally execute
......
......@@ -32,9 +32,11 @@ import contextlib # to redirect stdout
help='Regrade a previously graded item?\t[default: False]')
@click.option("--user", default=None,
help='Set to only grade a single user (by git username).\t[default: ALL]')
@click.option("--skip", default=None,
help='Skip the given user or list of users (comma separated)\t[default: None]')
@click.option("--push/--no-push", default = True, show_default=True,
help='Push commits to gitlab?')
def grade(lab, part, clone, dograde, regrade, user, push):
def grade(lab, part, clone, dograde, regrade, user, skip, push):
"""grade LAB and PART for students from gitlab. LAB is required. If PART is omitted, ALL parts are graded.
"""
......@@ -70,7 +72,7 @@ def grade(lab, part, clone, dograde, regrade, user, push):
echo(msg)
rubric = courses.load_rubric(coursename, labname)
if not rubric:
error("{} is not defined for the course {}.)".format(
labname, coursename
......@@ -96,6 +98,12 @@ def grade(lab, part, clone, dograde, regrade, user, push):
str(list(p['name_with_namespace'] for p in projects))))
return
if skip:
# allow comma separated lists
if ',' in skip:
skip = list(map(str.strip, skip.split(',')))
else:
skip = [skip.strip()]
for p in projects:
pname = p['name_with_namespace']
......@@ -104,6 +112,9 @@ def grade(lab, part, clone, dograde, regrade, user, push):
if user and student != user:
continue
if skip and student in skip:
warn("Skipping user {}.".format(student))
continue
echo("-"*(width-4))
echo("[{}] {} ({})".format('./'+student, pname, student))
......
......@@ -36,7 +36,7 @@ smtp_handler = logging.handlers.SMTPHandler(
subject=u"labtool crash report!")
__version__ = '1.0.10'
__date__ = '2020-02-17T12:42:31.300983'
__date__ = '2020-04-12T15:39:19.329244'
__user__ = 'cs206'
__host__ = 'linuxremote3.bucknell.edu'
@click.group()
......
......@@ -80,7 +80,7 @@ class Git:
# assume the repo has been cloned, just pull it
cmd = "git pull"
echo("Pulling {}... ".format(localpath))
c, r = shell.run(cmd, cwd = localpath)
c, r = shell.run(cmd, cwd = localpath, timeout=45)
if c != 0:
error('[{}]$ {}'.format(localpath, cmd))
error(r)
......
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