gitlab-qa 7.3.1 → 7.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f5a314d23803f87dbaae80b80dc127fd6c285acf540f48d3feb8dd78038d4d1d
4
- data.tar.gz: 49e24a262489cbd18e7105af26847e3ac4deec62c1d06a64191c65f86d9176f4
3
+ metadata.gz: b1a1313f56de2ef2b59bdaccf1bc7d035d6bffd01c5d5d2ddaca7365293017c9
4
+ data.tar.gz: 3fd92bbd855ab71f59f48e605eb9aa9385fe9173113b85c83a8d592ec28fb0b9
5
5
  SHA512:
6
- metadata.gz: 4de75cf6f4fdee481c2b0b8d4c38d11d79e86fda4ac0eb00620efa525a7fe87f03c1c1cd338c52edcb05e133a2dc52a884b5e45a9c64395c7707f8d6e49d89eb
7
- data.tar.gz: 92361b1e9c8044c79beb7952bf71a54194a3071eec3883648d963de74f73efbc316f1daf23125821299772356d54d99d301c5838d6b4bc6253cdfeaf375917ca
6
+ metadata.gz: 577ede9a1cb24fb98710686ede8c7da92fe7a2e357aa6094bd6ddcdb6a6418660a5983f926a470dc367ad41655466bab93522e22721dae757f26fada187ad6ea
7
+ data.tar.gz: db1ac78a81bd21165d5f34c81970dd9c02025c522876d39590b24e807d87833482e0c5cee4ea13a6106bde12f797132aaaf3a4c8179b8fc2741815e82acbbded
data/.gitlab-ci.yml CHANGED
@@ -44,6 +44,7 @@ variables:
44
44
  QA_ARTIFACTS_DIR: $CI_PROJECT_DIR
45
45
  QA_CAN_TEST_GIT_PROTOCOL_V2: "true"
46
46
  QA_CAN_TEST_PRAEFECT: "false"
47
+ QA_GENERATE_ALLURE_REPORT: "true"
47
48
  QA_TESTCASES_REPORTING_PROJECT: "gitlab-org/quality/testcases"
48
49
  QA_TESTCASE_SESSIONS_PROJECT: "gitlab-org/quality/testcase-sessions"
49
50
  # QA_DEFAULT_BRANCH is the default branch name of the instance under test.
@@ -153,7 +154,10 @@ rspec:
153
154
  variables:
154
155
  QA_RSPEC_TAGS: "--tag quarantine"
155
156
 
157
+ # Do not generate allure report since it always adds a failed test to the report. The job runs a test where 1 example would always fail and assert exit code via custom script bin/expect_exit_code_and_text
156
158
  ce:sanity-framework:
159
+ variables:
160
+ QA_GENERATE_ALLURE_REPORT: "false"
157
161
  script:
158
162
  - ./bin/expect_exit_code_and_text "bundle exec exe/gitlab-qa Test::Instance::Image ${RELEASE:=CE} -- --tag framework" 1 "2 examples, 1 failure"
159
163
  extends:
@@ -162,6 +166,8 @@ ce:sanity-framework:
162
166
  - .ce-qa
163
167
 
164
168
  ee:sanity-framework:
169
+ variables:
170
+ QA_GENERATE_ALLURE_REPORT: "false"
165
171
  script:
166
172
  - ./bin/expect_exit_code_and_text "bundle exec exe/gitlab-qa Test::Instance::Image ${RELEASE:=EE} -- --tag framework" 1 "2 examples, 1 failure"
167
173
  extends:
@@ -634,57 +640,16 @@ ee:group_saml-quarantine:
634
640
  variables:
635
641
  QA_SCENARIO: "Test::Integration::GroupSAML"
636
642
 
