gitlab-qa 8.10.2 → 8.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitlab/ci/jobs/integrations.gitlab-ci.yml +5 -5
- data/Gemfile.lock +1 -1
- data/docs/omnibus_configurations/license_mode.md +11 -0
- data/docs/what_tests_can_be_run.md +2 -2
- data/lib/gitlab/qa/component/base.rb +4 -0
- data/lib/gitlab/qa/component/mock_server.rb +21 -0
- data/lib/gitlab/qa/runtime/omnibus_configurations/decomposition_multiple_db.rb +14 -4
- data/lib/gitlab/qa/runtime/omnibus_configurations/license_mode.rb +8 -1
- data/lib/gitlab/qa/scenario/test/integration/import.rb +88 -0
- data/lib/gitlab/qa/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bee7c1ce41e9ceeeb14546a8983a5c3f90b3da4f6a3f32505bc77c08f0e484a9
|
4
|
+
data.tar.gz: dd74a1afa61040fc2110c0f3f63a381f8b1da4f07fb82b4629cdc979378ec67d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d22ff4d7fa0452bac353fcd80a68f8c2bd1598f0515483c4f0a749c6ab3f225bd4d763cf17ce21f7c1a446530d254ace11a2a5c5d6a581e985572c58ce07da80
|
7
|
+
data.tar.gz: b0fe8a3cfbefcd39f971eab382171df61691d920303f8f89ab4b3a04bcb5b7ac4ff4586bb08196dbe7f1ba2f0e98ea8ce1deca4822407d22b80891e6dc306eaf
|
@@ -1,14 +1,14 @@
|
|
1
|
-
|
1
|
+
ee:integrations:
|
2
2
|
extends:
|
3
|
-
- .rules:
|
3
|
+
- .rules:ee-never-when-triggered-by-feature-flag-definition-change
|
4
4
|
- .test
|
5
5
|
- .high-capacity
|
6
|
-
- .
|
6
|
+
- .ee-variables
|
7
7
|
- .rspec-report-opts
|
8
8
|
variables:
|
9
9
|
QA_SCENARIO: "Test::Integration::Integrations"
|
10
10
|
|
11
|
-
|
11
|
+
ee:integrations-quarantine:
|
12
12
|
extends:
|
13
|
-
-
|
13
|
+
- ee:integrations
|
14
14
|
- .quarantine
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,11 @@
|
|
1
|
+
# License Mode Omnibus Configuration
|
2
|
+
|
3
|
+
This configuration is used to set the License Mode in GitLab to test.
|
4
|
+
|
5
|
+
When GitLab's License Mode is set to test, GitLab will not enforce License Key encryption to activate an instance
|
6
|
+
with an Enterprise License
|
7
|
+
|
8
|
+
## What happens?
|
9
|
+
|
10
|
+
GitLab-QA will set the environment variable `GITLAB_LICENSE_MODE=test` and set the `CUSTOMER_PORTAL_URL=<URL>` where URL
|
11
|
+
is `ENV['CUSTOMER_PORTAL_URL']` or CDot Staging (`https://customers.staging.gitlab.com`).
|
@@ -670,7 +670,7 @@ $ export EE_LICENSE=$(cat /path/to/GitLab.gitlab_license)
|
|
670
670
|
$ gitlab-qa Test::Integration::Jira EE
|
671
671
|
```
|
672
672
|
|
673
|
-
### `Test::Integration::Integrations CE|<full image address>`
|
673
|
+
### `Test::Integration::Integrations CE|EE|<full image address>`
|
674
674
|
|
675
675
|
This scenario is intended to test the different integrations that a GitLab instance can offer, such as WebHooks to an external service, Jenkins, etc.
|
676
676
|
|
@@ -681,7 +681,7 @@ container is spun up and tests are run from it by running the
|
|
681
681
|
Example:
|
682
682
|
|
683
683
|
```
|
684
|
-
$ gitlab-qa Test::Integration::Integrations
|
684
|
+
$ gitlab-qa Test::Integration::Integrations EE
|
685
685
|
```
|
686
686
|
|
687
687
|
### `Test::Instance::Any CE|EE|<full image address>:nightly|latest|any_tag http://your.instance.gitlab`
|
@@ -43,6 +43,10 @@ module Gitlab
|
|
43
43
|
raise NotImplementedError, "#{self.class.name} must specify a docker image tag as DOCKER_IMAGE_TAG"
|
44
44
|
end
|
45
45
|
|
46
|
+
def start_instance
|
47
|
+
instance_no_teardown
|
48
|
+
end
|
49
|
+
|
46
50
|
def instance(skip_teardown: false)
|
47
51
|
instance_no_teardown do
|
48
52
|
yield self if block_given?
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Gitlab
|
4
|
+
module QA
|
5
|
+
module Component
|
6
|
+
class MockServer < Base
|
7
|
+
DOCKER_IMAGE = "thiht/smocker"
|
8
|
+
DOCKER_IMAGE_TAG = "0.18.2"
|
9
|
+
|
10
|
+
def initialize
|
11
|
+
super
|
12
|
+
|
13
|
+
@ports = %w[8080 8081]
|
14
|
+
@name = "smocker-server"
|
15
|
+
end
|
16
|
+
|
17
|
+
attr_reader :name
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -5,6 +5,14 @@ module Gitlab
|
|
5
5
|
module Runtime
|
6
6
|
module OmnibusConfigurations
|
7
7
|
class DecompositionMultipleDb < Default
|
8
|
+
DATABASE_EXISTENCE_CHECK_COMMAND = <<~CMD.chomp
|
9
|
+
gitlab-psql -d gitlabhq_production_ci -c 'select 1' 2>1 > /dev/null
|
10
|
+
CMD
|
11
|
+
|
12
|
+
SCHEMA_EXISTENCE_CHECK_COMMAND = <<~CMD.chomp
|
13
|
+
gitlab-psql -d gitlabhq_production_ci -c "select schema_name from information_schema.schemata where schema_name = 'gitlab_partitions_dynamic'" | grep -q gitlab_partitions_dynamic
|
14
|
+
CMD
|
15
|
+
|
8
16
|
def configuration
|
9
17
|
# HACK: commenting commands out as these commands should be run *after* the first
|
10
18
|
# reconfiguration (see first command in #exec_commands)
|
@@ -19,10 +27,12 @@ module Gitlab
|
|
19
27
|
[
|
20
28
|
"sed -i 's/#gitlab_rails/gitlab_rails/g' /etc/gitlab/gitlab.rb",
|
21
29
|
"gitlab-ctl reconfigure",
|
22
|
-
|
23
|
-
"gitlab-psql -
|
24
|
-
"gitlab-psql -d gitlabhq_production_ci -c 'create extension
|
25
|
-
"gitlab-
|
30
|
+
# Create database only if it does not exist.
|
31
|
+
"#{DATABASE_EXISTENCE_CHECK_COMMAND} || gitlab-psql -c 'create database gitlabhq_production_ci owner gitlab'",
|
32
|
+
"gitlab-psql -d gitlabhq_production_ci -c 'create extension if not exists btree_gist'",
|
33
|
+
"gitlab-psql -d gitlabhq_production_ci -c 'create extension if not exists pg_trgm'",
|
34
|
+
# Load schema only if it does not exist.
|
35
|
+
"#{SCHEMA_EXISTENCE_CHECK_COMMAND} || gitlab-rake db:structure:load:ci",
|
26
36
|
"gitlab-ctl restart"
|
27
37
|
].freeze
|
28
38
|
end
|
@@ -7,9 +7,16 @@ module Gitlab
|
|
7
7
|
class LicenseMode < Default
|
8
8
|
def configuration
|
9
9
|
<<~OMNIBUS
|
10
|
-
gitlab_rails['env'] = { 'GITLAB_LICENSE_MODE' => 'test', 'CUSTOMER_PORTAL_URL' => '
|
10
|
+
gitlab_rails['env'] = { 'GITLAB_LICENSE_MODE' => 'test', 'CUSTOMER_PORTAL_URL' => '#{customer_portal_url}' }
|
11
11
|
OMNIBUS
|
12
12
|
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
# Customer Portal URL that is targeted
|
17
|
+
def customer_portal_url
|
18
|
+
ENV.fetch('CUSTOMER_PORTAL_URL', 'https://customers.staging.gitlab.com')
|
19
|
+
end
|
13
20
|
end
|
14
21
|
end
|
15
22
|
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "parallel"
|
4
|
+
|
5
|
+
module Gitlab
|
6
|
+
module QA
|
7
|
+
module Scenario
|
8
|
+
module Test
|
9
|
+
module Integration
|
10
|
+
# Scenario type for testing importers
|
11
|
+
#
|
12
|
+
# In addition to main gitlab instance, starts another gitlab instance to act as source
|
13
|
+
# and mock server to replace all other possible import sources
|
14
|
+
#
|
15
|
+
class Import < Scenario::Template
|
16
|
+
def initialize
|
17
|
+
@source_gitlab = Component::Gitlab.new
|
18
|
+
@target_gitlab = Component::Gitlab.new
|
19
|
+
@mock_server = Component::MockServer.new
|
20
|
+
@network = "test"
|
21
|
+
end
|
22
|
+
|
23
|
+
attr_reader :source_gitlab, :target_gitlab, :mock_server, :network
|
24
|
+
|
25
|
+
def perform(release, *rspec_args)
|
26
|
+
start_mock_server
|
27
|
+
start_gitlab_instances(release)
|
28
|
+
|
29
|
+
run_specs(rspec_args)
|
30
|
+
ensure
|
31
|
+
mock_server.teardown
|
32
|
+
target_gitlab.teardown
|
33
|
+
source_gitlab.teardown
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
# Start mock server instance
|
39
|
+
#
|
40
|
+
# @return [void]
|
41
|
+
def start_mock_server
|
42
|
+
mock_server.tap do |server|
|
43
|
+
server.network = network
|
44
|
+
|
45
|
+
server.start_instance
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
# Start gitlab instance
|
50
|
+
#
|
51
|
+
# @param [Gitlab::QA::Release] release
|
52
|
+
# @return [void]
|
53
|
+
def start_gitlab_instances(release)
|
54
|
+
instances = [
|
55
|
+
{ instance: source_gitlab, name: "import-source" },
|
56
|
+
{ instance: target_gitlab, name: "import-target" }
|
57
|
+
]
|
58
|
+
::Parallel.each(instances, in_threads: 2) do |gitlab_instance|
|
59
|
+
gitlab_instance[:instance].tap do |gitlab|
|
60
|
+
gitlab.name = gitlab_instance[:name]
|
61
|
+
gitlab.network = network
|
62
|
+
gitlab.release = release
|
63
|
+
gitlab.seed_admin_token = true
|
64
|
+
|
65
|
+
gitlab.start_instance
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
# Run tests
|
71
|
+
#
|
72
|
+
# @param [Array] rspec_args
|
73
|
+
# @return [void]
|
74
|
+
def run_specs(rspec_args)
|
75
|
+
Component::Specs.perform do |specs|
|
76
|
+
specs.suite = "Test::Integration::Import"
|
77
|
+
specs.release = target_gitlab.release
|
78
|
+
specs.network = network
|
79
|
+
specs.env = { "QA_IMPORT_SOURCE_URL" => source_gitlab.address, "QA_ALLOW_LOCAL_REQUESTS" => "true" }
|
80
|
+
specs.args = [target_gitlab.address, *rspec_args]
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
data/lib/gitlab/qa/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab-qa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.
|
4
|
+
version: 8.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitLab Quality
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-11-
|
11
|
+
date: 2022-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: climate_control
|
@@ -310,6 +310,7 @@ files:
|
|
310
310
|
- docs/architecture.md
|
311
311
|
- docs/configuring_omnibus.md
|
312
312
|
- docs/how_it_works.md
|
313
|
+
- docs/omnibus_configurations/license_mode.md
|
313
314
|
- docs/release_process.md
|
314
315
|
- docs/run_qa_against_gdk.md
|
315
316
|
- docs/running_against_remote_grid.md
|
@@ -332,6 +333,7 @@ files:
|
|
332
333
|
- lib/gitlab/qa/component/ldap.rb
|
333
334
|
- lib/gitlab/qa/component/mail_hog.rb
|
334
335
|
- lib/gitlab/qa/component/minio.rb
|
336
|
+
- lib/gitlab/qa/component/mock_server.rb
|
335
337
|
- lib/gitlab/qa/component/opensearch.rb
|
336
338
|
- lib/gitlab/qa/component/postgresql.rb
|
337
339
|
- lib/gitlab/qa/component/preprod.rb
|
@@ -405,6 +407,7 @@ files:
|
|
405
407
|
- lib/gitlab/qa/scenario/test/integration/gitaly_cluster.rb
|
406
408
|
- lib/gitlab/qa/scenario/test/integration/gitlab_pages.rb
|
407
409
|
- lib/gitlab/qa/scenario/test/integration/group_saml.rb
|
410
|
+
- lib/gitlab/qa/scenario/test/integration/import.rb
|
408
411
|
- lib/gitlab/qa/scenario/test/integration/instance_saml.rb
|
409
412
|
- lib/gitlab/qa/scenario/test/integration/integrations.rb
|
410
413
|
- lib/gitlab/qa/scenario/test/integration/jira.rb
|