clean pull request
This commit is contained in:
15
.travis.yml
15
.travis.yml
@ -2,7 +2,6 @@ sudo: required
|
||||
|
||||
services:
|
||||
- docker
|
||||
# https://docs.travis-ci.com/user/docker/
|
||||
|
||||
addons:
|
||||
code_climate:
|
||||
@ -11,21 +10,14 @@ addons:
|
||||
before_install:
|
||||
- export DISPLAY=:99.0
|
||||
- sh -e /etc/init.d/xvfb start
|
||||
- echo 'DOCKER_OPTS="-H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock --iptables=false"' | sudo tee /etc/default/docker > /dev/null
|
||||
#- export DOCKER_HOST=tcp://192.168.23.75:2375
|
||||
- sudo service docker restart
|
||||
- sleep 5
|
||||
#- docker pull openhpi/docker_java
|
||||
- docker pull openhpi/docker_ruby
|
||||
# - docker pull openhpi/docker_python
|
||||
|
||||
#before_install:
|
||||
# Config to run docker tests - doesn't work so far
|
||||
# - sudo apt-get update
|
||||
# - sudo apt-get upgrade lxc-docker
|
||||
# - echo 'DOCKER_OPTS="-H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock --iptables=false"' | sudo tee /etc/default/docker > /dev/null
|
||||
# - export DOCKER_HOST=tcp://192.168.23.75:2375
|
||||
# - sudo service docker restart
|
||||
# - sleep 5
|
||||
#- sudo docker pull weldpua2008/docker-ansible:${OS_TYPE}${OS_VERSION}_v${ANSIBLE_VERSION}
|
||||
# - docker pull openhpi/docker_ruby
|
||||
|
||||
before_script:
|
||||
- cp .rspec.travis .rspec
|
||||
@ -44,6 +36,7 @@ rvm:
|
||||
# - 2.2.1
|
||||
|
||||
script: bundle exec rspec --color --format documentation --require spec_helper --require rails_helper --tag ~docker
|
||||
# one of the solutions I've found
|
||||
# - sudo docker run --rm=true -v `pwd`:/ansible-apache:rw weldpua2008/docker-ansible:${OS_TYPE}${OS_VERSION}_v${ANSIBLE_VERSION} /bin/bash -c "/ansible-apache/tests/test-in-docker-image.sh ${OS_TYPE} ${OS_VERSION} ${ANSIBLE_VERSION}"
|
||||
|
||||
|
||||
|
@ -48,7 +48,6 @@ class ExecutionEnvironment < ActiveRecord::Base
|
||||
def working_docker_image?
|
||||
DockerClient.pull(docker_image) unless DockerClient.image_tags.include?(docker_image)
|
||||
output = DockerClient.new(execution_environment: self).execute_arbitrary_command(VALIDATION_COMMAND)
|
||||
|
||||
errors.add(:docker_image, "error: #{output[:stderr]}") if output[:stderr].present?
|
||||
rescue DockerClient::Error => error
|
||||
errors.add(:docker_image, "error: #{error}")
|
||||
|
@ -52,4 +52,3 @@ test:
|
||||
<<: *default
|
||||
host: tcp://192.168.59.104:2376
|
||||
workspace_root: <%= File.join('/', 'shared', Rails.env) %>
|
||||
#probably need to add some additional configuration here
|
||||
|
@ -18,7 +18,6 @@ describe SubmissionsController do
|
||||
expect_assigns(submission: Submission)
|
||||
|
||||
it 'creates the submission' do
|
||||
# pending("need to implement other pendings first")
|
||||
expect { request.call }.to change(Submission, :count).by(1)
|
||||
end
|
||||
|
||||
@ -189,7 +188,6 @@ describe SubmissionsController do
|
||||
end
|
||||
|
||||
describe 'GET #score' do
|
||||
|
||||
let(:request) { proc { get :score, id: submission.id } }
|
||||
before(:each) { request.call }
|
||||
|
||||
|
@ -13,7 +13,6 @@ describe 'Editor', js: true do
|
||||
end
|
||||
|
||||
it 'displays the exercise title' do
|
||||
# pending("no exercise title set")
|
||||
expect(page).to have_content(exercise.title)
|
||||
end
|
||||
|
||||
@ -80,7 +79,6 @@ describe 'Editor', js: true do
|
||||
let(:file) { exercise.files.detect { |file| !file.file_type.binary? } }
|
||||
|
||||
it "displays the file's code" do
|
||||
pending("need to make travis working again")
|
||||
expect(page).to have_css(".frame[data-filename='#{file.name_with_extension}']")
|
||||
end
|
||||
end
|
||||
|
@ -7,10 +7,8 @@ describe DockerClient, docker: true do
|
||||
let(:execution_environment) { FactoryGirl.build(:ruby) }
|
||||
let(:image) { double }
|
||||
let(:submission) { FactoryGirl.create(:submission) }
|
||||
# let(:workspace_path) { '/tmp/codeocean_dockertest' }
|
||||
let(:workspace_path) { '/tmp' }
|
||||
|
||||
|
||||
describe '.check_availability!' do
|
||||
context 'when a socket error occurs' do
|
||||
it 'raises an error' do
|
||||
|
@ -44,8 +44,6 @@ describe DockerContainerPool do
|
||||
|
||||
it 'takes a container from the pool' do
|
||||
expect(described_class).not_to receive(:create_container).with(@execution_environment)
|
||||
# #<Double (anonymous)> received unexpected message :json with (no args)
|
||||
# expect(described_class).to receive(:json).with()
|
||||
expect(described_class.get_container(@execution_environment)).to eq(container)
|
||||
end
|
||||
end
|
||||
@ -62,7 +60,6 @@ describe DockerContainerPool do
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
context 'when inactive' do
|
||||
before(:each) do
|
||||
expect(described_class).to receive(:config).and_return(active: false)
|
||||
|
@ -21,7 +21,6 @@ describe ExecutionEnvironmentPolicy do
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
[:execute_command?, :shell?, :statistics?].each do |action|
|
||||
permissions(action) do
|
||||
it 'grants access to admins' do
|
||||
|
Reference in New Issue
Block a user