637
- ce:kubernetes:
638
- extends:
639
- - .test
640
- - .high-capacity
641
- - .ce-qa
642
- - .rspec-report-opts
643
- allow_failure: true
644
- variables:
645
- QA_SCENARIO: "Test::Integration::Kubernetes"
646
-
647
- ce:kubernetes-quarantine:
648
- extends:
649
- - .test
650
- - .high-capacity
651
- - .ce-qa
652
- - .quarantine
653
- - .rspec-report-opts
654
- variables:
655
- QA_SCENARIO: "Test::Integration::Kubernetes"
656
-
657
- ee:kubernetes:
658
- extends:
659
- - .test
660
- - .high-capacity
661
- - .ee-qa
662
- - .rspec-report-opts
663
- allow_failure: true
664
- variables:
665
- QA_SCENARIO: "Test::Integration::Kubernetes"
666
-
667
- ee:kubernetes-quarantine:
668
- extends:
669
- - .test
670
- - .high-capacity
671
- - .ee-qa
672
- - .quarantine
673
- - .rspec-report-opts
674
- variables:
675
- QA_SCENARIO: "Test::Integration::Kubernetes"
676
-
677
- ce:ssh_tunnel:
643
+ ce:object_storage:
678
644
  extends:
679
645
  - .test
680
646
  - .high-capacity
681
647
  - .ce-qa
682
648
  - .rspec-report-opts
683
- allow_failure: true
684
649
  variables:
685
- QA_SCENARIO: "Test::Integration::SSHTunnel"
650
+ GITLAB_QA_OPTS: "--omnibus-config object_storage"
686
651
 
687
- ce:ssh_tunnel-quarantine:
652
+ ce:object_storage-quarantine:
688
653
  extends:
689
654
  - .test
690
655
  - .high-capacity
@@ -692,19 +657,19 @@ ce:ssh_tunnel-quarantine:
692
657
  - .quarantine
693
658
  - .rspec-report-opts
694
659
  variables:
695
- QA_SCENARIO: "Test::Integration::SSHTunnel"
660
+ GITLAB_QA_OPTS: "--omnibus-config object_storage"
696
661
 
697
- ee:ssh_tunnel:
662
+ ee:object_storage_aws:
698
663
  extends:
699
664
  - .test
700
665
  - .high-capacity
701
666
  - .ee-qa
702
667
  - .rspec-report-opts
703
- allow_failure: true
704
668
  variables:
705
- QA_SCENARIO: "Test::Integration::SSHTunnel"
669
+ GITLAB_QA_OPTS: "--omnibus-config object_storage_aws"
670
+ QA_RSPEC_TAGS: "--tag object_storage"
706
671
 
707
- ee:ssh_tunnel-quarantine:
672
+ ee:object_storage_aws-quarantine:
708
673
  extends:
709
674
  - .test
710
675
  - .high-capacity
@@ -712,26 +677,8 @@ ee:ssh_tunnel-quarantine:
712
677
  - .quarantine
713
678
  - .rspec-report-opts
714
679
  variables:
715
- QA_SCENARIO: "Test::Integration::SSHTunnel"
716
-
717
- ce:object_storage:
718
- extends:
719
- - .test
720
- - .high-capacity
721
- - .ce-qa
722
- - .rspec-report-opts
723
- variables:
724
- GITLAB_QA_OPTS: "--omnibus-config object_storage"
725
-
726
- ce:object_storage-quarantine:
727
- extends:
728
- - .test
729
- - .high-capacity
730
- - .ce-qa
731
- - .quarantine
732
- - .rspec-report-opts
733
- variables:
734
- GITLAB_QA_OPTS: "--omnibus-config object_storage"
680
+ GITLAB_QA_OPTS: "--omnibus-config object_storage_aws"
681
+ QA_RSPEC_TAGS: "--tag quarantine --tag object_storage"
735
682
 
736
683
  ee:object_storage:
737
684
  extends:
@@ -1030,6 +977,24 @@ ee:jira-quarantine:
1030
977
  variables:
1031
978
  QA_SCENARIO: "Test::Integration::Jira"
1032
979
 
980
+ ce:large-setup:
981
+ extends:
982
+ - .test
983
+ - .high-capacity
984
+ - .ce-qa
985
+ - .rspec-report-opts
986
+ variables:
987
+ QA_RSPEC_TAGS: "--tag can_use_large_setup"
988
+
989
+ ee:large-setup:
990
+ extends:
991
+ - .test
992
+ - .high-capacity
993
+ - .ee-qa
994
+ - .rspec-report-opts
995
+ variables:
996
+ QA_RSPEC_TAGS: "--tag can_use_large_setup"
997
+
1033
998
  # This job requires the `GITLAB_QA_ACCESS_TOKEN` and `GITLAB_QA_DEV_ACCESS_TOKEN`
1034
999
  # variable to be passed when triggered.
