Add new file role teacher_defined_linter
This commit is contained in:
@ -376,10 +376,13 @@ class DockerClient
|
||||
"""
|
||||
Stick to existing Docker API with exec command.
|
||||
"""
|
||||
filepath = submission.collect_files.find { |f| f.name_with_extension == filename }.filepath
|
||||
file = submission.collect_files.find { |f| f.name_with_extension == filename }
|
||||
filepath = file.filepath
|
||||
command = submission.execution_environment.test_command % command_substitutions(filepath)
|
||||
create_workspace_files = proc { create_workspace_files(container, submission) }
|
||||
execute_command(command, create_workspace_files, block)
|
||||
test_result = execute_command(command, create_workspace_files, block)
|
||||
test_result.merge!(file_role: file.role)
|
||||
test_result
|
||||
end
|
||||
|
||||
def self.find_image_by_tag(tag)
|
||||
|
@ -5,9 +5,10 @@ class PyUnitAndPyLintAdapter < TestingFrameworkAdapter
|
||||
end
|
||||
|
||||
def parse_output(output)
|
||||
PyLintAdapter.new.parse_output(output)
|
||||
rescue NoMethodError
|
||||
# The regex for PyLint failed and did not return any matches
|
||||
PyUnitAdapter.new.parse_output(output)
|
||||
if output[:file_role] == 'teacher_defined_linter'
|
||||
PyLintAdapter.new.parse_output(output)
|
||||
else
|
||||
PyUnitAdapter.new.parse_output(output)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user