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