1035
1000
  staging:
@@ -1126,3 +1091,37 @@ notify_slack:
1126
1091
  include:
1127
1092
  - project: 'gitlab-org/quality/pipeline-common'
1128
1093
  file: '/ci/gem-release.yml'
1094
+ - project: 'gitlab-org/quality/pipeline-common'
1095
+ file: '/ci/allure-report.yml'
1096
+
1097
+ generate-allure-report:
1098
+ extends: .generate-allure-report-base
1099
+ stage: report
1100
+ variables:
1101
+ STORAGE_CREDENTIALS: $QA_ALLURE_REPORT_GCS_CREDENTIALS
1102
+ GITLAB_AUTH_TOKEN: $GITLAB_QA_MR_ALLURE_REPORT_TOKEN
1103
+ ALLURE_RESULTS_GLOB: gitlab-qa-run-*/**/allure-results/*
1104
+ # Override allure variables for upstream triggers
1105
+ ALLURE_PROJECT_PATH: $TOP_UPSTREAM_SOURCE_PROJECT
1106
+ ALLURE_MERGE_REQUEST_IID: $TOP_UPSTREAM_MERGE_REQUEST_IID
1107
+ ALLURE_COMMIT_SHA: $TOP_UPSTREAM_SOURCE_SHA
1108
+ # Override default before script and don't push cache
1109
+ cache:
1110
+ policy: pull
1111
+ before_script:
1112
+ - echo "Generating and publishing allure test report"
1113
+ rules:
1114
+ # Don't run report generation on release pipelines
1115
+ - if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_PATH == "gitlab-org/gitlab-qa" && $RELEASE == null'
1116
+ changes: ["lib/**/version.rb"]
1117
+ when: never
1118
+ - if: '$CI_COMMIT_TAG'
1119
+ when: never
1120
+ - if: '$CI_PIPELINE_SOURCE == "merge_request_event" || ($CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH)'
1121
+ variables:
1122
+ ALLURE_JOB_NAME: gitlab-qa
1123
+ when: always
1124
+ - if: '$TOP_UPSTREAM_SOURCE_PROJECT && $TOP_UPSTREAM_SOURCE_SHA'
1125
+ variables:
1126
+ ALLURE_JOB_NAME: package-and-qa
1127
+ when: always
@@ -3,10 +3,17 @@
3
3
 
4
4
  require 'gitlab'
5
5
 
6
+ # Default to "Multi-pipeline (from 'gitlab-org/gitlab-qa' 'notify_upstream_commit:*' jobs)" from current project
7
+ api_token = ENV.fetch('GITLAB_QA_PROJECT_ACCESS_TOKEN') do
8
+ puts "The $GITLAB_BOT_MULTI_PROJECT_PIPELINE_POLLING_TOKEN variable is deprecated in favor of a dedicated project access token: $GITLAB_QA_PROJECT_ACCESS_TOKEN."
9
+ puts "See https://gitlab.com/groups/gitlab-org/quality/-/epics/17 for more details."
10
+ ENV['GITLAB_BOT_MULTI_PROJECT_PIPELINE_POLLING_TOKEN']
11
+ end
12
+
6
13
  # Configure credentials to be used with gitlab gem
7
14
  Gitlab.configure do |config|
8
15
  config.endpoint = 'https://gitlab.com/api/v4'
9
- config.private_token = ENV['GITLAB_BOT_MULTI_PROJECT_PIPELINE_POLLING_TOKEN']
16
+ config.private_token = api_token
10
17
  end
11
18
 
12
19
  class CommitComment
@@ -37,18 +37,18 @@ make a few changes to your `gdk/gitlab/config/gitlab.yml` file.
37
37
  # build the QA image first
38
38
  # In gdk/gitlab:
39
39
  $ docker build -t gitlab/gitlab-ce-qa:your-custom-tag --file ./qa/Dockerfile ./
40
-
41
- # Note: You will also need a corresponding GitLab image.
40
+
41
+ # Note: You will also need a corresponding GitLab image.
42
42
  # For example, if you haven't changed any application code (e.g., no new elements), you could tag the current nightly build:
43
43
  $ docker tag gitlab/gitlab-ce:nightly gitlab/gitlab-ce:your-custom-tag
44
44
 
45
45
  # Then in gitlab-qa:
