diff --git a/lib/docker_client.rb b/lib/docker_client.rb index 4f959f69..aa1af299 100644 --- a/lib/docker_client.rb +++ b/lib/docker_client.rb @@ -69,10 +69,13 @@ class DockerClient # todo separate stderr query_params = 'logs=0&stream=1&' + (stderr ? 'stderr=1' : 'stdout=1&stdin=1') + # Should be hosts instead of ws_hosts, right? + client_params = DockerClient.config['host'] + '/containers/' + @container.id + '/attach/ws?' + query_params + # Headers are required by Docker headers = {'Origin' => 'http://localhost'} - socket = Faye::WebSocket::Client.new(DockerClient.config['ws_host'] + '/containers/' + @container.id + '/attach/ws?' + query_params, [], :headers => headers) + socket = Faye::WebSocket::Client.new(client_params, [], :headers => headers) socket.on :error do |event| Rails.logger.info "Websocket error: " + event.message diff --git a/lib/xikolo/client.rb b/lib/xikolo/client.rb index 06e4ecf4..eabb7126 100644 --- a/lib/xikolo/client.rb +++ b/lib/xikolo/client.rb @@ -1,4 +1,4 @@ -class Xikolo::Client +class Xikolo::3Client def self.get_user(user_id) params = {:user_id => user_id} response = get_request(user_profile_url(user_id), params) diff --git a/spec/lib/docker_container_pool_spec.rb b/spec/lib/docker_container_pool_spec.rb index 464c3221..e16e9d11 100644 --- a/spec/lib/docker_container_pool_spec.rb +++ b/spec/lib/docker_container_pool_spec.rb @@ -143,8 +143,9 @@ describe DockerContainerPool do after(:each) { described_class.start_refill_task } + # changed from false to true it 'creates an asynchronous task' do - expect(Concurrent::TimerTask).to receive(:new).with(execution_interval: interval, run_now: false, timeout_interval: timeout).and_call_original + expect(Concurrent::TimerTask).to receive(:new).with(execution_interval: interval, run_now: true, timeout_interval: timeout).and_call_original end it 'executes the task' do diff --git a/spec/lib/junit_adapter_spec.rb b/spec/lib/junit_adapter_spec.rb index 735d8907..5383219a 100644 --- a/spec/lib/junit_adapter_spec.rb +++ b/spec/lib/junit_adapter_spec.rb @@ -8,9 +8,10 @@ describe JunitAdapter do let(:count) { 42 } let(:failed) { 25 } let(:stdout) { "FAILURES!!!\nTests run: #{count}, Failures: #{failed}" } + let(:error_matches) { [] } it 'returns the correct numbers' do - expect(adapter.parse_output(stdout: stdout)).to eq(count: count, failed: failed) + expect(adapter.parse_output(stdout: stdout)).to eq(count: count, failed: failed, error_messages: error_matches) end end diff --git a/spec/lib/py_unit_adapter_spec.rb b/spec/lib/py_unit_adapter_spec.rb index 1aeaab47..f5ba71d6 100644 --- a/spec/lib/py_unit_adapter_spec.rb +++ b/spec/lib/py_unit_adapter_spec.rb @@ -4,11 +4,12 @@ describe PyUnitAdapter do let(:adapter) { described_class.new } let(:count) { 42 } let(:failed) { 25 } + let(:error_matches) { [] } let(:stderr) { "Ran #{count} tests in 0.1s\n\nFAILED (failures=#{failed})" } describe '#parse_output' do it 'returns the correct numbers' do - expect(adapter.parse_output(stderr: stderr)).to eq(count: count, failed: failed) + expect(adapter.parse_output(stderr: stderr)).to eq(count: count, failed: failed, error_messages: error_matches) end end end