Class: ManageIQ::CrossRepo::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/manageiq/cross_repo/runner.rb,
lib/manageiq/cross_repo/runner/base.rb,
lib/manageiq/cross_repo/runner/github.rb,
lib/manageiq/cross_repo/runner/travis.rb

Defined Under Namespace

Classes: Base, Github, Travis

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(test_repo:, repos:, test_suite: nil, script_cmd: nil) ⇒ Runner

Returns a new instance of Runner.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/manageiq/cross_repo/runner.rb', line 10

def initialize(test_repo:, repos:, test_suite: nil, script_cmd: nil)
  @test_repo = Repository.new(test_repo || "ManageIQ/manageiq@master")

  core_repos, @gem_repos = Array(repos).collect { |repo| Repository.new(repo) }.partition(&:core?)
  @core_repo = core_repos.first

  if @test_repo.core?
    raise ArgumentError, "You cannot pass a different core repo when running a core test" if @core_repo.present? && @core_repo != @test_repo

    @core_repo = @test_repo
  else
    @core_repo ||= Repository.new("ManageIQ/manageiq@master")
  end

  @script_cmd = script_cmd.presence
  @test_suite = test_suite.presence
end

Instance Attribute Details

#core_repoObject (readonly)

Returns the value of attribute core_repo.



8
9
10
# File 'lib/manageiq/cross_repo/runner.rb', line 8

def core_repo
  @core_repo
end

#gem_reposObject (readonly)

Returns the value of attribute gem_repos.



8
9
10
# File 'lib/manageiq/cross_repo/runner.rb', line 8

def gem_repos
  @gem_repos
end

#script_cmdObject (readonly)

Returns the value of attribute script_cmd.



8
9
10
# File 'lib/manageiq/cross_repo/runner.rb', line 8

def script_cmd
  @script_cmd
end

#test_repoObject (readonly)

Returns the value of attribute test_repo.



8
9
10
# File 'lib/manageiq/cross_repo/runner.rb', line 8

def test_repo
  @test_repo
end

#test_suiteObject (readonly)

Returns the value of attribute test_suite.



8
9
10
# File 'lib/manageiq/cross_repo/runner.rb', line 8

def test_suite
  @test_suite
end

Instance Method Details

#runObject



28
29
30
31
32
33
34
# File 'lib/manageiq/cross_repo/runner.rb', line 28

def run
  announce_run
  test_repo.ensure_clone
  core_repo.ensure_clone unless test_repo.core?
  prepare_gem_repos
  run_tests
end