46
46
  $ exe/gitlab-qa Test::Instance::Any gitlab/gitlab-ce:your-custom-tag http://192.168.0.12:3000 -- qa/specs/features/browser_ui/1_manage/login/log_in_spec.rb
47
47
  ```
48
-
48
+
49
49
  **Note:** The hostname of the URL provided to `gitlab-qa` must match the hostname configured for GDK.
50
50
  If they do not match, a test will be signed out when it visits a page directly because the hostname of the URL visited will be different from the hostname that was used when signing in.
51
-
51
+
52
52
  ### Running EE tests
53
53
 
54
54
  When running EE tests you'll need to have a license available. GitLab engineers can [request a license](https://about.gitlab.com/handbook/developer-onboarding/#working-on-gitlab-ee).
@@ -68,7 +68,7 @@ Run from the `gdk-ee/gitlab/qa` directory with GDK primary and secondary running
68
68
  $ bundle exec bin/qa QA::EE::Scenario::Test::Geo --primary-address http://localhost:3001 --secondary-address http://localhost:3002 --primary-name primary --secondary-name secondary --without-setup
69
69
 
70
70
  # Run in visible Chrome browser
71
- $ CHROME_HEADLESS=0 bundle exec bin/qa QA::EE::Scenario::Test::Geo --primary-address http://localhost:3001 --secondary-address http://localhost:3002 --primary-name primary --secondary-name secondary --without-setup
71
+ $ WEBDRIVER_HEADLESS=0 bundle exec bin/qa QA::EE::Scenario::Test::Geo --primary-address http://localhost:3001 --secondary-address http://localhost:3002 --primary-name primary --secondary-name secondary --without-setup
72
72
  ```
73
73
 
74
74
  ### QA Tool support on macOS
