gitlab-qa 8.7.0 → 8.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitlab/ci/jobs/chaos.gitlab-ci.yml +22 -0
- data/.gitlab/ci/jobs/gitlab_pages.gitlab-ci.yml +19 -0
- data/.gitlab/ci/jobs/sanity_framework.gitlab-ci.yml +2 -2
- data/.gitlab-ci.yml +1 -0
- data/Gemfile.lock +5 -3
- data/bin/expect_exit_code_and_text +1 -1
- data/docs/release_process.md +4 -0
- data/docs/what_tests_can_be_run.md +43 -0
- data/gitlab-qa.gemspec +3 -2
- data/lib/gitlab/qa/component/base.rb +4 -0
- data/lib/gitlab/qa/component/chaos.rb +79 -0
- data/lib/gitlab/qa/component/specs.rb +6 -3
- data/lib/gitlab/qa/scenario/test/integration/chaos.rb +39 -0
- data/lib/gitlab/qa/scenario/test/integration/gitaly_cluster.rb +44 -24
- data/lib/gitlab/qa/scenario/test/integration/gitlab_pages.rb +58 -0
- data/lib/gitlab/qa/scenario/test/integration/praefect.rb +5 -5
- data/lib/gitlab/qa/version.rb +1 -1
- data/scripts/generate-qa-jobs.rb +2 -0
- metadata +40 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0ffa49a5a85a5e660bb61689d01b0a7daa3a0004f7e05e5a9100dd83dbeeea55
|
|
4
|
+
data.tar.gz: 8f158219d4c59b3db6181534eafdd55e5ca2abbcae1a0402c4f80d3f8c77fa82
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7cb6f4b7197625d3db353048368716a80e7bdf17e7060cfaadf90a13d44c96805c76e396b3fa78a6e777dacad191305c12ec78e8c9e8920d3a09100f7d2ebd56
|
|
7
|
+
data.tar.gz: cfec5285a2a0d54986d3984f333497082911febee8d3a368dc2be3f81d04753e2c8a726bd8515d1be62181a591077eb4c47555865e1fc331ace507289adc47a3
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
ee:chaos:
|
|
2
|
+
extends:
|
|
3
|
+
- .rules:ee-never-when-triggered-by-feature-flag-definition-change
|
|
4
|
+
- .test
|
|
5
|
+
- .high-capacity
|
|
6
|
+
- .ee-variables
|
|
7
|
+
- .rspec-report-opts
|
|
8
|
+
variables:
|
|
9
|
+
QA_SCENARIO: "Test::Integration::Chaos"
|
|
10
|
+
QA_RSPEC_TAGS: "--tag chaos"
|
|
11
|
+
|
|
12
|
+
ee:chaos-quarantine:
|
|
13
|
+
extends:
|
|
14
|
+
- .rules:ee-never-when-triggered-by-feature-flag-definition-change
|
|
15
|
+
- .test
|
|
16
|
+
- .high-capacity
|
|
17
|
+
- .ee-variables
|
|
18
|
+
- .quarantine
|
|
19
|
+
- .rspec-report-opts
|
|
20
|
+
variables:
|
|
21
|
+
QA_SCENARIO: "Test::Integration::Chaos"
|
|
22
|
+
QA_RSPEC_TAGS: "--tag quarantine --tag chaos"
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
ce:gitlab_pages:
|
|
2
|
+
extends:
|
|
3
|
+
- .rules:ce-never-when-triggered-by-feature-flag-definition-change
|
|
4
|
+
- .test
|
|
5
|
+
- .high-capacity
|
|
6
|
+
- .ce-variables
|
|
7
|
+
- .rspec-report-opts
|
|
8
|
+
variables:
|
|
9
|
+
QA_SCENARIO: "Test::Integration::GitlabPages"
|
|
10
|
+
|
|
11
|
+
ee:gitlab_pages:
|
|
12
|
+
extends:
|
|
13
|
+
- .rules:ee-never-when-triggered-by-feature-flag-definition-change
|
|
14
|
+
- .test
|
|
15
|
+
- .high-capacity
|
|
16
|
+
- .ee-variables
|
|
17
|
+
- .rspec-report-opts
|
|
18
|
+
variables:
|
|
19
|
+
QA_SCENARIO: "Test::Integration::GitlabPages"
|
|
@@ -4,7 +4,7 @@ ce:sanity-framework:
|
|
|
4
4
|
QA_GENERATE_ALLURE_REPORT: "false"
|
|
5
5
|
QA_EXPORT_TEST_METRICS: "false"
|
|
6
6
|
script:
|
|
7
|
-
- ./bin/expect_exit_code_and_text "bundle exec exe/gitlab-qa Test::Instance::Image ${RELEASE:=CE} -- --tag framework" 1 "
|
|
7
|
+
- ./bin/expect_exit_code_and_text "bundle exec exe/gitlab-qa Test::Instance::Image ${RELEASE:=CE} -- --tag framework" 1 "1 failure"
|
|
8
8
|
extends:
|
|
9
9
|
- .rules:ce-never-when-triggered-by-feature-flag-definition-change
|
|
10
10
|
- .test
|
|
@@ -16,7 +16,7 @@ ee:sanity-framework:
|
|
|
16
16
|
QA_GENERATE_ALLURE_REPORT: "false"
|
|
17
17
|
QA_EXPORT_TEST_METRICS: "false"
|
|
18
18
|
script:
|
|
19
|
-
- ./bin/expect_exit_code_and_text "bundle exec exe/gitlab-qa Test::Instance::Image ${RELEASE:=EE} -- --tag framework" 1 "
|
|
19
|
+
- ./bin/expect_exit_code_and_text "bundle exec exe/gitlab-qa Test::Instance::Image ${RELEASE:=EE} -- --tag framework" 1 "1 failure"
|
|
20
20
|
extends:
|
|
21
21
|
- .rules:ee-never-when-triggered-by-feature-flag-definition-change
|
|
22
22
|
- .test
|
data/.gitlab-ci.yml
CHANGED
|
@@ -100,6 +100,7 @@ generate-jobs:
|
|
|
100
100
|
- bundle exec bin/qa Test::Instance::All http://dummy.test --count-examples-only -- $QA_TESTS --tag repository_storage
|
|
101
101
|
- bundle exec bin/qa Test::Instance::All http://dummy.test --count-examples-only -- $QA_TESTS --tag packages
|
|
102
102
|
- bundle exec bin/qa Test::Instance::All http://dummy.test --count-examples-only -- $QA_TESTS --tag integrations
|
|
103
|
+
- bundle exec bin/qa Test::Instance::All http://dummy.test --count-examples-only -- $QA_TESTS --tag gitlab_pages
|
|
103
104
|
- bundle exec bin/qa Test::Instance::All http://dummy.test --count-examples-only -- $QA_TESTS --tag mtls
|
|
104
105
|
- bundle exec bin/qa Test::Instance::All http://dummy.test --count-examples-only -- $QA_TESTS --tag jira
|
|
105
106
|
- bundle exec bin/qa Test::Instance::All http://dummy.test --count-examples-only -- $QA_TESTS --tag can_use_large_setup
|
data/Gemfile.lock
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
gitlab-qa (8.
|
|
4
|
+
gitlab-qa (8.9.0)
|
|
5
5
|
activesupport (~> 6.1)
|
|
6
6
|
gitlab (~> 4.18.0)
|
|
7
7
|
http (~> 5.0)
|
|
8
8
|
nokogiri (~> 1.10)
|
|
9
|
-
rainbow (
|
|
9
|
+
rainbow (>= 3, < 4)
|
|
10
10
|
table_print (= 1.5.7)
|
|
11
|
-
|
|
11
|
+
toxiproxy (~> 2.0.2)
|
|
12
|
+
zeitwerk (>= 2, < 3)
|
|
12
13
|
|
|
13
14
|
GEM
|
|
14
15
|
remote: https://rubygems.org/
|
|
@@ -216,6 +217,7 @@ GEM
|
|
|
216
217
|
unicode-display_width (>= 1.1.1, < 3)
|
|
217
218
|
thor (1.2.1)
|
|
218
219
|
tilt (2.0.11)
|
|
220
|
+
toxiproxy (2.0.2)
|
|
219
221
|
tzinfo (2.0.5)
|
|
220
222
|
concurrent-ruby (~> 1.0)
|
|
221
223
|
unf (0.1.4)
|
|
@@ -26,7 +26,7 @@ else
|
|
|
26
26
|
if [ "$?" -eq "0" ]; then
|
|
27
27
|
echo "'$SCRIPT' outputted '$EXPECTED_TEXT', as expected!"
|
|
28
28
|
else
|
|
29
|
-
echo "'$SCRIPT' was expected to output '$EXPECTED_TEXT', but did not!"
|
|
29
|
+
echo "'$SCRIPT' was expected to match output '$EXPECTED_TEXT', but did not!"
|
|
30
30
|
exit 1
|
|
31
31
|
fi
|
|
32
32
|
else
|
data/docs/release_process.md
CHANGED
|
@@ -34,4 +34,8 @@ Note: The `gem-release` job uses:
|
|
|
34
34
|
- the `GITLAB_API_TOKEN` environment variable to authenticate against GitLab.com's API in order to create the tag
|
|
35
35
|
- the `GEM_HOST_API_KEY` environment variable to authenticate against Rubygems.org's API in order to release the gem
|
|
36
36
|
|
|
37
|
+
## Post-release maintenance
|
|
38
|
+
|
|
39
|
+
Please note that `gitlab-qa` version in `gitlab-org/gitlab` project will be updated automatically by [renovate-gitlab-bot](https://gitlab.com/gitlab-org/frontend/renovate-gitlab-bot). However, for live environment pipelines we need to specify the version in `pipeline-common` project manually. Remember to open an MR updating `GITLAB_QA_VERSION` value in [base.gitlab-ci.yml](https://gitlab.com/gitlab-org/quality/pipeline-common/-/blob/master/ci/base.gitlab-ci.yml#L4) shortly after the new version is released.
|
|
40
|
+
|
|
37
41
|
[`lib/gitlab/qa/version.rb`]: https://gitlab.com/gitlab-org/gitlab-qa/blob/master/lib/gitlab/qa/version.rb#L3
|
|
@@ -368,6 +368,22 @@ Example:
|
|
|
368
368
|
$ gitlab-qa Test::Integration::GitalyCluster EE
|
|
369
369
|
```
|
|
370
370
|
|
|
371
|
+
### `Test::Integration::GitlabPages CE|EE|<full image address>`
|
|
372
|
+
|
|
373
|
+
This tests that a GitLab Instance works as expected with [GitLab Pages](https://docs.gitlab.com/ee/user/project/pages/) enabled.
|
|
374
|
+
|
|
375
|
+
The scenario configures the instance by setting up these instructions [here](https://gitlab.com/gitlab-org/gitlab-development-kit/blob/main/doc/howto/pages.md) through enabling `gitlab_pages['enable'] = true;`, setting up an external url and the adding of the GitLab Pages hostname and GitLab Instance IP into the `etc/hostfile` on the container that runs the specs so it can access the page on the GitLab container.
|
|
376
|
+
|
|
377
|
+
To run tests against the GitLab container, a GitLab QA (`gitlab/gitlab-qa`)
|
|
378
|
+
container is spun up and tests are run from it by running the
|
|
379
|
+
`Test::Instance::All` scenario with the `:gitlab_pages` tag.
|
|
380
|
+
|
|
381
|
+
Example:
|
|
382
|
+
|
|
383
|
+
```
|
|
384
|
+
$ gitlab-qa Test::Integration::GitlabPages EE
|
|
385
|
+
```
|
|
386
|
+
|
|
371
387
|
### `Test::Integration::LDAPNoTLS CE|EE|<full image address>`
|
|
372
388
|
|
|
373
389
|
This tests that a GitLab instance works as expected with an external
|
|
@@ -1035,6 +1051,33 @@ $ export GITLAB_PASSWORD="$GITLAB_QA_PASSWORD"
|
|
|
1035
1051
|
|
|
1036
1052
|
$ gitlab-qa Test::Instance::Geo EE https://primary.gitlab.com https://secondary.gitlab.com
|
|
1037
1053
|
```
|
|
1054
|
+
|
|
1055
|
+
### `Test::Instance::Chaos`
|
|
1056
|
+
|
|
1057
|
+
This scenario will run a limited number of tests that are tagged with `:chaos`.
|
|
1058
|
+
|
|
1059
|
+
These tests are designed to verify that our systems can gracefully handle scenarios which may occur if
|
|
1060
|
+
networking or connectivity type issues occur in various Gitlab components.
|
|
1061
|
+
They make use of [toxiproxy(https://github.com/Shopify/toxiproxy)] to act as a proxy allowing us to introduce
|
|
1062
|
+
connectivity issues, via the [toxiproxy ruby client](https://github.com/Shopify/toxiproxy-ruby) in an E2E spec.
|
|
1063
|
+
|
|
1064
|
+
Sample Test:
|
|
1065
|
+
|
|
1066
|
+
```ruby
|
|
1067
|
+
context 'when a gitaly node is experiencing high latency' do
|
|
1068
|
+
it 'can create a project' do
|
|
1069
|
+
Toxiproxy[:gitaly1].toxic(:latency, latency: 30000).apply do
|
|
1070
|
+
expect(create_a_project).to be true
|
|
1071
|
+
end
|
|
1072
|
+
end
|
|
1073
|
+
end
|
|
1074
|
+
```
|
|
1075
|
+
|
|
1076
|
+
Example:
|
|
1077
|
+
|
|
1078
|
+
```
|
|
1079
|
+
$ gitlab-qa Test::Instance::Chaos
|
|
1080
|
+
```
|
|
1038
1081
|
----
|
|
1039
1082
|
|
|
1040
1083
|
[Back to README.md](../README.md)
|
data/gitlab-qa.gemspec
CHANGED
|
@@ -32,7 +32,8 @@ Gem::Specification.new do |spec|
|
|
|
32
32
|
spec.add_runtime_dependency 'gitlab', '~> 4.18.0'
|
|
33
33
|
spec.add_runtime_dependency 'http', '~> 5.0'
|
|
34
34
|
spec.add_runtime_dependency 'nokogiri', '~> 1.10'
|
|
35
|
-
spec.add_runtime_dependency 'rainbow', '
|
|
35
|
+
spec.add_runtime_dependency 'rainbow', '>= 3', '< 4'
|
|
36
36
|
spec.add_runtime_dependency 'table_print', '1.5.7'
|
|
37
|
-
spec.add_runtime_dependency '
|
|
37
|
+
spec.add_runtime_dependency 'toxiproxy', '~> 2.0.2'
|
|
38
|
+
spec.add_runtime_dependency 'zeitwerk', '>= 2', '< 3'
|
|
38
39
|
end
|
|
@@ -51,6 +51,10 @@ module Gitlab
|
|
|
51
51
|
teardown unless skip_teardown
|
|
52
52
|
end
|
|
53
53
|
|
|
54
|
+
def ip_address
|
|
55
|
+
docker.inspect(name) { |command| command << "-f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}'" }
|
|
56
|
+
end
|
|
57
|
+
|
|
54
58
|
alias_method :launch_and_teardown_instance, :instance
|
|
55
59
|
|
|
56
60
|
def prepare
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
require 'toxiproxy'
|
|
3
|
+
|
|
4
|
+
module Gitlab
|
|
5
|
+
module QA
|
|
6
|
+
module Component
|
|
7
|
+
class Chaos < Base
|
|
8
|
+
DOCKER_IMAGE = 'ghcr.io/shopify/toxiproxy'
|
|
9
|
+
DOCKER_IMAGE_TAG = '2.5.0'
|
|
10
|
+
|
|
11
|
+
def initialize
|
|
12
|
+
super
|
|
13
|
+
@network = "test"
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def name
|
|
17
|
+
@name ||= "chaos"
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def start
|
|
21
|
+
prepare
|
|
22
|
+
docker.run(image: image, tag: tag) do |command|
|
|
23
|
+
command << '-d '
|
|
24
|
+
command << "--name #{name}"
|
|
25
|
+
command << "--network #{@network}"
|
|
26
|
+
command << "--publish 8474:8474"
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
Toxiproxy.host = "http://localhost:8474"
|
|
30
|
+
|
|
31
|
+
begin
|
|
32
|
+
attempts ||= 1
|
|
33
|
+
Toxiproxy.populate([
|
|
34
|
+
{
|
|
35
|
+
name: "postgres",
|
|
36
|
+
listen: "[::]:5432",
|
|
37
|
+
upstream: "postgres.test:5432",
|
|
38
|
+
"enabled": true
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: "praefect",
|
|
42
|
+
listen: "[::]:2305",
|
|
43
|
+
upstream: "praefect.test:2305",
|
|
44
|
+
"enabled": true
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: "gitaly1",
|
|
48
|
+
listen: "[::]:8076",
|
|
49
|
+
upstream: "gitaly1.test:8076",
|
|
50
|
+
"enabled": true
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "gitaly2",
|
|
54
|
+
listen: "[::]:8077",
|
|
55
|
+
upstream: "gitaly2.test:8077",
|
|
56
|
+
"enabled": true
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "gitaly3",
|
|
60
|
+
listen: "[::]:8078",
|
|
61
|
+
upstream: "gitaly3.test:8078",
|
|
62
|
+
"enabled": true
|
|
63
|
+
}
|
|
64
|
+
])
|
|
65
|
+
rescue StandardError => e
|
|
66
|
+
Runtime::Logger.warn e.message
|
|
67
|
+
|
|
68
|
+
# This should resolve within seconds, but give some leeway for the toxiproxy container to start
|
|
69
|
+
if (attempts += 1) < 10
|
|
70
|
+
Runtime::Logger.info "Waiting #{attempts} seconds before retrying setting toxiproxy config"
|
|
71
|
+
sleep attempts
|
|
72
|
+
retry
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
# rubocop:disable Metrics/CyclomaticComplexity
|
|
2
3
|
|
|
3
4
|
require 'securerandom'
|
|
4
5
|
|
|
@@ -10,12 +11,13 @@ module Gitlab
|
|
|
10
11
|
# the `qa/` directory located in GitLab CE / EE repositories.
|
|
11
12
|
#
|
|
12
13
|
class Specs < Scenario::Template
|
|
13
|
-
attr_accessor :suite, :release, :network, :args, :volumes, :env, :runner_network, :hostname
|
|
14
|
+
attr_accessor :suite, :release, :network, :args, :volumes, :env, :runner_network, :hostname, :additional_hosts
|
|
14
15
|
|
|
15
16
|
def initialize
|
|
16
17
|
@docker = Docker::Engine.new(stream_output: true) # stream test output directly instead of through logger
|
|
17
18
|
@env = {}
|
|
18
19
|
@volumes = {}
|
|
20
|
+
@additional_hosts = []
|
|
19
21
|
@default_volumes = { '/var/run/docker.sock' => '/var/run/docker.sock' }
|
|
20
22
|
return if Runtime::Env.qa_knapsack_report_path.blank?
|
|
21
23
|
|
|
@@ -56,8 +58,8 @@ module Gitlab
|
|
|
56
58
|
command.env('QA_HOSTNAME', hostname)
|
|
57
59
|
end
|
|
58
60
|
|
|
59
|
-
|
|
60
|
-
hosts = Runtime::Env.docker_add_hosts.map { |host| "--add-host=#{host} " }.join
|
|
61
|
+
if Runtime::Env.docker_add_hosts.present? || additional_hosts.present?
|
|
62
|
+
hosts = Runtime::Env.docker_add_hosts.concat(additional_hosts).map { |host| "--add-host=#{host} " }.join
|
|
61
63
|
command << hosts # override /etc/hosts in docker container when test runs
|
|
62
64
|
end
|
|
63
65
|
|
|
@@ -111,3 +113,4 @@ module Gitlab
|
|
|
111
113
|
end
|
|
112
114
|
end
|
|
113
115
|
end
|
|
116
|
+
# rubocop:enable Metrics/CyclomaticComplexity
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Gitlab
|
|
4
|
+
module QA
|
|
5
|
+
module Scenario
|
|
6
|
+
module Test
|
|
7
|
+
module Integration
|
|
8
|
+
class Chaos < Praefect
|
|
9
|
+
def initialize
|
|
10
|
+
super
|
|
11
|
+
|
|
12
|
+
@praefect_addr = "chaos.test"
|
|
13
|
+
@database_addr = "chaos.test"
|
|
14
|
+
@primary_node_addr = "chaos.test"
|
|
15
|
+
@primary_node_port = 8076
|
|
16
|
+
@secondary_node_addr = "chaos.test"
|
|
17
|
+
@secondary_node_port = 8077
|
|
18
|
+
@tertiary_node_addr = "chaos.test"
|
|
19
|
+
@tertiary_node_port = 8078
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def perform(release, *rspec_args)
|
|
23
|
+
@chaos_node = Component::Chaos.new.tap(&:start)
|
|
24
|
+
|
|
25
|
+
run_gitaly_cluster(release, rspec_args)
|
|
26
|
+
ensure
|
|
27
|
+
@chaos_node&.teardown
|
|
28
|
+
@praefect_node&.teardown
|
|
29
|
+
@sql_node&.teardown
|
|
30
|
+
@gitaly_primary_node&.teardown
|
|
31
|
+
@gitaly_secondary_node&.teardown
|
|
32
|
+
@gitaly_tertiary_node&.teardown
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -8,13 +8,29 @@ module Gitlab
|
|
|
8
8
|
class GitalyCluster < Scenario::Template
|
|
9
9
|
attr_reader :gitlab_name, :spec_suite
|
|
10
10
|
|
|
11
|
-
def initialize
|
|
11
|
+
def initialize # rubocop:disable Metrics/AbcSize
|
|
12
12
|
@gitlab_name = 'gitlab-gitaly-cluster'
|
|
13
|
+
|
|
13
14
|
@primary_node_name = 'gitaly1'
|
|
15
|
+
@primary_node_addr = "#{@primary_node_name}.#{@network}"
|
|
16
|
+
@primary_node_port = 8075
|
|
17
|
+
|
|
14
18
|
@secondary_node_name = 'gitaly2'
|
|
19
|
+
@secondary_node_addr = "#{@secondary_node_name}.#{@network}"
|
|
20
|
+
@secondary_node_port = 8075
|
|
21
|
+
|
|
15
22
|
@tertiary_node_name = 'gitaly3'
|
|
23
|
+
@tertiary_node_addr = "#{@tertiary_node_name}.#{@network}"
|
|
24
|
+
@tertiary_node_port = 8075
|
|
25
|
+
|
|
16
26
|
@praefect_node_name = 'praefect'
|
|
27
|
+
@praefect_port = 2305
|
|
28
|
+
@praefect_addr = "#{@praefect_node_name}.#{@network}"
|
|
29
|
+
|
|
17
30
|
@database = 'postgres'
|
|
31
|
+
@database_port = 5432
|
|
32
|
+
@database_addr = "#{@database}.#{@network}"
|
|
33
|
+
|
|
18
34
|
@spec_suite = 'Test::Instance::All'
|
|
19
35
|
@network = 'test'
|
|
20
36
|
@env = {}
|
|
@@ -22,6 +38,16 @@ module Gitlab
|
|
|
22
38
|
end
|
|
23
39
|
|
|
24
40
|
def perform(release, *rspec_args)
|
|
41
|
+
run_gitaly_cluster(release, rspec_args)
|
|
42
|
+
ensure
|
|
43
|
+
@praefect_node&.teardown
|
|
44
|
+
@sql_node&.teardown
|
|
45
|
+
@gitaly_primary_node&.teardown
|
|
46
|
+
@gitaly_secondary_node&.teardown
|
|
47
|
+
@gitaly_tertiary_node&.teardown
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def run_gitaly_cluster(release, rspec_args) # rubocop:disable Metrics/AbcSize
|
|
25
51
|
# The postgres container starts in seconds so not essential to parallelize it
|
|
26
52
|
# This also ensure that the docker network is created here, avoiding any potential race conditions later
|
|
27
53
|
# if the gitaly-cluster and GitLab containers attempt to create a network in parallel
|
|
@@ -57,21 +83,15 @@ module Gitlab
|
|
|
57
83
|
end
|
|
58
84
|
end
|
|
59
85
|
end
|
|
60
|
-
ensure
|
|
61
|
-
@praefect_node&.teardown
|
|
62
|
-
@sql_node&.teardown
|
|
63
|
-
@gitaly_primary_node&.teardown
|
|
64
|
-
@gitaly_secondary_node&.teardown
|
|
65
|
-
@gitaly_tertiary_node&.teardown
|
|
66
86
|
end
|
|
67
87
|
|
|
68
88
|
private
|
|
69
89
|
|
|
70
90
|
def start_gitaly_cluster(release)
|
|
71
91
|
Runtime::Logger.info("Starting Gitaly Cluster")
|
|
72
|
-
@gitaly_primary_node = gitaly(@primary_node_name, release)
|
|
73
|
-
@gitaly_secondary_node = gitaly(@secondary_node_name, release)
|
|
74
|
-
@gitaly_tertiary_node = gitaly(@tertiary_node_name, release)
|
|
92
|
+
@gitaly_primary_node = gitaly(@primary_node_name, @primary_node_port, release)
|
|
93
|
+
@gitaly_secondary_node = gitaly(@secondary_node_name, @secondary_node_port, release)
|
|
94
|
+
@gitaly_tertiary_node = gitaly(@tertiary_node_name, @tertiary_node_port, release)
|
|
75
95
|
|
|
76
96
|
@praefect_node = praefect(@praefect_node_name, release)
|
|
77
97
|
Runtime::Logger.info("Gitaly Cluster Ready")
|
|
@@ -97,31 +117,31 @@ module Gitlab
|
|
|
97
117
|
#{disable_other_services}
|
|
98
118
|
gitaly['enable'] = false;
|
|
99
119
|
praefect['enable'] = true;
|
|
100
|
-
praefect['listen_addr'] = '0.0.0.0
|
|
120
|
+
praefect['listen_addr'] = '0.0.0.0:#{@praefect_port}';
|
|
101
121
|
praefect['prometheus_listen_addr'] = '0.0.0.0:9652';
|
|
102
122
|
praefect['auth_token'] = 'PRAEFECT_EXTERNAL_TOKEN';
|
|
103
123
|
praefect['reconciliation_scheduling_interval'] = '10s';
|
|
104
|
-
praefect['database_host'] = '#{@
|
|
124
|
+
praefect['database_host'] = '#{@database_addr}';
|
|
105
125
|
praefect['database_user'] = 'postgres';
|
|
106
|
-
praefect['database_port'] =
|
|
126
|
+
praefect['database_port'] = #{@database_port};
|
|
107
127
|
praefect['database_password'] = 'SQL_PASSWORD';
|
|
108
128
|
praefect['database_dbname'] = 'praefect_production';
|
|
109
129
|
praefect['database_sslmode'] = 'disable';
|
|
110
|
-
praefect['database_direct_host'] = '#{@
|
|
111
|
-
praefect['database_direct_port'] =
|
|
130
|
+
praefect['database_direct_host'] = '#{@database_addr}';
|
|
131
|
+
praefect['database_direct_port'] = #{@database_port};
|
|
112
132
|
praefect['virtual_storages'] = {
|
|
113
133
|
'default' => {
|
|
114
134
|
'nodes' => {
|
|
115
135
|
'#{@primary_node_name}' => {
|
|
116
|
-
'address' => 'tcp://#{@
|
|
136
|
+
'address' => 'tcp://#{@primary_node_addr}:#{@primary_node_port}',
|
|
117
137
|
'token' => 'PRAEFECT_INTERNAL_TOKEN'
|
|
118
138
|
},
|
|
119
139
|
'#{@secondary_node_name}' => {
|
|
120
|
-
'address' => 'tcp://#{@
|
|
140
|
+
'address' => 'tcp://#{@secondary_node_addr}:#{@secondary_node_port}',
|
|
121
141
|
'token' => 'PRAEFECT_INTERNAL_TOKEN'
|
|
122
142
|
},
|
|
123
143
|
'#{@tertiary_node_name}' => {
|
|
124
|
-
'address' => 'tcp://#{@
|
|
144
|
+
'address' => 'tcp://#{@tertiary_node_addr}:#{@tertiary_node_port}',
|
|
125
145
|
'token' => 'PRAEFECT_INTERNAL_TOKEN'
|
|
126
146
|
}
|
|
127
147
|
}
|
|
@@ -130,12 +150,12 @@ module Gitlab
|
|
|
130
150
|
OMNIBUS
|
|
131
151
|
end
|
|
132
152
|
|
|
133
|
-
def gitaly_omnibus_configuration
|
|
153
|
+
def gitaly_omnibus_configuration(listen_port)
|
|
134
154
|
<<~OMNIBUS
|
|
135
155
|
#{disable_other_services.sub(/(prometheus\['enable'\]) = false/, '\1 = true')}
|
|
136
156
|
prometheus_monitoring['enable'] = false;
|
|
137
157
|
gitaly['enable'] = true;
|
|
138
|
-
gitaly['listen_addr'] = '0.0.0.0
|
|
158
|
+
gitaly['listen_addr'] = '0.0.0.0:#{listen_port}';
|
|
139
159
|
gitaly['prometheus_listen_addr'] = '0.0.0.0:9236';
|
|
140
160
|
gitaly['auth_token'] = 'PRAEFECT_INTERNAL_TOKEN';
|
|
141
161
|
gitlab_shell['secret_token'] = 'GITLAB_SHELL_SECRET_TOKEN';
|
|
@@ -160,7 +180,7 @@ module Gitlab
|
|
|
160
180
|
|
|
161
181
|
git_data_dirs({
|
|
162
182
|
'default' => {
|
|
163
|
-
'gitaly_address' => 'tcp://#{@
|
|
183
|
+
'gitaly_address' => 'tcp://#{@praefect_addr}:#{@praefect_port}',
|
|
164
184
|
'gitaly_token' => 'PRAEFECT_EXTERNAL_TOKEN'
|
|
165
185
|
}
|
|
166
186
|
});
|
|
@@ -171,7 +191,7 @@ module Gitlab
|
|
|
171
191
|
'job_name' => 'praefect',
|
|
172
192
|
'static_configs' => [
|
|
173
193
|
'targets' => [
|
|
174
|
-
'#{@
|
|
194
|
+
'#{@praefect_addr}:#{@praefect_port}'
|
|
175
195
|
]
|
|
176
196
|
]
|
|
177
197
|
},
|
|
@@ -215,14 +235,14 @@ module Gitlab
|
|
|
215
235
|
end
|
|
216
236
|
end
|
|
217
237
|
|
|
218
|
-
def gitaly(name, release)
|
|
238
|
+
def gitaly(name, port, release)
|
|
219
239
|
Component::Gitlab.new.tap do |gitaly|
|
|
220
240
|
gitaly.release = QA::Release.new(release)
|
|
221
241
|
gitaly.name = name
|
|
222
242
|
gitaly.network = @network
|
|
223
243
|
gitaly.skip_availability_check = true
|
|
224
244
|
gitaly.seed_admin_token = false
|
|
225
|
-
gitaly.omnibus_configuration << gitaly_omnibus_configuration
|
|
245
|
+
gitaly.omnibus_configuration << gitaly_omnibus_configuration(port)
|
|
226
246
|
gitaly.instance(skip_teardown: true)
|
|
227
247
|
end
|
|
228
248
|
end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Gitlab
|
|
4
|
+
module QA
|
|
5
|
+
module Scenario
|
|
6
|
+
module Test
|
|
7
|
+
module Integration
|
|
8
|
+
class GitlabPages < Scenario::Template
|
|
9
|
+
def initialize
|
|
10
|
+
@gitlab_name = 'gitlab-pages'
|
|
11
|
+
@network = 'test'
|
|
12
|
+
@pages_host = 'gitlab-pages.test'
|
|
13
|
+
@pages_sandbox_name = 'gitlab-qa-sandbox-group-pages'
|
|
14
|
+
@tag = 'gitlab_pages'
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def gitlab_omnibus_configuration
|
|
18
|
+
<<~OMNIBUS
|
|
19
|
+
pages_external_url 'http://#{@gitlab_name}.#{@network}';
|
|
20
|
+
gitlab_pages['enable'] = true;
|
|
21
|
+
OMNIBUS
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def set_sandbox_name(sandbox_name)
|
|
25
|
+
::Gitlab::QA::Runtime::Env.gitlab_sandbox_name = sandbox_name
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def perform(release, *rspec_args)
|
|
29
|
+
Component::Gitlab.perform do |gitlab|
|
|
30
|
+
gitlab.release = QA::Release.new(release)
|
|
31
|
+
gitlab.name = @gitlab_name
|
|
32
|
+
gitlab.network = @network
|
|
33
|
+
|
|
34
|
+
set_sandbox_name(@pages_sandbox_name)
|
|
35
|
+
|
|
36
|
+
gitlab.omnibus_configuration << gitlab_omnibus_configuration
|
|
37
|
+
gitlab.instance do
|
|
38
|
+
if @tag
|
|
39
|
+
rspec_args << "--" unless rspec_args.include?('--')
|
|
40
|
+
rspec_args << "--tag" << @tag
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
Component::Specs.perform do |specs|
|
|
44
|
+
specs.additional_hosts << "#{@pages_sandbox_name}.#{@pages_host}:#{gitlab.ip_address}"
|
|
45
|
+
specs.suite = 'Test::Instance::All'
|
|
46
|
+
specs.release = gitlab.release
|
|
47
|
+
specs.network = gitlab.network
|
|
48
|
+
specs.args = [gitlab.address, *rspec_args]
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
@@ -21,7 +21,7 @@ module Gitlab
|
|
|
21
21
|
|
|
22
22
|
git_data_dirs({
|
|
23
23
|
'default' => {
|
|
24
|
-
'gitaly_address' => 'tcp://#{@
|
|
24
|
+
'gitaly_address' => 'tcp://#{@praefect_addr}:#{@praefect_port}',
|
|
25
25
|
'gitaly_token' => 'PRAEFECT_EXTERNAL_TOKEN'
|
|
26
26
|
},
|
|
27
27
|
'gitaly' => {
|
|
@@ -45,7 +45,7 @@ module Gitlab
|
|
|
45
45
|
'job_name' => 'praefect',
|
|
46
46
|
'static_configs' => [
|
|
47
47
|
'targets' => [
|
|
48
|
-
'#{@
|
|
48
|
+
'#{@praefect_addr}:9652'
|
|
49
49
|
]
|
|
50
50
|
]
|
|
51
51
|
},
|
|
@@ -53,9 +53,9 @@ module Gitlab
|
|
|
53
53
|
'job_name' => 'praefect-gitaly',
|
|
54
54
|
'static_configs' => [
|
|
55
55
|
'targets' => [
|
|
56
|
-
'#{@
|
|
57
|
-
'#{@
|
|
58
|
-
'#{@
|
|
56
|
+
'#{@primary_node_addr}:9236',
|
|
57
|
+
'#{@secondary_node_addr}:9236',
|
|
58
|
+
'#{@tertiary_node_addr}:9236'
|
|
59
59
|
]
|
|
60
60
|
]
|
|
61
61
|
}
|
data/lib/gitlab/qa/version.rb
CHANGED
data/scripts/generate-qa-jobs.rb
CHANGED
|
@@ -40,6 +40,7 @@ class GenerateQAJobs
|
|
|
40
40
|
jobs.merge!(load_yml_contents('opensearch', should_automatically_run?('test_integration_opensearch')))
|
|
41
41
|
jobs.merge!(load_yml_contents('praefect', should_automatically_run?('test_instance_all')))
|
|
42
42
|
jobs.merge!(load_yml_contents('gitaly_cluster', should_automatically_run?('test_instance_all')))
|
|
43
|
+
jobs.merge!(load_yml_contents('gitlab_pages', should_automatically_run?('test_instance_all_gitlab_pages')))
|
|
43
44
|
jobs.merge!(load_yml_contents('mtls', should_automatically_run?('test_instance_all_mtls')))
|
|
44
45
|
jobs.merge!(load_yml_contents('smtp', should_automatically_run?('test_integration_smtp')))
|
|
45
46
|
jobs.merge!(load_yml_contents('jira', should_automatically_run?('test_instance_all_jira')))
|
|
@@ -47,6 +48,7 @@ class GenerateQAJobs
|
|
|
47
48
|
jobs.merge!(load_yml_contents('large_setup', should_automatically_run?('test_instance_all_can_use_large_setup')))
|
|
48
49
|
jobs.merge!(load_yml_contents('cloud_activation', should_automatically_run?('test_instance_all_cloud_activation')))
|
|
49
50
|
jobs.merge!(load_yml_contents('registry_with_cdn', should_automatically_run?('test_integration_registrywithcdn')))
|
|
51
|
+
jobs.merge!(load_yml_contents('chaos', should_automatically_run?('test_integration_chaos')))
|
|
50
52
|
jobs.merge!(load_yml_contents('staging'))
|
|
51
53
|
jobs.merge!(load_yml_contents('metrics', should_automatically_run?('test_instance_all_metrics')))
|
|
52
54
|
|
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.9.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-10-
|
|
11
|
+
date: 2022-10-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: climate_control
|
|
@@ -182,16 +182,22 @@ dependencies:
|
|
|
182
182
|
name: rainbow
|
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
|
184
184
|
requirements:
|
|
185
|
-
- - "
|
|
185
|
+
- - ">="
|
|
186
|
+
- !ruby/object:Gem::Version
|
|
187
|
+
version: '3'
|
|
188
|
+
- - "<"
|
|
186
189
|
- !ruby/object:Gem::Version
|
|
187
|
-
version:
|
|
190
|
+
version: '4'
|
|
188
191
|
type: :runtime
|
|
189
192
|
prerelease: false
|
|
190
193
|
version_requirements: !ruby/object:Gem::Requirement
|
|
191
194
|
requirements:
|
|
192
|
-
- - "
|
|
195
|
+
- - ">="
|
|
193
196
|
- !ruby/object:Gem::Version
|
|
194
|
-
version: 3
|
|
197
|
+
version: '3'
|
|
198
|
+
- - "<"
|
|
199
|
+
- !ruby/object:Gem::Version
|
|
200
|
+
version: '4'
|
|
195
201
|
- !ruby/object:Gem::Dependency
|
|
196
202
|
name: table_print
|
|
197
203
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -207,19 +213,39 @@ dependencies:
|
|
|
207
213
|
- !ruby/object:Gem::Version
|
|
208
214
|
version: 1.5.7
|
|
209
215
|
- !ruby/object:Gem::Dependency
|
|
210
|
-
name:
|
|
216
|
+
name: toxiproxy
|
|
211
217
|
requirement: !ruby/object:Gem::Requirement
|
|
212
218
|
requirements:
|
|
213
219
|
- - "~>"
|
|
214
220
|
- !ruby/object:Gem::Version
|
|
215
|
-
version:
|
|
221
|
+
version: 2.0.2
|
|
216
222
|
type: :runtime
|
|
217
223
|
prerelease: false
|
|
218
224
|
version_requirements: !ruby/object:Gem::Requirement
|
|
219
225
|
requirements:
|
|
220
226
|
- - "~>"
|
|
221
227
|
- !ruby/object:Gem::Version
|
|
222
|
-
version:
|
|
228
|
+
version: 2.0.2
|
|
229
|
+
- !ruby/object:Gem::Dependency
|
|
230
|
+
name: zeitwerk
|
|
231
|
+
requirement: !ruby/object:Gem::Requirement
|
|
232
|
+
requirements:
|
|
233
|
+
- - ">="
|
|
234
|
+
- !ruby/object:Gem::Version
|
|
235
|
+
version: '2'
|
|
236
|
+
- - "<"
|
|
237
|
+
- !ruby/object:Gem::Version
|
|
238
|
+
version: '3'
|
|
239
|
+
type: :runtime
|
|
240
|
+
prerelease: false
|
|
241
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
242
|
+
requirements:
|
|
243
|
+
- - ">="
|
|
244
|
+
- !ruby/object:Gem::Version
|
|
245
|
+
version: '2'
|
|
246
|
+
- - "<"
|
|
247
|
+
- !ruby/object:Gem::Version
|
|
248
|
+
version: '3'
|
|
223
249
|
description:
|
|
224
250
|
email:
|
|
225
251
|
- gitlab-qa@gmail.com
|
|
@@ -233,6 +259,7 @@ files:
|
|
|
233
259
|
- ".gitignore"
|
|
234
260
|
- ".gitlab-ci.yml"
|
|
235
261
|
- ".gitlab/ci/jobs/base.gitlab-ci.yml"
|
|
262
|
+
- ".gitlab/ci/jobs/chaos.gitlab-ci.yml"
|
|
236
263
|
- ".gitlab/ci/jobs/cloud_activation.gitlab-ci.yml"
|
|
237
264
|
- ".gitlab/ci/jobs/custom_parallel.gitlab-ci.yml"
|
|
238
265
|
- ".gitlab/ci/jobs/decomposition_multiple_db.gitlab-ci.yml"
|
|
@@ -241,6 +268,7 @@ files:
|
|
|
241
268
|
- ".gitlab/ci/jobs/elasticsearch.gitlab-ci.yml"
|
|
242
269
|
- ".gitlab/ci/jobs/geo.gitlab-ci.yml"
|
|
243
270
|
- ".gitlab/ci/jobs/gitaly_cluster.gitlab-ci.yml"
|
|
271
|
+
- ".gitlab/ci/jobs/gitlab_pages.gitlab-ci.yml"
|
|
244
272
|
- ".gitlab/ci/jobs/group_saml.gitlab-ci.yml"
|
|
245
273
|
- ".gitlab/ci/jobs/instance.gitlab-ci.yml"
|
|
246
274
|
- ".gitlab/ci/jobs/instance_saml.gitlab-ci.yml"
|
|
@@ -311,6 +339,7 @@ files:
|
|
|
311
339
|
- gitlab-qa.gemspec
|
|
312
340
|
- lib/gitlab/qa.rb
|
|
313
341
|
- lib/gitlab/qa/component/base.rb
|
|
342
|
+
- lib/gitlab/qa/component/chaos.rb
|
|
314
343
|
- lib/gitlab/qa/component/elasticsearch.rb
|
|
315
344
|
- lib/gitlab/qa/component/gitlab.rb
|
|
316
345
|
- lib/gitlab/qa/component/jira.rb
|
|
@@ -383,10 +412,12 @@ files:
|
|
|
383
412
|
- lib/gitlab/qa/scenario/test/instance/staging_geo.rb
|
|
384
413
|
- lib/gitlab/qa/scenario/test/instance/staging_ref.rb
|
|
385
414
|
- lib/gitlab/qa/scenario/test/instance/staging_ref_geo.rb
|
|
415
|
+
- lib/gitlab/qa/scenario/test/integration/chaos.rb
|
|
386
416
|
- lib/gitlab/qa/scenario/test/integration/client_ssl.rb
|
|
387
417
|
- lib/gitlab/qa/scenario/test/integration/elasticsearch.rb
|
|
388
418
|
- lib/gitlab/qa/scenario/test/integration/geo.rb
|
|
389
419
|
- lib/gitlab/qa/scenario/test/integration/gitaly_cluster.rb
|
|
420
|
+
- lib/gitlab/qa/scenario/test/integration/gitlab_pages.rb
|
|
390
421
|
- lib/gitlab/qa/scenario/test/integration/group_saml.rb
|
|
391
422
|
- lib/gitlab/qa/scenario/test/integration/instance_saml.rb
|
|
392
423
|
- lib/gitlab/qa/scenario/test/integration/integrations.rb
|