added the ability to limit memory consumption of code submissions executed using Docker

This commit is contained in:
Hauke Klement
2015-03-17 11:35:25 +01:00
parent 640122fff2
commit b1218e0b80
12 changed files with 102 additions and 10 deletions

View File

@ -13,6 +13,21 @@ describe ExecutionEnvironment do
expect(execution_environment.errors[:docker_image]).to be_present
end
it 'validates the minimum value of the memory limit' do
execution_environment.update(memory_limit: DockerClient::MINIMUM_MEMORY_LIMIT / 2)
expect(execution_environment.errors[:memory_limit]).to be_present
end
it 'validates the numericality of the memory limit' do
execution_environment.update(memory_limit: Math::PI)
expect(execution_environment.errors[:memory_limit]).to be_present
end
it 'validates the presence of a memory limit' do
execution_environment.update(memory_limit: nil)
expect(execution_environment.errors[:memory_limit]).to be_present
end
it 'validates the presence of a name' do
expect(execution_environment.errors[:name]).to be_present
end