Added some roadmap
This commit is contained in:
@ -5,7 +5,7 @@ class Assessor
|
||||
test_outcome = @testing_framework_adapter.test_outcome(output)
|
||||
test_outcome.merge(score: calculate_score(test_outcome))
|
||||
rescue
|
||||
{score: 0.0}
|
||||
{score: 0}
|
||||
end
|
||||
|
||||
def calculate_score(test_outcome)
|
||||
|
@ -83,7 +83,10 @@ class DockerClient
|
||||
Rails.logger.info('destroying container ' + container.to_s)
|
||||
container.stop.kill
|
||||
container.port_bindings.values.each { |port| PortPool.release(port) }
|
||||
Pathname.new(local_workspace_path).children.each{ |p| p.rmtree} if local_workspace_path(container)
|
||||
local_workspace_path = local_workspace_path(container)
|
||||
if local_workspace_path && Pathname.new(local_workspace_path).exist?
|
||||
Pathname.new(local_workspace_path).children.each{ |p| p.rmtree}
|
||||
end
|
||||
container.delete(force: true)
|
||||
end
|
||||
|
||||
@ -94,9 +97,9 @@ class DockerClient
|
||||
def execute_command(command, before_execution_block, output_consuming_block)
|
||||
#tries ||= 0
|
||||
@container = DockerContainerPool.get_container(@execution_environment)
|
||||
#clear directory (it should be emtpy anyhow)
|
||||
Pathname.new(local_workspace_path).children.each{ |p| p.rmtree}
|
||||
if @container
|
||||
#clear directory (it should be emtpy anyhow)
|
||||
Pathname.new(self.class.local_workspace_path(@container)).children.each{ |p| p.rmtree}
|
||||
before_execution_block.try(:call)
|
||||
send_command(command, @container, &output_consuming_block)
|
||||
else
|
||||
@ -202,6 +205,5 @@ class DockerClient
|
||||
end
|
||||
private :send_command
|
||||
|
||||
|
||||
class Error < RuntimeError; end
|
||||
end
|
||||
|
@ -42,7 +42,7 @@ class DockerContainerPool
|
||||
|
||||
def self.return_container(container, execution_environment)
|
||||
container.status = 'available'
|
||||
unless(@containers[execution_environment.id].include?(container))
|
||||
if(@containers[execution_environment.id] && !@containers[execution_environment.id].include?(container))
|
||||
@containers[execution_environment.id].push(container)
|
||||
else
|
||||
Rails.logger.info('trying to return existing container ' + container.to_s)
|
||||
|
@ -112,6 +112,7 @@ describe DockerClient, docker: true do
|
||||
end
|
||||
|
||||
it 'raises the error' do
|
||||
pending('RETRY COUNT is disabled')
|
||||
expect { create_container }.to raise_error(error)
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user