Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add time and memory limit status to partial format #1790

Merged
merged 1 commit into from
Mar 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions public/schemas/partial_output.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@
"enum": [
"internal error",
"compilation error",
"memory limit exceeded",
"time limit exceeded",
"runtime error",
"wrong", "wrong answer",
"correct", "correct answer"
Expand Down
12 changes: 12 additions & 0 deletions test/runners/result_constructor_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,18 @@ class ResultConstructorTest < ActiveSupport::TestCase
'{ "command": "close-judgement", "status": { "enum": "runtime error", "human": "Runtime" } }'
])
assert_equal('runtime error', result[:status])
result = construct_result([
'{ "command": "start-judgement" }',
'{ "command": "escalate-status", "status": { "enum": "wrong", "human": "Wrong" } }',
'{ "command": "close-judgement", "status": { "enum": "memory limit exceeded", "human": "Runtime" } }'
])
assert_equal('memory limit exceeded', result[:status])
result = construct_result([
'{ "command": "start-judgement" }',
'{ "command": "escalate-status", "status": { "enum": "wrong", "human": "Wrong" } }',
'{ "command": "close-judgement", "status": { "enum": "time limit exceeded", "human": "Runtime" } }'
])
assert_equal('time limit exceeded', result[:status])
end

test 'correct permissions should be present in result' do
Expand Down