Introduce strategy for runner behavior
The runner model is only a class responsible for storing information now. Based on the configuration it picks a strategy for the runner management. The Poseidon strategy is already implemented and tested. The Docker strategy will follow.
This commit is contained in:

committed by
Sebastian Serth

parent
cf58be97ee
commit
d0d1b1bffd
15
spec/lib/runner/strategy/docker_spec.rb
Normal file
15
spec/lib/runner/strategy/docker_spec.rb
Normal file
@ -0,0 +1,15 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
describe Runner::Strategy::Docker do
|
||||
let(:runner_id) { FactoryBot.attributes_for(:runner)[:runner_id] }
|
||||
let(:execution_environment) { FactoryBot.create :ruby }
|
||||
let(:docker) { described_class.new(runner_id, execution_environment) }
|
||||
|
||||
# TODO: add tests for these methods when implemented
|
||||
it 'defines all methods all runner management strategies must define' do
|
||||
expect(docker.public_methods).to include(*Runner::DELEGATED_STRATEGY_METHODS)
|
||||
expect(described_class.public_methods).to include(:request_from_management)
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user