Class: Gitlab::QA::Scenario::Test::Omnibus::UpdateFromPrevious

Inherits:
Gitlab::QA::Scenario::Template show all
Defined in:
lib/gitlab/qa/scenario/test/omnibus/update_from_previous.rb

Direct Known Subclasses

UpdateFromPreviousAi

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Gitlab::QA::Scenario::Template

perform

Instance Attribute Details

#rspec_argsObject (readonly)

Returns the value of attribute rspec_args.



11
12
13
# File 'lib/gitlab/qa/scenario/test/omnibus/update_from_previous.rb', line 11

def rspec_args
  @rspec_args
end

Instance Method Details

#perform(release, current_version, semver_component, from_edition = nil, *rspec_args) ⇒ void

This method returns an undefined value.

Test update from N - 1 (major|minor|patch) version to current release Run health check (or smoke if below 17.1.0) test suite on previous release to populate some data in database before update

perform(gitlab-ee:dev-tag, 15.3.0-pre, major)

> will perform upgrades 14.9.5 -> 15.0.5 -> gitlab-ee:dev-tag

Parameters:

  • release (String)

    current release docker image

  • current_version (String)

    current gitlab version associated with docker image

  • semver_component (String)

    semver component for N - 1 version detection, major|minor|patch

  • from_edition (String) (defaults to: nil)

    gitlab edition to update from

  • *rspec_args (Array)

    rspec arguments



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/gitlab/qa/scenario/test/omnibus/update_from_previous.rb', line 26

def perform(release, current_version, semver_component, from_edition = nil, *rspec_args)
  # When from_edition isn't actually passed but RSpec args arg passed with `-- rspec_args...`,
  # from_edition is wrongly set to `--`, so we fix that here.

  if from_edition == "--"
    rspec_args.prepend('--')
    from_edition = nil
  end

  @current_release = QA::Release.new(release)
  @upgrade_path = Support::GitlabUpgradePath.new(
    current_version,
    semver_component,
    from_edition || @current_release.edition
  ).fetch
  @rspec_args = rspec_args

  upgrade_info = "#{[*upgrade_path, current_release].join(' => ')} (#{current_version})".bright
  Runtime::Logger.info("Performing gitlab update: #{upgrade_info}")

  update(rspec_args)
end

#pre_seeding_environment_actions(gitlab) ⇒ Object

this is any action or event that may happen before the seeding suite is run



59
# File 'lib/gitlab/qa/scenario/test/omnibus/update_from_previous.rb', line 59

def pre_seeding_environment_actions(gitlab); end

#seeding_suite_argsObject



49
50
51
52
53
54
55
56
# File 'lib/gitlab/qa/scenario/test/omnibus/update_from_previous.rb', line 49

def seeding_suite_args
  first_release_version = extract_version(upgrade_path.first.release)
  if Gem::Version.new(first_release_version) < Gem::Version.new("17.1.0")
    ["--", "--tag", "smoke"]
  else
    ["--", "--tag", "health_check"]
  end
end