@@ -59,7 +59,7 @@ All environment variables used by GitLab QA should be defined in [`lib/gitlab/qa
59
59
  | `EE_LICENSE` |- | Enterprise Edition license. | No|
60
60
  | `QA_ARTIFACTS_DIR` |`/tmp/gitlab-qa`| Path to a directory where artifacts (logs and screenshots) for failing tests will be saved. | No|
61
61
  | `DOCKER_HOST` |`http://localhost`| Docker host to run tests against. | No|
62
- | `CHROME_HEADLESS` |- | When running locally, set to `false` to allow Chrome tests to be visible - watch your tests being run. | No|
62
+ | `WEBDRIVER_HEADLESS` |- | When running locally, set to `false` to allow Chrome tests to be visible - watch your tests being run. | No|
63
63
  | `QA_ADDITIONAL_REPOSITORY_STORAGE` |- | The name of additional, non-default storage to be used with tests tagged `repository_storage`, run via the `Test::Instance::RepositoryStorage` scenario. Note: Admin access is required to change repository storage. | No|
64
64
  | `QA_PRAEFECT_REPOSITORY_STORAGE` |- | The name of repository storage using Praefect. Note: Admin access is required to change repository storage. | No|
65
65
  | `QA_COOKIES` |- | Optionally set to "cookie1=value;cookie2=value" in order to add a cookie to every request. This can be used to set the canary cookie by setting it to "gitlab_canary=true". | No|
@@ -813,6 +813,15 @@ $ export EE_LICENSE=$(cat /path/to/gitlab_license)
813
813
  $ gitlab-qa Test::Instance::Airgapped EE -- --tag smoke
814
814
  ```
815
815
 
816
+ ### `Test::Instance::Image CE|EE|<full image address> --omnibus-config object_storage`
817
+
818
+ This orchestrated scenario runs tests from the test suite against a GitLab instance which has object storage configured instead of using local storage. The omnibus configuration `object_storage` ([configurator](configuring_omnibus.md)), uses Minio and `object_storage_aws` uses an AWS S3 account with credentials configured in the pipeline as CI Variables (available on 1Password). Requires:
819
+
820
+ * `AWS_S3_REGION` - Region where the bucket is created. To optimize latency, minimize costs, or address regulatory requirements, choose any AWS Region that is geographically close to you.
821
+ * `AWS_S3_KEY_ID` - Key ID for the user accessing the bucket.
822
+ * `AWS_S3_ACCESS_KEY` - Access Key for the user accessing the bucket.
823
+ * `AWS_S3_BUCKET_NAME` - The name of the bucket where objects are stored. After a bucket is created, the name of that bucket cannot be used by another AWS account in any AWS Region until the bucket is deleted.
824
+
816
825
  ### `Test::Instance::Geo EE|<full image address>:nightly|latest|any_tag http://geo-primary.gitlab http://geo-secondary.gitlab`
817
826
 
818
827
  This scenario will run tests tagged `:geo` against a live Geo deployment, by spinning up a GitLab QA (`gitlab/gitlab-qa`)
data/gitlab-qa.gemspec CHANGED
@@ -28,6 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.add_development_dependency 'rspec', '~> 3.7'
29
29
  spec.add_development_dependency 'rubocop', '~> 0.82.0'
30
30
  spec.add_development_dependency 'rubocop-rspec', '~> 1.36'
31
+ spec.add_development_dependency 'solargraph', '~> 0.41'
31
32
  spec.add_development_dependency 'webmock', '3.7.0'
32
33
  spec.add_runtime_dependency 'activesupport', '~> 6.0.2'
33
34
  spec.add_runtime_dependency 'gitlab', '~> 4.16.1'
data/lib/gitlab/qa.rb CHANGED
@@ -14,6 +14,7 @@ module Gitlab
14
14
  autoload :Default, 'gitlab/qa/runtime/omnibus_configurations/default'
15
15
  autoload :Packages, 'gitlab/qa/runtime/omnibus_configurations/packages'
16
16
  autoload :ObjectStorage, 'gitlab/qa/runtime/omnibus_configurations/object_storage'
17
+ autoload :ObjectStorageAws, 'gitlab/qa/runtime/omnibus_configurations/object_storage_aws'
17
18
  autoload :LicenseMode, 'gitlab/qa/runtime/omnibus_configurations/license_mode'
18
19
  end
19
20
  end
@@ -66,6 +67,7 @@ module Gitlab
66
67
  autoload :SSHTunnel, 'gitlab/qa/scenario/test/integration/ssh_tunnel'
67
68
  autoload :MTLS, 'gitlab/qa/scenario/test/integration/mtls'
68
69
  autoload :ClientSSL, 'gitlab/qa/scenario/test/integration/client_ssl'
70
+ autoload :Registry, 'gitlab/qa/scenario/test/integration/registry'
69
71
  end
70
72
 
71
73
  module Sanity
@@ -92,7 +92,12 @@ module Gitlab
92
92
  'DEPLOY_VERSION' => :deploy_version,
93
93
  'GITLAB_QA_USER_AGENT' => :gitlab_qa_user_agent,
94
94
  'GEO_FAILOVER' => :geo_failover,
95
- 'GITLAB_INITIAL_ROOT_PASSWORD' => :initial_root_password
95
+ 'GITLAB_INITIAL_ROOT_PASSWORD' => :initial_root_password,
96
+ 'GITLAB_TLS_CERTIFICATE' => :gitlab_tls_certificate,
97
+ 'AWS_S3_REGION' => :aws_s3_region,
98
+ 'AWS_S3_KEY_ID' => :aws_s3_key_id,
99
+ 'AWS_S3_ACCESS_KEY' => :aws_s3_access_key,
100
+ 'AWS_S3_BUCKET_NAME' => :aws_s3_bucket_name
96
101
  }.freeze
97
102
 
98
103
  ENV_VARIABLES.each do |env_name, method_name|
@@ -107,7 +112,7 @@ module Gitlab
107
112
  end
108
113
 
109
114
  def default_branch
110
- ENV['QA_DEFAULT_BRANCH'] || 'master'
115
+ ENV['QA_DEFAULT_BRANCH'] || 'main'
111
116
  end
112
117
 
113
118
  def gitlab_availability_timeout
@@ -126,10 +131,6 @@ module Gitlab
126
131
  ENV['GITLAB_API_BASE'] || 'https://gitlab.com/api/v4'
127
132
  end
128
133
 
129
- def gitlab_bot_multi_project_pipeline_polling_token
130
- ENV['GITLAB_BOT_MULTI_PROJECT_PIPELINE_POLLING_TOKEN']
131
- end
132
-
133
134
  def gitlab_ci_api_token
134
135
  ENV['GITLAB_CI_API_TOKEN']
135
136
  end
@@ -214,6 +215,22 @@ module Gitlab
214
215
  ENV['ELASTIC_VERSION'] || '6.4.2'.freeze
215
216
  end
216
217
 
218
+ def aws_s3_region
219
+ ENV['AWS_S3_REGION']
220
+ end
221
+
222
+ def aws_s3_key_id
223
+ ENV['AWS_S3_KEY_ID']
224
+ end
225
+
226
+ def aws_s3_access_key
227
+ ENV['AWS_S3_ACCESS_KEY']
228
+ end
229
+
230
+ def aws_s3_bucket_name
231
+ ENV['AWS_S3_BUCKET_NAME']
232
+ end
233
+
217
234
  def variables
218
235
  vars = {}
219
236
 
@@ -269,6 +286,12 @@ module Gitlab
269
286
  end
270
287
  end
271
288
 
289
+ def require_aws_s3_environment!
290
+ %w[AWS_S3_REGION AWS_S3_KEY_ID AWS_S3_ACCESS_KEY AWS_S3_BUCKET_NAME].each do |env_key|
291
+ raise ArgumentError, "Environment variable #{env_key} must be set to run AWS S3 object storage specs" unless ENV.key?(env_key)
292
+ end
293
+ end
294
+
272
295
  def require_initial_password!
273
296
  return unless ENV['GITLAB_INITIAL_ROOT_PASSWORD'].to_s.strip.empty?
274
297
 
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Gitlab
4
+ module QA
5
+ module Runtime
6
+ module OmnibusConfigurations
7
+ class ObjectStorageAws < Default
8
+ def configuration
9
+ Runtime::Env.require_aws_s3_environment!
10
+
11
+ <<~OMNIBUS
12
+ gitlab_rails['object_store']['enabled'] = true
13
+ gitlab_rails['object_store']['proxy_download'] = true
14
+ gitlab_rails['object_store']['connection'] = { 'provider' => 'AWS', 'region' => '#{Runtime::Env.aws_s3_region}', 'aws_access_key_id' => '#{Runtime::Env.aws_s3_key_id}', 'aws_secret_access_key' => '#{Runtime::Env.aws_s3_access_key}' }
15
+
16
+ gitlab_rails['object_store']['objects']['artifacts']['bucket'] = '#{Runtime::Env.aws_s3_bucket_name}'
17
+ gitlab_rails['object_store']['objects']['external_diffs']['bucket'] = '#{Runtime::Env.aws_s3_bucket_name}'
18
+ gitlab_rails['object_store']['objects']['lfs']['bucket'] = '#{Runtime::Env.aws_s3_bucket_name}'
19
+ gitlab_rails['object_store']['objects']['uploads']['bucket'] = '#{Runtime::Env.aws_s3_bucket_name}'
20
+ gitlab_rails['object_store']['objects']['packages']['bucket'] = '#{Runtime::Env.aws_s3_bucket_name}'
21
+ gitlab_rails['object_store']['objects']['dependency_proxy']['bucket'] = '#{Runtime::Env.aws_s3_bucket_name}'
22
+ gitlab_rails['object_store']['objects']['pages']['bucket'] = '#{Runtime::Env.aws_s3_bucket_name}'
23
+ gitlab_rails['object_store']['objects']['terraform_state']['bucket'] = '#{Runtime::Env.aws_s3_bucket_name}'
24
+ OMNIBUS
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -12,8 +12,8 @@ module Gitlab
12
12
  @commands = <<~AIRGAP_AND_VERIFY_COMMAND.split(/\n+/)
13
13
  # Should not fail before airgapping due to eg. DNS failure
14
14
  # Ping and wget check
15
- apt-get update && apt-get install -y iptables netcat
16
- nc -zv -w 10 #{gitlab_ip} 80 && (echo \"Regular connectivity netcat check passed.\" && exit 0) || (echo \"Regular connectivity netcat check failed.\" && exit 1)
15
+ apt-get update && apt-get install -y iptables nmap
16
+ nmap -sT #{gitlab_ip} -p 80 && (echo \"Regular connectivity nmap check passed.\" && exit 0) || (echo \"Regular connectivity nmap check failed.\" && exit 1)
17
17
  echo "Checking regular connectivity..." \
18
18
  && wget --retry-connrefused --waitretry=1 --read-timeout=15 --timeout=10 -t 2 http://registry.gitlab.com > /dev/null 2>&1 \
19
19
  && (echo "Regular connectivity wget check passed." && exit 0) || (echo "Regular connectivity wget check failed." && exit 1)
@@ -32,9 +32,9 @@ module Gitlab
32
32
  iptables -A INPUT -p tcp -m tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
33
33
 
34
34
  # Should now fail to ping and wget, port 80 should be open
35
- nc -zv -w 10 #{gitlab_ip} 80 && (echo \"Airgapped network faulty. Connectivity netcat check failed.\" && exit 1) || (echo \"Connectivity netcat check passed.\" && exit 0)
36
- nc -zv -w 10 127.0.0.1 22 && (echo "Airgapped connectivity port 22 check passed." && exit 0) || (echo "Airgapped connectivity port 22 check failed." && exit 1)
37
- nc -zv -w 10 127.0.0.1 80 && (echo "Airgapped connectivity port 80 check passed." && exit 0) || (echo "Airgapped connectivity port 80 check failed." && exit 1)
35
+ nmap -sT #{gitlab_ip} -p 80 && (echo \"Airgapped network faulty. Connectivity nmap check failed.\" && exit 1) || (echo \"Connectivity nmap check passed.\" && exit 0)
36
+ nmap -sT 127.0.0.1 -p 22 && (echo "Airgapped connectivity port 22 check passed." && exit 0) || (echo "Airgapped connectivity port 22 check failed." && exit 1)
37
+ nmap -sT 10 127.0.0.1 -p 80 && (echo "Airgapped connectivity port 80 check passed." && exit 0) || (echo "Airgapped connectivity port 80 check failed." && exit 1)
38
38
  echo "Checking airgapped connectivity..." \
39
39
  && wget --retry-connrefused --waitretry=1 --read-timeout=15 --timeout=10 -t 2 http://registry.gitlab.com > /dev/null 2>&1 \
40
40
  && (echo "Airgapped network faulty. Connectivity wget check failed." && exit 1) || (echo "Airgapped network confirmed. Connectivity wget check passed." && exit 0)
@@ -107,23 +107,24 @@ module Gitlab
107
107
  praefect['database_password'] = 'SQL_PASSWORD';
108
108
  praefect['database_dbname'] = 'praefect_production';
109
109
  praefect['database_sslmode'] = 'disable';
110
- praefect['postgres_queue_enabled'] = true;
111
- praefect['failover_enabled'] = true;
110
+ praefect['database_host_no_proxy'] = '#{@database}.#{@network}';
111
+ praefect['database_port_no_proxy'] = 5432;
112
112
  praefect['failover_election_strategy'] = 'per_repository';
113
113
  praefect['virtual_storages'] = {
114
114
  'default' => {
115
- '#{@primary_node_name}' => {
116
- 'address' => 'tcp://#{@primary_node_name}.#{@network}:8075',
117
- 'token' => 'PRAEFECT_INTERNAL_TOKEN',
118
- 'primary' => true
119
- },
120
- '#{@secondary_node_name}' => {
121
- 'address' => 'tcp://#{@secondary_node_name}.#{@network}:8075',
122
- 'token' => 'PRAEFECT_INTERNAL_TOKEN'
123
- },
124
- '#{@tertiary_node_name}' => {
125
- 'address' => 'tcp://#{@tertiary_node_name}.#{@network}:8075',
126
- 'token' => 'PRAEFECT_INTERNAL_TOKEN'
115
+ 'nodes' => {
116
+ '#{@primary_node_name}' => {
117
+ 'address' => 'tcp://#{@primary_node_name}.#{@network}:8075',
118
+ 'token' => 'PRAEFECT_INTERNAL_TOKEN'
119
+ },
120
+ '#{@secondary_node_name}' => {
121
+ 'address' => 'tcp://#{@secondary_node_name}.#{@network}:8075',
122
+ 'token' => 'PRAEFECT_INTERNAL_TOKEN'
123
+ },
124
+ '#{@tertiary_node_name}' => {
125
+ 'address' => 'tcp://#{@tertiary_node_name}.#{@network}:8075',
126
+ 'token' => 'PRAEFECT_INTERNAL_TOKEN'
127
+ }
127
128
  }
128
129
  }
129
130
  };
@@ -164,7 +165,7 @@ module Gitlab
164
165
  'gitaly_token' => 'PRAEFECT_EXTERNAL_TOKEN'
165
166
  }
