Class: Gitlab::QA::Scenario::Test::Sanity::Version

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

Overview

This test checks that the sha_version of a GitLab was authored in the window defined by the ‘weekday_hours` method. We perform a single API call to get the commit

Instance Method Summary collapse

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

perform

Instance Method Details

#perform(release = 'ce') ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/gitlab/qa/scenario/test/sanity/version.rb', line 15

def perform(release = 'ce')
  version = Component::Gitlab.perform do |gitlab|
    gitlab.release = release
    gitlab.act do
      pull
      sha_version
    end
  end

  project = "gitlab-org/#{QA::Release.new(release).api_project_name}"
  commit = api_commit_detail(project, version)

  if commit_within_hours?(commit['created_at'], weekday_hours(commit['created_at']))
    puts "Found commit #{version} in recent history of #{project}"
  else
    puts "Did not find #{version} in recent history of #{project}"
    exit 1
  end
end