gitlab-qa 7.0.0 → 7.0.5

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: ce83d37d177260e577ff1ffbc8e606eab4bc449953d8fc9de669404371433014
4
- data.tar.gz: ef2a8ba114e9799c4d8b4cc71f3c098ac708b79e8573486305b9802d6bdf1826
3
+ metadata.gz: 11257d04b7148f3f1a25b08136c44734701fbf20fc3e1bd8cb8cc2315e67a4a4
4
+ data.tar.gz: 97585ca75030f229cc2eea291eebf1b85b31017a6ba0f31c8450eaebea636c74
5
5
  SHA512:
6
- metadata.gz: 22d88835fee7158e9e5829e5d5e415abfa85d157148514c21eb904eecf69a8e8c4a49dc6e3aaae0e35824fc8f3a2be2d0c983f2f8057c915bcd0332a2fbea41f
7
- data.tar.gz: 6e8007813c6258741ba516b011b8a5fc7efa1ee1ada5c385580477a18b02c35ac8e232370a80395fd3259f98058abaaffe11941c7ec9f8108a19dd36aafa4df3
6
+ metadata.gz: 587cf192a0d5ef209e7b94110510424078cbb765f81c0d4c1aab79eddfa690837a4da28e4f6121f031ac95cfbe760efe4ceffa3badebdbb83dad28ba0459de03
7
+ data.tar.gz: 66cadfafda69cf92cfece41609ad62de5dbfa5973c710d263f3848dbf8fbcd0d618d43b8ed0797ba30dd48f76c35e0e105ada659127f9a6f701b220aed1ea801
data/.gitlab-ci.yml CHANGED
@@ -75,9 +75,9 @@ rspec:
75
75
  reports:
76
76
  junit: gitlab-qa-run-*/**/rspec-*.xml
77
77
  script:
78
- - 'echo "Running: exe/gitlab-qa ${QA_SCENARIO:=Test::Instance::Image} ${RELEASE:=$DEFAULT_RELEASE} $GITLAB_QA_OPTS -- $QA_TESTS $QA_RSPEC_TAGS $RSPEC_REPORT_OPTS"'
79
- - exe/gitlab-qa ${QA_SCENARIO:=Test::Instance::Image} ${RELEASE:=$DEFAULT_RELEASE} $GITLAB_QA_OPTS -- $QA_TESTS $QA_RSPEC_TAGS $RSPEC_REPORT_OPTS || test_run_exit_code=$?
80
- - exe/gitlab-qa-report --update-screenshot-path "gitlab-qa-run-*/**/rspec-*.xml"
78
+ - 'echo "Running: bundle exec exe/gitlab-qa ${QA_SCENARIO:=Test::Instance::Image} ${RELEASE:=$DEFAULT_RELEASE} $GITLAB_QA_OPTS -- $QA_TESTS $QA_RSPEC_TAGS $RSPEC_REPORT_OPTS"'
79
+ - bundle exec exe/gitlab-qa ${QA_SCENARIO:=Test::Instance::Image} ${RELEASE:=$DEFAULT_RELEASE} $GITLAB_QA_OPTS -- $QA_TESTS $QA_RSPEC_TAGS $RSPEC_REPORT_OPTS || test_run_exit_code=$?
80
+ - bundle exec exe/gitlab-qa-report --update-screenshot-path "gitlab-qa-run-*/**/rspec-*.xml"
81
81
  - export GITLAB_QA_ACCESS_TOKEN="$GITLAB_QA_PRODUCTION_ACCESS_TOKEN"
