Commit 5e633c96 authored by Sanad Liaquat's avatar Sanad Liaquat Committed by Dan Davison

Use airborne only in API spec

Use rest-client elsewhere
Also, update airborne to 0.3.4
parent 8a8790ef
...@@ -7,7 +7,8 @@ gem 'capybara-screenshot', '~> 1.0.23' ...@@ -7,7 +7,8 @@ gem 'capybara-screenshot', '~> 1.0.23'
gem 'rake', '~> 12.3.0' gem 'rake', '~> 12.3.0'
gem 'rspec', '~> 3.7' gem 'rspec', '~> 3.7'
gem 'selenium-webdriver', '~> 3.12' gem 'selenium-webdriver', '~> 3.12'
gem 'airborne', '~> 0.2.13' gem 'airborne', '~> 0.3.4'
gem 'rest-client', '~> 2.1.0'
gem 'nokogiri', '~> 1.10.9' gem 'nokogiri', '~> 1.10.9'
gem 'rspec-retry', '~> 0.6.1' gem 'rspec-retry', '~> 0.6.1'
gem 'rspec_junit_formatter', '~> 0.4.1' gem 'rspec_junit_formatter', '~> 0.4.1'
......
...@@ -9,12 +9,12 @@ GEM ...@@ -9,12 +9,12 @@ GEM
zeitwerk (~> 2.2) zeitwerk (~> 2.2)
addressable (2.7.0) addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0) public_suffix (>= 2.0.2, < 5.0)
airborne (0.2.13) airborne (0.3.4)
activesupport activesupport
rack rack
rack-test (~> 0.6, >= 0.6.2) rack-test (>= 1.1.0, < 2.0)
rest-client (>= 1.7.3, < 3.0) rest-client (>= 2.0.2, < 3.0)
rspec (~> 3.1) rspec (~> 3.8)
byebug (9.1.0) byebug (9.1.0)
capybara (3.29.0) capybara (3.29.0)
addressable addressable
...@@ -34,11 +34,12 @@ GEM ...@@ -34,11 +34,12 @@ GEM
debase-ruby_core_source (>= 0.10.2) debase-ruby_core_source (>= 0.10.2)
debase-ruby_core_source (0.10.6) debase-ruby_core_source (0.10.6)
diff-lcs (1.3) diff-lcs (1.3)
domain_name (0.5.20170404) domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0) unf (>= 0.0.5, < 1.0.0)
faker (1.9.3) faker (1.9.3)
i18n (>= 0.7) i18n (>= 0.7)
gitlab-qa (4.0.0) gitlab-qa (4.0.0)
http-accept (1.7.0)
http-cookie (1.0.3) http-cookie (1.0.3)
domain_name (~> 0.5) domain_name (~> 0.5)
i18n (1.8.2) i18n (1.8.2)
...@@ -48,9 +49,9 @@ GEM ...@@ -48,9 +49,9 @@ GEM
launchy (2.4.3) launchy (2.4.3)
addressable (~> 2.3) addressable (~> 2.3)
method_source (0.9.0) method_source (0.9.0)
mime-types (3.1) mime-types (3.3.1)
mime-types-data (~> 3.2015) mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521) mime-types-data (3.2020.0425)
mini_mime (1.0.2) mini_mime (1.0.2)
mini_portile2 (2.4.0) mini_portile2 (2.4.0)
minitest (5.14.0) minitest (5.14.0)
...@@ -67,30 +68,31 @@ GEM ...@@ -67,30 +68,31 @@ GEM
byebug (~> 9.1) byebug (~> 9.1)
pry (~> 0.10) pry (~> 0.10)
public_suffix (4.0.1) public_suffix (4.0.1)
rack (2.0.7) rack (2.2.2)
rack-test (0.8.3) rack-test (1.1.0)
rack (>= 1.0, < 3) rack (>= 1.0, < 3)
rake (12.3.0) rake (12.3.0)
regexp_parser (1.6.0) regexp_parser (1.6.0)
rest-client (2.0.2) rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
http-cookie (>= 1.0.2, < 2.0) http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0) mime-types (>= 1.16, < 4.0)
netrc (~> 0.8) netrc (~> 0.8)
rspec (3.7.0) rspec (3.9.0)
rspec-core (~> 3.7.0) rspec-core (~> 3.9.0)
rspec-expectations (~> 3.7.0) rspec-expectations (~> 3.9.0)
rspec-mocks (~> 3.7.0) rspec-mocks (~> 3.9.0)
rspec-core (3.7.1) rspec-core (3.9.2)
rspec-support (~> 3.7.0) rspec-support (~> 3.9.3)
rspec-expectations (3.7.0) rspec-expectations (3.9.1)
diff-lcs (>= 1.2.0, < 2.0) diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0) rspec-support (~> 3.9.0)
rspec-mocks (3.7.0) rspec-mocks (3.9.1)
diff-lcs (>= 1.2.0, < 2.0) diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0) rspec-support (~> 3.9.0)
rspec-retry (0.6.1) rspec-retry (0.6.1)
rspec-core (> 3.3) rspec-core (> 3.3)
rspec-support (3.7.0) rspec-support (3.9.3)
rspec_junit_formatter (0.4.1) rspec_junit_formatter (0.4.1)
rspec-core (>= 2, < 4, != 2.12.0) rspec-core (>= 2, < 4, != 2.12.0)
ruby-debug-ide (0.7.2) ruby-debug-ide (0.7.2)
...@@ -101,11 +103,11 @@ GEM ...@@ -101,11 +103,11 @@ GEM
rubyzip (>= 1.2.2) rubyzip (>= 1.2.2)
thread_safe (0.3.6) thread_safe (0.3.6)
timecop (0.9.1) timecop (0.9.1)
tzinfo (1.2.6) tzinfo (1.2.7)
thread_safe (~> 0.1) thread_safe (~> 0.1)
unf (0.1.4) unf (0.1.4)
unf_ext unf_ext
unf_ext (0.0.7.4) unf_ext (0.0.7.7)
xpath (3.2.0) xpath (3.2.0)
nokogiri (~> 1.8) nokogiri (~> 1.8)
zeitwerk (2.3.0) zeitwerk (2.3.0)
...@@ -115,7 +117,7 @@ PLATFORMS ...@@ -115,7 +117,7 @@ PLATFORMS
DEPENDENCIES DEPENDENCIES
activesupport (~> 6.0.2.2) activesupport (~> 6.0.2.2)
airborne (~> 0.2.13) airborne (~> 0.3.4)
capybara (~> 3.29.0) capybara (~> 3.29.0)
capybara-screenshot (~> 1.0.23) capybara-screenshot (~> 1.0.23)
debase (~> 0.2.4.1) debase (~> 0.2.4.1)
...@@ -126,6 +128,7 @@ DEPENDENCIES ...@@ -126,6 +128,7 @@ DEPENDENCIES
parallel_tests (~> 2.29) parallel_tests (~> 2.29)
pry-byebug (~> 3.5.1) pry-byebug (~> 3.5.1)
rake (~> 12.3.0) rake (~> 12.3.0)
rest-client (~> 2.1.0)
rspec (~> 3.7) rspec (~> 3.7)
rspec-retry (~> 0.6.1) rspec-retry (~> 0.6.1)
rspec_junit_formatter (~> 0.4.1) rspec_junit_formatter (~> 0.4.1)
......
# frozen_string_literal: true # frozen_string_literal: true
require 'airborne'
module QA module QA
module Runtime module Runtime
module API module API
......
# frozen_string_literal: true # frozen_string_literal: true
require 'airborne'
module QA module QA
context 'Manage with IP rate limits', :requires_admin do context 'Manage with IP rate limits', :requires_admin do
describe 'Users API' do describe 'Users API' do
......
# frozen_string_literal: true # frozen_string_literal: true
require 'airborne'
module QA module QA
context 'Manage' do context 'Manage' do
describe 'Users API' do describe 'Users API' do
......
# frozen_string_literal: true # frozen_string_literal: true
require 'airborne'
module QA module QA
context 'Plan' do context 'Plan' do
include Support::Api include Support::Api
......
# frozen_string_literal: true # frozen_string_literal: true
require 'airborne'
require 'securerandom' require 'securerandom'
module QA module QA
......
# frozen_string_literal: true # frozen_string_literal: true
require 'airborne'
require 'securerandom' require 'securerandom'
require 'digest' require 'digest'
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
module QA module QA
context 'Plan', :orchestrated, :smtp do context 'Plan', :orchestrated, :smtp do
describe 'Email Notification' do describe 'Email Notification' do
include Support::Api
let(:user) do let(:user) do
Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1) Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1)
end end
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
module QA module QA
context 'Create', :requires_admin do context 'Create', :requires_admin do
describe 'push after setting the file size limit via admin/application_settings' do describe 'push after setting the file size limit via admin/application_settings' do
include Support::Api
before(:context) do before(:context) do
@project = Resource::Project.fabricate_via_api! do |p| @project = Resource::Project.fabricate_via_api! do |p|
p.name = 'project-test-push-limit' p.name = 'project-test-push-limit'
...@@ -39,12 +41,10 @@ module QA ...@@ -39,12 +41,10 @@ module QA
def set_file_size_limit(limit) def set_file_size_limit(limit)
request = Runtime::API::Request.new(@api_client, '/application/settings') request = Runtime::API::Request.new(@api_client, '/application/settings')
put request.url, receive_max_input_size: limit response = put request.url, receive_max_input_size: limit
expect_status(200) expect(response.code).to eq(200)
expect(json_body).to match( expect(parse_body(response)[:receive_max_input_size]).to eq(limit)
a_hash_including(receive_max_input_size: limit)
)
end end
def push_new_file(file_name, wait_for_push: true) def push_new_file(file_name, wait_for_push: true)
......
# frozen_string_literal: true # frozen_string_literal: true
require 'airborne'
module QA module QA
context 'Plan', :reliable do context 'Plan', :reliable do
describe 'Epics milestone dates API' do describe 'Epics milestone dates API' do
......
# frozen_string_literal: true # frozen_string_literal: true
require 'airborne'
require 'securerandom' require 'securerandom'
module QA module QA
......
# frozen_string_literal: true # frozen_string_literal: true
require 'airborne'
require 'securerandom' require 'securerandom'
module QA module QA
......
# frozen_string_literal: true # frozen_string_literal: true
require 'airborne'
module QA module QA
context 'Geo', :orchestrated, :geo do context 'Geo', :orchestrated, :geo do
describe 'Geo Nodes API' do describe 'Geo Nodes API' do
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
module QA module QA
context 'Geo', :orchestrated, :geo do context 'Geo', :orchestrated, :geo do
describe 'GitLab Geo project deletion replication' do describe 'GitLab Geo project deletion replication' do
include Support::Api
deleted_project_name = nil deleted_project_name = nil
deleted_project_id = nil deleted_project_id = nil
......
# frozen_string_literal: true # frozen_string_literal: true
require 'rest-client'
module QA module QA
module Support module Support
module Api module Api
......
...@@ -31,14 +31,6 @@ RSpec.configure do |c| ...@@ -31,14 +31,6 @@ RSpec.configure do |c|
config.color_mode = :off config.color_mode = :off
# Load airborne again to avoid "undefined method `match_expected_default?'" errors
# that happen because a hook calls a method added via a custom RSpec setting
# that is removed when the RSpec configuration is sandboxed.
# If this needs to be changed (e.g., to load other libraries as well), see
# this discussion for alternative solutions:
# https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/25223#note_143392053
load 'airborne.rb'
ex.run ex.run
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment