Skip to content

Commit

Permalink
Fixed nesting, raketask name
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Xia committed Mar 19, 2012
1 parent 40ac757 commit 4128225
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion hw4_grader_stuff/hw4_rottenpotatoes/lib/tasks/saas.rake
@@ -1,5 +1,5 @@
namespace :saas do
task : => :environment do
task :run_student_tests => :environment do
desc "Runs all tasks for grading"

errors = []
Expand Down
31 changes: 15 additions & 16 deletions lib/graders/hw4_grader.rb
Expand Up @@ -92,6 +92,9 @@ def grade!

start_time = Time.now

@raw_score = 0
@raw_max = 500

Dir.mktmpdir('hw4_grader', '/tmp') do |tmpdir|
# Copy base app
FileUtils.cp_r Dir.glob(File.join(@base_app_path,"*")), tmpdir
Expand All @@ -108,10 +111,10 @@ def grade!
"rake db:migrate db:test:prepare",
]
Dir.chdir(tmpdir) do
env = {
'RAILS_ROOT' => tmpdir
}
setup_cmds.each do |cmd|
env = {
'RAILS_ROOT' => tmpdir
}
Open3.popen3(env, cmd) do |stdin, stdout, stderr, wait_thr|
exitstatus = wait_thr.value.exitstatus
out = stdout.read
Expand All @@ -120,26 +123,22 @@ def grade!
raise err
end
end
Open3.popen3(env, "rake saas:grade") do |stdin, stdout, stderr, wait_thr|
exitstatus = wait_thr.value.exitstatus
out = stdout.read
err = stderr.read
if exitstatus != 0
raise err
end
#"rake cucumber",
#"rake spec",
end
Open3.popen3(env, "rake saas:run_student_tests") do |stdin, stdout, stderr, wait_thr|
exitstatus = wait_thr.value.exitstatus
out = stdout.read
err = stderr.read
if exitstatus != 0
raise err
end
#"rake cucumber",
#"rake spec",
end
end

# Check coverage
end

#@raw_score, @raw_max = score.points, score.max
@raw_score = 0
@raw_max = 0

log "Total score: #{@raw_score} / #{@raw_max}"
log "Completed in #{Time.now-start_time} seconds."
dump_output
Expand Down

0 comments on commit 4128225

Please sign in to comment.