82
82
  - if [ "$TOP_UPSTREAM_SOURCE_REF" == $TOP_UPSTREAM_DEFAULT_BRANCH ] || [[ "$TOP_UPSTREAM_SOURCE_JOB" == https://ops.gitlab.net* ]]; then exe/gitlab-qa-report --report-in-issues "gitlab-qa-run-*/**/rspec-*.json" --project "$QA_TESTCASES_REPORTING_PROJECT" || true; fi
83
83
  - exit $test_run_exit_code
@@ -153,7 +153,7 @@ rspec:
153
153
 
154
154
  ce:sanity-framework:
155
155
  script:
156
- - ./bin/expect_exit_code_and_text "exe/gitlab-qa Test::Instance::Image ${RELEASE:=CE} -- --tag framework" 1 "2 examples, 1 failure"
156
+ - ./bin/expect_exit_code_and_text "bundle exec exe/gitlab-qa Test::Instance::Image ${RELEASE:=CE} -- --tag framework" 1 "2 examples, 1 failure"
157
157
  extends:
158
158
  - .test
159
159
  - .high-capacity
@@ -161,7 +161,7 @@ ce:sanity-framework:
161
161
 
162
162
  ee:sanity-framework:
163
163
  script:
164
- - ./bin/expect_exit_code_and_text "exe/gitlab-qa Test::Instance::Image ${RELEASE:=EE} -- --tag framework" 1 "2 examples, 1 failure"
164
+ - ./bin/expect_exit_code_and_text "bundle exec exe/gitlab-qa Test::Instance::Image ${RELEASE:=EE} -- --tag framework" 1 "2 examples, 1 failure"
165
165
  extends:
166
166
  - .test
167
167
  - .high-capacity
@@ -170,8 +170,8 @@ ee:sanity-framework:
170
170
  # The custom jobs are for manually running specific/alternative tests in MRs, so we don't report them in issues
171
171
  ce:custom-parallel:
172
172
  script:
173
- - 'echo "Running: exe/gitlab-qa ${QA_SCENARIO:=Test::Instance::Image} ${RELEASE:=$DEFAULT_RELEASE} $GITLAB_QA_OPTS -- $QA_TESTS $QA_RSPEC_TAGS $RSPEC_REPORT_OPTS"'
174
- - exe/gitlab-qa ${QA_SCENARIO:=Test::Instance::Image} ${RELEASE:=$DEFAULT_RELEASE} $GITLAB_QA_OPTS -- $QA_TESTS $QA_RSPEC_TAGS $RSPEC_REPORT_OPTS
173
+ - 'echo "Running: bundle exec exe/gitlab-qa ${QA_SCENARIO:=Test::Instance::Image} ${RELEASE:=$DEFAULT_RELEASE} $GITLAB_QA_OPTS -- $QA_TESTS $QA_RSPEC_TAGS $RSPEC_REPORT_OPTS"'
174
+ - bundle exec exe/gitlab-qa ${QA_SCENARIO:=Test::Instance::Image} ${RELEASE:=$DEFAULT_RELEASE} $GITLAB_QA_OPTS -- $QA_TESTS $QA_RSPEC_TAGS $RSPEC_REPORT_OPTS
175
175
  extends:
176
176
  - .test
177
177
  - .high-capacity
@@ -182,8 +182,8 @@ ce:custom-parallel:
182
182
 
183
183
  ee:custom-parallel:
184
184
  script:
185
- - 'echo "Running: exe/gitlab-qa ${QA_SCENARIO:=Test::Instance::Image} ${RELEASE:=$DEFAULT_RELEASE} $GITLAB_QA_OPTS -- $QA_TESTS $QA_RSPEC_TAGS $RSPEC_REPORT_OPTS"'
186
- - exe/gitlab-qa ${QA_SCENARIO:=Test::Instance::Image} ${RELEASE:=$DEFAULT_RELEASE} $GITLAB_QA_OPTS -- $QA_TESTS $QA_RSPEC_TAGS $RSPEC_REPORT_OPTS
185
+ - 'echo "Running: bundle exec exe/gitlab-qa ${QA_SCENARIO:=Test::Instance::Image} ${RELEASE:=$DEFAULT_RELEASE} $GITLAB_QA_OPTS -- $QA_TESTS $QA_RSPEC_TAGS $RSPEC_REPORT_OPTS"'
186
+ - bundle exec exe/gitlab-qa ${QA_SCENARIO:=Test::Instance::Image} ${RELEASE:=$DEFAULT_RELEASE} $GITLAB_QA_OPTS -- $QA_TESTS $QA_RSPEC_TAGS $RSPEC_REPORT_OPTS
187
187
  extends:
188
188
  - .test
189
189
  - .high-capacity
@@ -315,14 +315,14 @@ ee:repository_storage-quarantine:
315
315
  # The Test::Omnibus::Image scenarios don't run the E2E tests so they don't need to report test results
316
316
  ce:image:
317
317
  script:
318
- - exe/gitlab-qa Test::Omnibus::Image ${RELEASE:=CE}
318
+ - bundle exec exe/gitlab-qa Test::Omnibus::Image ${RELEASE:=CE}
319
319
  extends:
320
320
  - .test
321
321
  - .ce-qa
322
322
 
323
323
  ee:image:
324
324
  script:
325
- - exe/gitlab-qa Test::Omnibus::Image ${RELEASE:=EE}
325
+ - bundle exec exe/gitlab-qa Test::Omnibus::Image ${RELEASE:=EE}
326
326
  extends:
327
327
  - .test
328
328
  - .ee-qa
@@ -331,7 +331,7 @@ ee:image:
331
331
  # So instead we include the script here again, with two release variables
332
332
  ce:update:
333
333
  script:
334
- - exe/gitlab-qa Test::Omnibus::Update ${RELEASE:=CE} ${RELEASE:=CE} -- $RSPEC_REPORT_OPTS || test_run_exit_code=$?
334
+ - bundle exec exe/gitlab-qa Test::Omnibus::Update ${RELEASE:=CE} ${RELEASE:=CE} -- $RSPEC_REPORT_OPTS || test_run_exit_code=$?
335
335
  - export GITLAB_QA_ACCESS_TOKEN="$GITLAB_QA_PRODUCTION_ACCESS_TOKEN"
336
336
  - if [ "$TOP_UPSTREAM_SOURCE_REF" == $TOP_UPSTREAM_DEFAULT_BRANCH ] || [[ "$TOP_UPSTREAM_SOURCE_JOB" == https://ops.gitlab.net* ]]; then exe/gitlab-qa-report --report-in-issues "gitlab-qa-run-*/**/rspec-*.json" --project "$QA_TESTCASES_REPORTING_PROJECT" || true; fi
337
337
  - exit $test_run_exit_code
@@ -345,7 +345,7 @@ ce:update:
345
345
 
346
346
  ce:update-quarantine:
347
347
  script:
348
- - exe/gitlab-qa Test::Omnibus::Update ${RELEASE:=CE} ${RELEASE:=CE} -- --tag quarantine --tag ~orchestrated $RSPEC_REPORT_OPTS || test_run_exit_code=$?
348
+ - bundle exec exe/gitlab-qa Test::Omnibus::Update ${RELEASE:=CE} ${RELEASE:=CE} -- --tag quarantine --tag ~orchestrated $RSPEC_REPORT_OPTS || test_run_exit_code=$?
349
349
  - export GITLAB_QA_ACCESS_TOKEN="$GITLAB_QA_PRODUCTION_ACCESS_TOKEN"
350
350
  - if [ "$TOP_UPSTREAM_SOURCE_REF" == $TOP_UPSTREAM_DEFAULT_BRANCH ] || [[ "$TOP_UPSTREAM_SOURCE_JOB" == https://ops.gitlab.net* ]]; then exe/gitlab-qa-report --report-in-issues "gitlab-qa-run-*/**/rspec-*.json" --project "$QA_TESTCASES_REPORTING_PROJECT" || true; fi
351
351
  - exit $test_run_exit_code
@@ -358,7 +358,7 @@ ce:update-quarantine:
358
358
 
359
359
  ee:update:
360
360
  script:
361
- - exe/gitlab-qa Test::Omnibus::Update ${RELEASE:=EE} ${RELEASE:=EE} -- $RSPEC_REPORT_OPTS || test_run_exit_code=$?
361
+ - bundle exec exe/gitlab-qa Test::Omnibus::Update ${RELEASE:=EE} ${RELEASE:=EE} -- $RSPEC_REPORT_OPTS || test_run_exit_code=$?
362
362
  - export GITLAB_QA_ACCESS_TOKEN="$GITLAB_QA_PRODUCTION_ACCESS_TOKEN"
363
363
  - if [ "$TOP_UPSTREAM_SOURCE_REF" == $TOP_UPSTREAM_DEFAULT_BRANCH ] || [[ "$TOP_UPSTREAM_SOURCE_JOB" == https://ops.gitlab.net* ]]; then exe/gitlab-qa-report --report-in-issues "gitlab-qa-run-*/**/rspec-*.json" --project "$QA_TESTCASES_REPORTING_PROJECT" || true; fi
364
364
  - exit $test_run_exit_code
@@ -372,7 +372,7 @@ ee:update:
372
372
 
373
373
  ee:update-quarantine:
374
374
  script:
375
- - exe/gitlab-qa Test::Omnibus::Update ${RELEASE:=EE} ${RELEASE:=EE} -- --tag quarantine --tag ~orchestrated $RSPEC_REPORT_OPTS || test_run_exit_code=$?
375
+ - bundle exec exe/gitlab-qa Test::Omnibus::Update ${RELEASE:=EE} ${RELEASE:=EE} -- --tag quarantine --tag ~orchestrated $RSPEC_REPORT_OPTS || test_run_exit_code=$?
376
376
  - export GITLAB_QA_ACCESS_TOKEN="$GITLAB_QA_PRODUCTION_ACCESS_TOKEN"
377
377
  - if [ "$TOP_UPSTREAM_SOURCE_REF" == $TOP_UPSTREAM_DEFAULT_BRANCH ] || [[ "$TOP_UPSTREAM_SOURCE_JOB" == https://ops.gitlab.net* ]]; then exe/gitlab-qa-report --report-in-issues "gitlab-qa-run-*/**/rspec-*.json" --project "$QA_TESTCASES_REPORTING_PROJECT" || true; fi
378
378
  - exit $test_run_exit_code
@@ -386,7 +386,7 @@ ee:update-quarantine:
386
386
  # The Test::Omnibus::Upgrade scenario isn't run on master (because it always uses the latest CE/EE image) so we don't report the test results in issues
387
387
  ce:upgrade:
388
388
  script:
389
- - exe/gitlab-qa Test::Omnibus::Upgrade CE -- $RSPEC_REPORT_OPTS
389
+ - bundle exec exe/gitlab-qa Test::Omnibus::Upgrade CE -- $RSPEC_REPORT_OPTS
390
390
  extends:
391
391
  - .test
392
392
  - .high-capacity
@@ -397,7 +397,7 @@ ce:upgrade:
397
397
 
398
398
  ce:upgrade-quarantine:
399
399
  script:
400
- - exe/gitlab-qa Test::Omnibus::Upgrade CE -- --tag quarantine --tag ~orchestrated $RSPEC_REPORT_OPTS
400
+ - bundle exec exe/gitlab-qa Test::Omnibus::Upgrade CE -- --tag quarantine --tag ~orchestrated $RSPEC_REPORT_OPTS
401
401
  extends:
402
402
  - .test
403
403
  - .high-capacity
@@ -407,7 +407,7 @@ ce:upgrade-quarantine:
407
407
 
408
408
  ee-previous-to-ce:update:
409
409
  script:
410
- - exe/gitlab-qa Test::Omnibus::Update EE CE -- $RSPEC_REPORT_OPTS
410
+ - bundle exec exe/gitlab-qa Test::Omnibus::Update EE CE -- $RSPEC_REPORT_OPTS
411
411
  extends:
412
412
  - .test
413
413
  - .high-capacity
@@ -416,7 +416,7 @@ ee-previous-to-ce:update:
416
416
 
417
417
  ee-previous-to-ce:update-quarantine:
418
418
  script:
419
- - exe/gitlab-qa Test::Omnibus::Update EE CE -- --tag quarantine --tag ~orchestrated $RSPEC_REPORT_OPTS
419
+ - bundle exec exe/gitlab-qa Test::Omnibus::Update EE CE -- --tag quarantine --tag ~orchestrated $RSPEC_REPORT_OPTS
420
420
  extends:
421
421
  - .test
422
422
  - .high-capacity
@@ -719,7 +719,7 @@ ce:object_storage:
719
719
  - .ce-qa
720
720
  - .rspec-report-opts
721
721
  variables:
722
- QA_SCENARIO: "Test::Integration::ObjectStorage"
722
+ GITLAB_QA_OPTS: "--omnibus-config object_storage"
723
723
 
724
724
  ce:object_storage-quarantine:
725
725
  extends:
@@ -729,7 +729,7 @@ ce:object_storage-quarantine:
729
729
  - .quarantine
730
730
  - .rspec-report-opts
731
731
  variables:
732
- QA_SCENARIO: "Test::Integration::ObjectStorage"
732
+ GITLAB_QA_OPTS: "--omnibus-config object_storage"
733
733
 
734
734
  ee:object_storage:
735
735
  extends:
@@ -738,7 +738,7 @@ ee:object_storage:
738
738
  - .ee-qa
739
739
  - .rspec-report-opts
740
740
  variables:
741
- QA_SCENARIO: "Test::Integration::ObjectStorage"
741
+ GITLAB_QA_OPTS: "--omnibus-config object_storage"
742
742
 
743
743
  ee:object_storage-quarantine:
744
744
  extends:
@@ -748,7 +748,7 @@ ee:object_storage-quarantine:
748
748
  - .quarantine
749
749
  - .rspec-report-opts
750
750
  variables:
751
- QA_SCENARIO: "Test::Integration::ObjectStorage"
751
+ GITLAB_QA_OPTS: "--omnibus-config object_storage"
752
752
 
753
753
  ee:packages:
754
754
  extends:
@@ -757,7 +757,7 @@ ee:packages:
757
757
  - .ee-qa
758
758
  - .rspec-report-opts
759
759
  variables:
760
- QA_SCENARIO: "Test::Integration::Packages"
760
+ GITLAB_QA_OPTS: "--omnibus-config packages"
761
761
 
762
762
  ee:packages-quarantine:
763
763
  extends:
@@ -767,7 +767,7 @@ ee:packages-quarantine:
767
767
  - .quarantine
768
768
  - .rspec-report-opts
769
769
  variables:
770
- QA_SCENARIO: "Test::Integration::Packages"
770
+ GITLAB_QA_OPTS: "--omnibus-config packages"
771
771
 
772
772
  ce:actioncable:
773
773
  extends:
@@ -989,8 +989,8 @@ ee:jira-quarantine:
989
989
  staging:
990
990
  script:
991
991
  - unset EE_LICENSE
992
- - 'echo "Running: exe/gitlab-qa Test::Instance::Staging ${RELEASE:=$DEFAULT_RELEASE} -- $QA_TESTS $QA_RSPEC_TAGS"'
993
- - exe/gitlab-qa Test::Instance::Staging ${RELEASE:=$DEFAULT_RELEASE} -- $QA_TESTS $QA_RSPEC_TAGS
992
+ - 'echo "Running: bundle exec exe/gitlab-qa Test::Instance::Staging ${RELEASE:=$DEFAULT_RELEASE} -- $QA_TESTS $QA_RSPEC_TAGS"'
993
+ - bundle exec exe/gitlab-qa Test::Instance::Staging ${RELEASE:=$DEFAULT_RELEASE} -- $QA_TESTS $QA_RSPEC_TAGS
994
994
  extends:
995
995
  - .test
996
996
  - .high-capacity
@@ -1011,7 +1011,7 @@ generate_test_session:
1011
1011
  - REPORT_ISSUE_URL
1012
1012
  script:
1013
1013
  - export GITLAB_QA_ACCESS_TOKEN="$GITLAB_QA_PRODUCTION_ACCESS_TOKEN"
1014
- - exe/gitlab-qa-report --generate-test-session "gitlab-qa-run-*/**/rspec-*.json" --project "$QA_TESTCASE_SESSIONS_PROJECT"
1014
+ - bundle exec exe/gitlab-qa-report --generate-test-session "gitlab-qa-run-*/**/rspec-*.json" --project "$QA_TESTCASE_SESSIONS_PROJECT"
1015
1015
 
1016
1016
  relate_test_failures:
1017
1017
  stage: report
@@ -1029,7 +1029,7 @@ relate_test_failures:
1029
1029
  QA_FAILURES_REPORTER_OPTIONS: ""
1030
1030
  script:
1031
1031
  - export GITLAB_QA_ACCESS_TOKEN="$GITLAB_QA_PRODUCTION_ACCESS_TOKEN"
1032
- - exe/gitlab-qa-report --relate-failure-issue "gitlab-qa-run-*/**/rspec-*.json" --project "$QA_FAILURES_REPORTING_PROJECT" --max-diff-ratio "$QA_FAILURES_MAX_DIFF_RATIO" $QA_FAILURES_REPORTER_OPTIONS
1032
+ - bundle exec exe/gitlab-qa-report --relate-failure-issue "gitlab-qa-run-*/**/rspec-*.json" --project "$QA_FAILURES_REPORTING_PROJECT" --max-diff-ratio "$QA_FAILURES_MAX_DIFF_RATIO" $QA_FAILURES_REPORTER_OPTIONS
1033
1033
 
1034
1034
  .notify_upstream_commit:
1035
1035
  stage: notify
@@ -534,6 +534,18 @@ $ gitlab-qa Test::Integration::Mattermost EE
534
534
 
535
535
  ### `Test::Integration::Packages CE|EE|<full image address>`
536
536
 
537
+ **Note: This Scenario no longer exists. See https://gitlab.com/gitlab-org/gitlab-qa/-/merge_requests/662**
538
+
539
+ To run Packages tests, you may [configure Omnibus](configuring_omnibus.md) to use the [Packages](https://gitlab.com/gitlab-org/gitlab-qa/-/blob/master/lib/gitlab/qa/runtime/omnibus_configurations/packages.rb) configurator.
540
+
541
+ Example:
542
+
543
+ ```
544
+ $ export EE_LICENSE=$(cat /path/to/Geo.gitlab_license)
545
+
546
+ $ gitlab-qa Test::Instance::Image EE --omnibus-config packages
547
+ ```
548
+
537
549
  This tests the GitLab Package Registry feature by setting
538
550
  `gitlab_rails['packages_enabled'] = true` in the Omnibus configuration
539
551
  before starting the GitLab container.
@@ -547,14 +559,6 @@ which runs only the tests with `:packages` metadata.
547
559
 
548
560
  - `EE_LICENSE`: A valid EE license.
549
561
 
550
- Example:
551
-
552
- ```
553
- $ export EE_LICENSE=$(cat /path/to/Geo.gitlab_license)
554
-
555
- $ gitlab-qa Test::Integration::Packages EE
556
- ```
557
-
558
562
  ### `Test::Integration::Praefect CE|EE|<full image address>`
559
563
 
560
564
  This tests [Praefect](https://docs.gitlab.com/ee/administration/gitaly/praefect.html),
data/gitlab-qa.gemspec CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  lib = File.expand_path('lib', __dir__)
2
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
5
  require 'gitlab/qa/version'
@@ -5,11 +7,11 @@ require 'gitlab/qa/version'
5
7
  Gem::Specification.new do |spec|
6
8
  spec.name = 'gitlab-qa'
7
9
  spec.version = Gitlab::QA::VERSION
8
- spec.authors = ['Grzegorz Bizon']
9
- spec.email = ['grzesiek.bizon@gmail.com']
10
+ spec.authors = ['GitLab Quality']
11
+ spec.email = ['gitlab-qa@gmail.com']
10
12
 
11
13
  spec.summary = 'Integration tests for GitLab'
12
- spec.homepage = 'http://about.gitlab.com'
14
+ spec.homepage = 'http://about.gitlab.com/'
13
15
  spec.license = 'MIT'
14
16
 
15
17
  spec.files = `git ls-files -z`
@@ -78,7 +78,7 @@ module Gitlab
78
78
  end
79
79
 
80
80
  def start # rubocop:disable Metrics/AbcSize
81
- docker.run(image, tag) do |command|
81
+ docker.run(image: image, tag: tag) do |command|
82
82
  command << "-d"
83
83
  command << "--name #{name}"
84
84
  command << "--net #{network}"
@@ -129,7 +129,7 @@ module Gitlab
129
129
  def pull
130
130
  return if Runtime::Env.skip_pull?
131
131
 
132
- docker.pull(image, tag)
132
+ docker.pull(image: image, tag: tag)
133
133
  end
134
134
 
135
135
  def process_exec_commands
@@ -13,7 +13,7 @@ module Gitlab
13
13
  end
14
14
 
15
15
  def start
16
- @docker.run(image, tag) do |command|
16
+ @docker.run(image: image, tag: tag) do |command|
17
17
  command << "-d"
18
18
  command << "--name #{name}"
19
19
  command << "--net #{network}"
@@ -33,7 +33,7 @@ module Gitlab
33
33
  @volumes[GITLAB_CERTIFICATES_PATH] = SSL_PATH
34
34
  @volumes[AUTHORITY_CERTIFICATES_PATH] = TRUSTED_PATH
35
35
 
36
- @omnibus_configuration ||= OmnibusConfiguration.new
36
+ @omnibus_configuration ||= Runtime::OmnibusConfiguration.new(Runtime::Scenario.omnibus_configuration)
37
37
 
38
38
  self.release = 'CE'
39
39
  end
@@ -100,7 +100,7 @@ module Gitlab
100
100
  def start # rubocop:disable Metrics/AbcSize
101
101
  ensure_configured!
102
102
 
103
- docker.run(image, tag) do |command|
103
+ docker.run(image: image, tag: tag) do |command|
104
104
  command << "-d -p #{port}"
105
105
  command << "--name #{name}"
106
106
  command << "--net #{network}"
@@ -206,20 +206,6 @@ module Gitlab
206
206
  @uri.scheme == 'https' ? { use_ssl: true, verify_mode: OpenSSL::SSL::VERIFY_NONE } : {}
207
207
  end
208
208
  end
209
-
210
- class OmnibusConfiguration
211
- def initialize
212
- @config = Runtime::Scenario.attributes[:omnibus_configuration] || []
213
- end
214
-
215
- def <<(configuration)
216
- @config << configuration
217
- end
218
-
219
- def to_s
220
- @config.to_s
221
- end
222
- end
223
209
  end
224
210
  end
225
211
  end
@@ -49,7 +49,10 @@ module Gitlab
49
49
  def start
50
50
  raise "Must set gitlab_hostname" unless @gitlab_hostname
51
51
 
52
- @docker.run(DOCKER_IMAGE, DOCKER_IMAGE_TAG, "-o StrictHostKeyChecking=no -N -R #{subdomain}:#{@gitlab_hostname}:80 #{ENV.fetch('TUNNEL_SSH_USER')}@#{tunnel_server_hostname}") do |command|
52
+ @docker.run(
53
+ image: DOCKER_IMAGE,
54
+ tag: DOCKER_IMAGE_TAG,
55
+ args: ["-o StrictHostKeyChecking=no -N -R #{subdomain}:#{@gitlab_hostname}:80 #{ENV.fetch('TUNNEL_SSH_USER')}@#{tunnel_server_hostname}"]) do |command|
53
56
  command << '-d '
54
57
  command << "--name #{name}"
55
58
  command << "--net #{network}"
@@ -16,7 +16,7 @@ module Gitlab
16
16
  end
17
17
 
18
18
  def start
19
- docker.run(image, tag) do |command|
19
+ docker.run(image: image, tag: tag) do |command|
20
20
  command << '-d '
21
21
  command << "--name #{name}"
22
22
  command << "--net #{network}"
@@ -63,7 +63,7 @@ module Gitlab
63
63
  def start
64
64
  # copy-service needed for bootstraping LDAP user:
65
65
  # https://github.com/osixia/docker-openldap#seed-ldap-database-with-ldif
66
- docker.run(image, tag, '--copy-service') do |command|
66
+ docker.run(image: image, tag: tag, args: ['--copy-service']) do |command|
67
67
  command << '-d '
68
68
  command << "--name #{name}"
69
69
  command << "--net #{network}"
@@ -19,7 +19,7 @@ module Gitlab
19
19
  end
20
20
 
21
21
  def start
22
- docker.run(image, tag) do |command|
22
+ docker.run(image: image, tag: tag) do |command|
23
23
  command << '-d '
24
24
  command << "--name #{name}"
25
25
  command << "--net #{network}"
@@ -70,7 +70,7 @@ module Gitlab
70
70
  def start # rubocop:disable Metrics/AbcSize
71
71
  # --compat needed until https://gitlab.com/gitlab-org/gitlab-workhorse/issues/210
72
72
  # is resolved
73
- docker.run(image, tag, "server", "--compat", DATA_DIR) do |command|
73
+ docker.run(image: image, tag: tag, args: ["server", "--compat", DATA_DIR]) do |command|
74
74
  command << '-d '
75
75
  command << "--name #{name}"
76
76
  command << "--net #{network}"
@@ -10,7 +10,7 @@ module Gitlab
10
10
  end
11
11
 
12
12
  def start
13
- @docker.run(image, tag) do |command|
13
+ @docker.run(image: image, tag: tag) do |command|
14
14
  command << "-d"
15
15
  command << "--name #{name}"
16
16
  command << "--net #{network}"
@@ -34,7 +34,7 @@ module Gitlab
34
34
 
35
35
  # rubocop:disable Metrics/AbcSize
36
36
  def start
37
- docker.run(image, tag) do |command|
37
+ docker.run(image: image, tag: tag) do |command|
38
38
  command << '-d '
39
39
  command << "--name #{name}"
40
40
  command << "--net #{network}"
@@ -23,7 +23,7 @@ module Gitlab
23
23
 
24
24
  @docker.login(**release.login_params) if release.login_params
25
25
 
26
- @docker.pull(qa_image) unless Runtime::Env.skip_pull?
26
+ @docker.pull(image: qa_image) unless Runtime::Env.skip_pull?
27
27
 
28
28
  puts "Running test suite `#{suite}` for #{release.project_name}"
29
29
 
@@ -43,7 +43,7 @@ module Gitlab
43
43
  feature_flag_sets << [] unless feature_flag_sets.any?
44
44
 
45
45
  feature_flag_sets.each do |feature_flag_set|
46
- @docker.run(qa_image, nil, suite, *args_with_flags(args, feature_flag_set)) do |command|
46
+ @docker.run(image: qa_image, args: [suite, *args_with_flags(args, feature_flag_set)]) do |command|
47
47
  command << "-t --rm --net=#{network || 'bridge'}"
48
48
 
49
49
  env.merge(Runtime::Env.variables).each do |key, value|
@@ -15,11 +15,11 @@ module Gitlab
15
15
  Docker::Command.execute(%(login --username "#{username}" --password "#{password}" #{registry}), mask_secrets: password)
16
16
  end
17
17
 
18
- def pull(image, tag = nil)
18
+ def pull(image:, tag: nil)
19
19
  Docker::Command.execute("pull #{full_image_name(image, tag)}")
20
20
  end
21
21
 
22
- def run(image, tag, *args)
22
+ def run(image:, tag: nil, args: [])
23
23
  Docker::Command.new('run').tap do |command|
24
24
  yield command if block_given?
25
25
 
@@ -57,7 +57,10 @@ module Gitlab
57
57
  end
58
58
  end
59
59
 
60
- args.reject! { |arg| gitlab_qa_options.include?(arg) }
60
+ # Remove arguments passed into GitLab QA preventing them from being
61
+ # passed into the specs
62
+ args = remove_gitlab_qa_args(args)
63
+
61
64
  if args.size >= 1
62
65
  load_omnibus_configurations
63
66
 
@@ -79,7 +82,22 @@ module Gitlab
79
82
  end
80
83
 
81
84
  def self.gitlab_qa_options
82
- @gitlab_qa_options ||= @options.top.list.map(&:long).flatten
85
+ @gitlab_qa_options ||= @options.top.list
86
+ end
87
+
88
+ # Take a set of arguments and remove them from the set of
89
+ # predefined GitLab QA arguments
90
+ # @param args Array the arguments to parse through and remove GitLab QA opts
91
+ # @return Arguments to be passed ultimately to the RSpec runner
92
+ def self.remove_gitlab_qa_args(args)
93
+ args.each_with_index do |arg, i|
94
+ gitlab_qa_options.each do |opt|
95
+ next unless opt.long.flatten.first == arg
96
+
97
+ args[i] = nil
98
+ args[i + 1] = nil if opt.is_a? OptionParser::Switch::RequiredArgument
99
+ end
100
+ end.compact
83
101
  end
84
102
 
85
103
  def self.load_omnibus_configurations
@@ -100,8 +118,8 @@ module Gitlab
100
118
  end
101
119
  rescue NameError
102
120
  raise <<~ERROR
103
- Invalid Omnibus Configuration `#{config}`.
104
- Possible configurations: #{Runtime::OmnibusConfigurations.constants.map { |c| c.to_s.underscore }.join(',')}"
121
+ Invalid Omnibus Configuration `#{config}`.
122
+ Possible configurations: #{Runtime::OmnibusConfigurations.constants.map { |c| c.to_s.underscore }.join(',')}"
105
123
  ERROR
106
124
  end
107
125
  end
@@ -6,8 +6,18 @@ module Gitlab
6
6
  module QA
7
7
  module Runtime
8
8
  class OmnibusConfiguration
9
- def initialize
9
+ # @param prefixed_config The configuration to be prefixed to the new configuration
10
+ def initialize(prefixed_config = nil)
10
11
  @config = ["# Generated by GitLab QA Omnibus Configurator at #{Time.now.strftime('%Y-%m-%d %H:%M:%S')}"]
12
+
13
+ return unless prefixed_config
14
+
15
+ # remove generation statement if it exists within the prefixed configuration that was passed
16
+ # and insert the rest AFTER the very first generation statement
17
+ config_to_insert = prefixed_config.to_s
18
+ generation_regexp = /# Generated by GitLab QA Omnibus Configurator.*\n/
19
+ config_to_insert = config_to_insert.gsub(generation_regexp, '') if config_to_insert.match?(generation_regexp)
20
+ @config.insert(1, config_to_insert)
11
21
  end
12
22
 
13
23
  def to_s
@@ -28,19 +38,20 @@ module Gitlab
28
38
  []
29
39
  end
30
40
 
31
- # Ensures no duplicate entries
41
+ # Ensures no duplicate entries and sanitizes configurations
32
42
  # @raise RuntimeError if competing configurations exist
33
43
  # rubocop:disable Metrics/AbcSize
34
44
  def sanitize!
35
45
  sanitized = @config.map do |config|
36
- next config if config.start_with?('#') # allow for comment
46
+ next config if config.start_with?('#') || config.match(/\w+\(/) # allow for comments and method invocations
37
47
 
38
48
  # sometimes "=" is part of a Hash. Only split based on the first "="
39
49
  k, v = config.split("=", 2)
40
50
  # make sure each config is well-formed
41
51
  # e.g., gitlab_rails['packages_enabled'] = true
42
52
  # NOT gitlab_rails['packages_enabled']=true
43
- "#{k.strip} = #{v.strip.tr('"', "'")}".strip
53
+
54
+ v.nil? ? k.strip : "#{k.strip} = #{v.strip.tr('"', "'")}".strip
44
55
  end.uniq
45
56
 
46
57
  errors = []
@@ -131,8 +131,7 @@ module Gitlab
131
131
 
132
132
  def gitaly_omnibus_configuration
133
133
  <<~OMNIBUS
134
- #{disable_other_services}
135
- prometheus['enable'] = true;
134
+ #{disable_other_services.sub(/(prometheus\['enable'\]) = false/, '\1 = true')}
136
135
  prometheus_monitoring['enable'] = false;
137
136
  gitaly['enable'] = true;
138
137
  gitaly['listen_addr'] = '0.0.0.0:8075';
@@ -27,7 +27,7 @@ module Gitlab
27
27
  end
28
28
 
29
29
  def ldap_servers_omnibus_config
30
- config = YAML.safe_load <<~CFG
30
+ YAML.safe_load <<~CFG
31
31
  main:
32
32
  label: LDAP
33
33
  host: #{ldap_hostname}
@@ -44,9 +44,6 @@ module Gitlab
44
44
  external_groups: ''
45
45
  sync_ssh_keys: false
46
46
  CFG
47
-
48
- # Quotes get eaten up when the string is set in the environment
49
- config.to_s.gsub("\"", "\\\"")
50
47
  end
51
48
 
52
49
  def ldap_hostname
@@ -1,5 +1,5 @@
1
1
  module Gitlab
2
2
  module QA
3
- VERSION = '7.0.0'.freeze
3
+ VERSION = '7.0.5'.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.0.0
4
+ version: 7.0.5
5
5
  platform: ruby
6
6
  authors:
7
- - Grzegorz Bizon
7
+ - GitLab Quality
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-25 00:00:00.000000000 Z
11
+ date: 2021-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control
@@ -194,7 +194,7 @@ dependencies:
194
194
  version: 1.5.7
195
195
  description:
196
196
  email:
197
- - grzesiek.bizon@gmail.com
197
+ - gitlab-qa@gmail.com
198
198
  executables:
199
199
  - gitlab-qa
200
200
  - gitlab-qa-report
@@ -333,7 +333,7 @@ files:
333
333
  - tls_certificates/gitlab/gitlab.test.crt
334
334
  - tls_certificates/gitlab/gitlab.test.csr
335
335
  - tls_certificates/gitlab/gitlab.test.key
336
- homepage: http://about.gitlab.com
336
+ homepage: http://about.gitlab.com/
337
337
  licenses:
338
338
  - MIT
339
339
  metadata: {}