From 3dcd234d011a5b7b38d0ca72d9b4c9b0335152d9 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Fri, 22 Apr 2016 00:31:20 -0500 Subject: [PATCH] Various tweaks. --- lib/kgrader/backend/svn.rb | 18 +++++++++++------- lib/kgrader/jail.rb | 2 +- lib/kgrader/runtime.rb | 2 +- spec/cs241h | 2 +- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/lib/kgrader/backend/svn.rb b/lib/kgrader/backend/svn.rb index 1928a5e..465db70 100644 --- a/lib/kgrader/backend/svn.rb +++ b/lib/kgrader/backend/svn.rb @@ -14,15 +14,10 @@ module KGrader::Backend def prepare(semester, assignment) return unless @config['verify'] - url = @config['verify'] % { - :semester => semester, - :assignment => assignment - } - - status = run('list', '--non-interactive', url)[1] - if status.exited? && status.exitstatus != 0 + unless test_okay print "svn: password: " @password = STDIN.noecho(&:gets).chomp + print "svn: bad password or other network issues" unless test_okay end end @@ -75,5 +70,14 @@ module KGrader::Backend :student => student } end + + def test_okay + url = @config['verify'] % { + :semester => semester, + :assignment => assignment + } + status = run('list', '--non-interactive', url)[1] + status.exited? && status.exitstatus == 0 + end end end diff --git a/lib/kgrader/jail.rb b/lib/kgrader/jail.rb index 1a0cc8d..ac8a803 100644 --- a/lib/kgrader/jail.rb +++ b/lib/kgrader/jail.rb @@ -52,7 +52,7 @@ module KGrader Dir.chdir @root options = { :in => :close, :out => fp, :err => fp, :close_others => true, - :rlimit_nproc => 32 + :rlimit_nproc => 64 } yield options if block_given? Process.exec *command, options diff --git a/lib/kgrader/runtime.rb b/lib/kgrader/runtime.rb index 4141b92..1bdd479 100644 --- a/lib/kgrader/runtime.rb +++ b/lib/kgrader/runtime.rb @@ -15,7 +15,6 @@ module KGrader grade 0 end - puts "no grade received?" comment "autograde error (no grade reported); please contact staff" grade 0 end @@ -27,6 +26,7 @@ module KGrader end def comment(text) + puts "comment: #{text}" IO.new(4).write text + "\n" end diff --git a/spec/cs241h b/spec/cs241h index 22fd6cb..840fb08 160000 --- a/spec/cs241h +++ b/spec/cs241h @@ -1 +1 @@ -Subproject commit 22fd6cb688fcce712b4b68235533b59753aeaed7 +Subproject commit 840fb087ef3a9644a4f1ebb01a6baf555a7aa496