166
167
  });
167
- gitaly['listen_addr'] = '0.0.0.0:8075';
168
+ gitaly['enable'] = false;
168
169
  gitlab_shell['secret_token'] = 'GITLAB_SHELL_SECRET_TOKEN';
169
170
  prometheus['scrape_configs'] = [
170
171
  {
@@ -27,6 +27,7 @@ module Gitlab
27
27
  'path' => '/var/opt/gitlab/git-data'
28
28
  }
29
29
  });
30
+ gitaly['enable'] = true;
30
31
  gitaly['listen_addr'] = '0.0.0.0:8075';
31
32
  gitaly['auth_token'] = 'secret-token';
32
33
  gitaly['storage'] = [
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Gitlab
4
+ module QA
5
+ module Scenario
6
+ module Test
7
+ module Integration
8
+ class Registry < Scenario::Template
9
+ def perform(release, *rspec_args)
10
+ Component::Gitlab.perform do |gitlab|
11
+ gitlab.release = release
12
+ gitlab.network = 'test'
13
+ gitlab.name = 'gitlab'
14
+ gitlab.tls = true
15
+
16
+ gitlab.omnibus_configuration << <<~OMNIBUS
17
+ external_url 'https://#{gitlab.name}.#{gitlab.network}';
18
+ registry_external_url 'https://#{gitlab.name}.#{gitlab.network}:5050';
19
+
20
+ letsencrypt['enable'] = false;
21
+
22
+ nginx['redirect_http_to_https'] = true;
23
+ nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab.test.crt";
24
+ nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab.test.key";
25
+ registry_nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab.test.crt";
26
+ registry_nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab.test.key";
27
+ OMNIBUS
28
+
29
+ gitlab.instance do
30
+ Component::Specs.perform do |specs|
31
+ specs.suite = 'Test::Integration::Registry'
32
+ specs.release = gitlab.release
33
+ specs.network = gitlab.network
34
+ specs.args = [gitlab.address, *rspec_args]
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -1,5 +1,5 @@
1
1
  module Gitlab
2
2
  module QA
3
- VERSION = '7.3.1'.freeze
3
+ VERSION = '7.7.0'.freeze
4
4
  end
5
5
  end
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: 7.3.1
4
+ version: 7.7.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: 2021-05-21 00:00:00.000000000 Z
11
+ date: 2021-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '1.36'
111
+ - !ruby/object:Gem::Dependency
112
+ name: solargraph
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '0.41'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '0.41'
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: webmock
113
127
  requirement: !ruby/object:Gem::Requirement
@@ -279,6 +293,7 @@ files:
279
293
  - lib/gitlab/qa/runtime/omnibus_configurations/default.rb
280
294
  - lib/gitlab/qa/runtime/omnibus_configurations/license_mode.rb
281
295
  - lib/gitlab/qa/runtime/omnibus_configurations/object_storage.rb
296
+ - lib/gitlab/qa/runtime/omnibus_configurations/object_storage_aws.rb
282
297
  - lib/gitlab/qa/runtime/omnibus_configurations/packages.rb
283
298
  - lib/gitlab/qa/runtime/scenario.rb
284
299
  - lib/gitlab/qa/runtime/token_finder.rb
@@ -314,6 +329,7 @@ files:
314
329
  - lib/gitlab/qa/scenario/test/integration/mattermost.rb
315
330
  - lib/gitlab/qa/scenario/test/integration/mtls.rb
316
331
  - lib/gitlab/qa/scenario/test/integration/praefect.rb
332
+ - lib/gitlab/qa/scenario/test/integration/registry.rb
317
333
  - lib/gitlab/qa/scenario/test/integration/saml.rb
318
334
  - lib/gitlab/qa/scenario/test/integration/smtp.rb
319
335
  - lib/gitlab/qa/scenario/test/integration/ssh_tunnel.rb
@@ -355,7 +371,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
355
371
  - !ruby/object:Gem::Version
356
372
  version: '0'
357
373
  requirements: []
358
- rubygems_version: 3.1.4
374
+ rubygems_version: 3.1.6
359
375
  signing_key:
360
376
  specification_version: 4
361
377
  summary: Integration tests for GitLab