Skip to content

Commit 63796bd

Browse files
iHiDclaude
andcommitted
Guard against nil execution_output in TestRun::Process
Fixes NoMethodError when tooling_job.execution_output is nil (e.g. ops error with no output). Matches the existing guard in Analysis::Process and Representation::Process added in PR #6696. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent de03a3e commit 63796bd

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

app/commands/submission/test_run/process.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ def broadcast!(test_run)
112112

113113
memoize
114114
def results
115+
return {} if tooling_job.execution_output.nil?
116+
115117
res = JSON.parse(tooling_job.execution_output['results.json'], allow_invalid_unicode: true)
116118
res.is_a?(Hash) ? res.symbolize_keys : {}
117119
rescue StandardError => e

test/commands/submission/test_run/process_test.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ class Submission::TestRun::ProcessTest < ActiveSupport::TestCase
4343
assert submission.reload.tests_exceptioned?
4444
end
4545

46+
test "handle ops error with no execution output" do
47+
submission = create :submission
48+
job = create_test_runner_job!(submission, execution_status: 500)
49+
50+
Submission::TestRun::Process.(job)
51+
52+
assert submission.reload.tests_exceptioned?
53+
end
54+
4655
test "handle tests pass" do
4756
submission = create :submission
4857
results = { 'status' => 'pass', 'message' => "", 'tests' => [] }

0 commit comments

Comments
 (0)