gitlab-qa 14.9.0 → 14.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/.gitlab-ci.yml +3 -5
  3. data/.rubocop_todo.yml +0 -1
  4. data/Gemfile.lock +13 -13
  5. data/docs/what_tests_can_be_run.md +5 -21
  6. data/gitlab-qa.gemspec +1 -1
  7. data/lib/gitlab/qa/component/base.rb +20 -10
  8. data/lib/gitlab/qa/component/chaos.rb +1 -1
  9. data/lib/gitlab/qa/component/gitaly.rb +2 -1
  10. data/lib/gitlab/qa/component/gitaly_cluster.rb +1 -1
  11. data/lib/gitlab/qa/runner.rb +0 -13
  12. data/lib/gitlab/qa/runtime/env.rb +130 -120
  13. data/lib/gitlab/qa/runtime/omnibus_configurations/object_storage.rb +1 -1
  14. data/lib/gitlab/qa/scenario/test/instance/airgapped.rb +2 -2
  15. data/lib/gitlab/qa/scenario/test/instance/image.rb +1 -1
  16. data/lib/gitlab/qa/scenario/test/instance/relative_url.rb +1 -1
  17. data/lib/gitlab/qa/scenario/test/instance/repository_storage.rb +2 -2
  18. data/lib/gitlab/qa/scenario/test/integration/ai_gateway_base.rb +2 -1
  19. data/lib/gitlab/qa/scenario/test/integration/client_ssl.rb +1 -1
  20. data/lib/gitlab/qa/scenario/test/integration/elasticsearch.rb +2 -2
  21. data/lib/gitlab/qa/scenario/test/integration/gitlab_pages.rb +1 -1
  22. data/lib/gitlab/qa/scenario/test/integration/import.rb +1 -1
  23. data/lib/gitlab/qa/scenario/test/integration/integrations.rb +2 -2
  24. data/lib/gitlab/qa/scenario/test/integration/jira.rb +2 -2
  25. data/lib/gitlab/qa/scenario/test/integration/ldap.rb +3 -3
  26. data/lib/gitlab/qa/scenario/test/integration/mattermost.rb +1 -1
  27. data/lib/gitlab/qa/scenario/test/integration/metrics.rb +1 -1
  28. data/lib/gitlab/qa/scenario/test/integration/mtls.rb +1 -1
  29. data/lib/gitlab/qa/scenario/test/integration/opensearch.rb +2 -2
  30. data/lib/gitlab/qa/scenario/test/integration/registry.rb +1 -1
  31. data/lib/gitlab/qa/scenario/test/integration/registry_tls.rb +1 -1
  32. data/lib/gitlab/qa/scenario/test/integration/registry_with_cdn.rb +2 -2
  33. data/lib/gitlab/qa/scenario/test/integration/saml.rb +3 -3
  34. data/lib/gitlab/qa/scenario/test/integration/service_ping_disabled.rb +1 -1
  35. data/lib/gitlab/qa/scenario/test/integration/smtp.rb +1 -1
  36. data/lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb +1 -1
  37. data/lib/gitlab/qa/scenario/test/omnibus/update_from_previous.rb +1 -1
  38. data/lib/gitlab/qa/support/gitlab_upgrade_path.rb +2 -2
  39. data/lib/gitlab/qa/version.rb +1 -1
  40. data/rubocop/cop/gitlab/dangerous_interpolation.rb +0 -1
  41. metadata +4 -7
  42. data/lib/gitlab/qa/component/telegraf.rb +0 -175
  43. data/lib/gitlab/qa/scenario/test/instance/staging_geo.rb +0 -32
  44. data/lib/gitlab/qa/scenario/test/sanity/version.rb +0 -93
@@ -17,7 +17,7 @@ module Gitlab
17
17
  Component::Gitlab.perform do |gitlab|
18
18
  gitlab.release = release
19
19
  gitlab.volumes = @volumes
20
- gitlab.network = 'test'
20
+ gitlab.network = Runtime::Env.docker_network
21
21
  gitlab.name = Runtime::Env.qa_gitlab_hostname
22
22
  gitlab.seed_admin_token = @seed_admin_token
23
23
  gitlab.tls = Runtime::Env.qa_gitlab_use_tls?
@@ -9,7 +9,7 @@ module Gitlab
9
9
  def perform(release, *rspec_args)
10
10
  Component::Gitlab.perform do |gitlab|
11
11
  gitlab.release = release
12
- gitlab.network = 'test'
12
+ gitlab.network = Runtime::Env.docker_network
13
13
  gitlab.relative_path = '/relative'
14
14
 
15
15
  gitlab.omnibus_configuration << "external_url '#{gitlab.address}'"
@@ -10,7 +10,7 @@ module Gitlab
10
10
  Component::Gitlab.perform do |gitlab|
11
11
  gitlab.release = QA::Release.new(release)
12
12
  gitlab.name = 'gitlab'
13
- gitlab.network = 'test'
13
+ gitlab.network = Runtime::Env.docker_network
14
14
  gitlab.omnibus_configuration << gitlab_omnibus_configuration
15
15
  cluster = Component::GitalyCluster.perform do |c|
16
16
  c.config = Component::GitalyCluster::GitalyClusterConfig.new(gitlab_name: 'gitlab')
@@ -22,7 +22,7 @@ module Gitlab
22
22
  cluster.join
23
23
 
24
24
  rspec_args << "--" unless rspec_args.include?('--')
25
- rspec_args << %w[--tag repository_storage]
25
+ rspec_args << "--tag repository_storage]"
26
26
 
27
27
  Component::Specs.perform do |specs|
28
28
  specs.suite = 'Test::Instance::All'
@@ -10,7 +10,7 @@ module Gitlab
10
10
  SETUP_DEST_PATH = '/tmp/setup-scripts'
11
11
 
12
12
  def initialize
13
- @network = 'test'
13
+ @network = Runtime::Env.docker_network
14
14
  @ai_gateway_name = 'ai-gateway'
15
15
  @ai_gateway_hostname = "#{@ai_gateway_name}.#{@network}"
16
16
  @ai_gateway_port = 5000
@@ -42,6 +42,7 @@ module Gitlab
42
42
  gitlab.network = @network
43
43
 
44
44
  gitlab.omnibus_gitlab_rails_env['AI_GATEWAY_URL'] = "http://#{@ai_gateway_hostname}:#{@ai_gateway_port}"
45
+ gitlab.omnibus_gitlab_rails_env['LLM_DEBUG'] = 'true'
45
46
 
46
47
  gitlab.set_ee_activation_code if @use_cloud_license
47
48
  end
@@ -9,7 +9,7 @@ module Gitlab
9
9
  def initialize
10
10
  @gitlab_name = 'gitlab'
11
11
  @spec_suite = 'Test::Instance::All'
12
- @network = 'test'
12
+ @network = Runtime::Env.docker_network
13
13
  @env = {}
14
14
  @tag = 'client_ssl'
15
15
  end
@@ -26,7 +26,7 @@ module Gitlab
26
26
  setup_elasticsearch_on gitlab
27
27
 
28
28
  Component::Elasticsearch.perform do |elastic|
29
- elastic.network = 'test'
29
+ elastic.network = Runtime::Env.docker_network
30
30
  elastic.instance do
31
31
  gitlab.instance do
32
32
  Runtime::Logger.info("Running #{spec_suite} specs!")
@@ -49,7 +49,7 @@ module Gitlab
49
49
 
50
50
  def setup_elasticsearch_on(instance)
51
51
  instance.name = gitlab_name
52
- instance.network = 'test'
52
+ instance.network = Runtime::Env.docker_network
53
53
  instance.elastic_url = 'http://elastic68:9200'
54
54
  instance.exec_commands = empty_index
55
55
  end
@@ -8,7 +8,7 @@ module Gitlab
8
8
  class GitlabPages < Scenario::Template
9
9
  def initialize
10
10
  @gitlab_name = 'gitlab-pages'
11
- @network = 'test'
11
+ @network = Runtime::Env.docker_network
12
12
  @pages_host = 'gitlab-pages.test'
13
13
  @pages_sandbox_name = 'gitlab-qa-sandbox-group-pages'
14
14
  @tag = 'gitlab_pages'
@@ -14,7 +14,7 @@ module Gitlab
14
14
  #
15
15
  class Import < Scenario::Template
16
16
  def initialize
17
- @network = "test"
17
+ @network = Runtime::Env.docker_network
18
18
  @source_gitlab = Component::Gitlab.new.tap { |gitlab| gitlab.network = @network }
19
19
  @target_gitlab = Component::Gitlab.new.tap { |gitlab| gitlab.network = @network }
20
20
  @mock_server = Component::MockServer.new.tap do |server|
@@ -9,12 +9,12 @@ module Gitlab
9
9
  def perform(release, *rspec_args)
10
10
  Component::Gitlab.perform do |gitlab|
11
11
  gitlab.release = QA::Release.new(release)
12
- gitlab.network = 'test'
12
+ gitlab.network = Runtime::Env.docker_network
13
13
  gitlab.name = 'gitlab-integrations'
14
14
  gitlab.instance do
15
15
  Component::Specs.perform do |specs|
16
16
  rspec_args << '--' unless rspec_args.include?('--')
17
- rspec_args << %w[--tag integrations]
17
+ rspec_args << "--tag integrations"
18
18
  specs.suite = 'Test::Instance::All'
19
19
  specs.hostname = "qa-e2e-specs.#{gitlab.network}"
20
20
  specs.release = gitlab.release
@@ -9,7 +9,7 @@ module Gitlab
9
9
  def perform(release, *rspec_args)
10
10
  Component::Gitlab.perform do |gitlab|
11
11
  gitlab.release = QA::Release.new(release)
12
- gitlab.network = 'test'
12
+ gitlab.network = Runtime::Env.docker_network
13
13
  gitlab.name = 'gitlab-jira'
14
14
 
15
15
  Component::Jira.perform do |jira|
@@ -21,7 +21,7 @@ module Gitlab
21
21
  Runtime::Logger.info('Running Jira specs!')
22
22
 
23
23
  rspec_args << "--" unless rspec_args.include?('--')
24
- rspec_args << %w[--tag jira]
24
+ rspec_args << "--tag jira"
25
25
 
26
26
  Component::Specs.perform do |specs|
27
27
  specs.suite = 'Test::Instance::All'
@@ -21,7 +21,7 @@ module Gitlab
21
21
 
22
22
  def initialize
23
23
  @ldap_name = 'ldap-server'
24
- @network = 'test'
24
+ @network = Runtime::Env.docker_network
25
25
  end
26
26
 
27
27
  def configure_omnibus(gitlab)
@@ -69,7 +69,7 @@ module Gitlab
69
69
  def orchestrate_ldap(&block)
70
70
  Component::LDAP.perform do |ldap|
71
71
  ldap.name = 'ldap-server'
72
- ldap.network = 'test'
72
+ ldap.network = Runtime::Env.docker_network
73
73
  ldap.set_gitlab_credentials
74
74
  ldap.tls = tls
75
75
 
@@ -81,7 +81,7 @@ module Gitlab
81
81
  Component::Gitlab.perform do |gitlab|
82
82
  gitlab.release = release
83
83
  gitlab.name = gitlab_name
84
- gitlab.network = 'test'
84
+ gitlab.network = Runtime::Env.docker_network
85
85
  gitlab.tls = tls
86
86
  configure_omnibus(gitlab)
87
87
 
@@ -9,7 +9,7 @@ module Gitlab
9
9
  def perform(release, *rspec_args)
10
10
  Component::Gitlab.perform do |gitlab|
11
11
  gitlab.release = release
12
- gitlab.network = 'test'
12
+ gitlab.network = Runtime::Env.docker_network
13
13
 
14
14
  mattermost_hostname = "mattermost.#{gitlab.network}"
15
15
  mattermost_external_url = "http://#{mattermost_hostname}"
@@ -12,7 +12,7 @@ module Gitlab
12
12
  def perform(release, *rspec_args)
13
13
  Component::Gitlab.perform do |gitlab|
14
14
  gitlab.release = release
15
- gitlab.network = 'test'
15
+ gitlab.network = Runtime::Env.docker_network
16
16
  gitlab.name = 'gitlab'
17
17
  gitlab.ports = [PUMA_METRICS_SERVER_PORT, SIDEKIQ_METRICS_SERVER_PORT]
18
18
 
@@ -10,7 +10,7 @@ module Gitlab
10
10
  @gitlab_name = 'gitlab'
11
11
  @gitaly_name = 'gitaly'
12
12
  @spec_suite = 'Test::Instance::All'
13
- @network = 'test'
13
+ @network = Runtime::Env.docker_network
14
14
  @env = {}
15
15
  @tag = 'mtls'
16
16
  end
@@ -27,7 +27,7 @@ module Gitlab
27
27
  setup_opensearch_on gitlab
28
28
 
29
29
  Component::Opensearch.perform do |opensearch|
30
- opensearch.network = 'test'
30
+ opensearch.network = Runtime::Env.docker_network
31
31
  opensearch.instance do
32
32
  gitlab.instance do
33
33
  Runtime::Logger.info("Running #{spec_suite} specs!")
@@ -50,7 +50,7 @@ module Gitlab
50
50
 
51
51
  def setup_opensearch_on(instance)
52
52
  instance.name = gitlab_name
53
- instance.network = 'test'
53
+ instance.network = Runtime::Env.docker_network
54
54
  instance.elastic_url = "http://elastic68:9200"
55
55
  instance.exec_commands = empty_index
56
56
  end
@@ -9,7 +9,7 @@ module Gitlab
9
9
  def perform(release, *rspec_args)
10
10
  Component::Gitlab.perform do |gitlab|
11
11
  gitlab.release = release
12
- gitlab.network = 'test'
12
+ gitlab.network = Runtime::Env.docker_network
13
13
  gitlab.name = 'gitlab'
14
14
 
15
15
  gitlab.omnibus_configuration << <<~OMNIBUS
@@ -9,7 +9,7 @@ module Gitlab
9
9
  def perform(release, *rspec_args)
10
10
  Component::Gitlab.perform do |gitlab|
11
11
  gitlab.release = release
12
- gitlab.network = 'test'
12
+ gitlab.network = Runtime::Env.docker_network
13
13
  gitlab.name = 'gitlab'
14
14
  gitlab.tls = true
15
15
 
@@ -11,9 +11,9 @@ module Gitlab
11
11
 
12
12
  Component::Gitlab.perform do |gitlab|
13
13
  gitlab.release = release
14
- gitlab.network = 'test'
14
+ gitlab.network = Runtime::Env.docker_network
15
15
  gitlab.name = 'gitlab'
16
- gitlab.seed_admin_token = false
16
+ gitlab.seed_admin_token = true
17
17
  sign_url_key_path = gitlab.create_key_file('GOOGLE_CDN_SIGNURL_KEY')
18
18
  cdn_gcloud_path = gitlab.create_key_file('GOOGLE_CDN_JSON_KEY')
19
19
 
@@ -18,19 +18,19 @@ module Gitlab
18
18
  # no-op
19
19
  end
20
20
 
21
- def perform(release, *rspec_args)
21
+ def perform(release, *rspec_args) # rubocop:disable Metrics/AbcSize
22
22
  release = QA::Release.new(release)
23
23
  before_perform(release)
24
24
 
25
25
  Component::Gitlab.perform do |gitlab|
26
26
  gitlab.release = release
27
- gitlab.network = 'test'
27
+ gitlab.network = Runtime::Env.docker_network
28
28
  gitlab.name = gitlab_name
29
29
  gitlab.set_accept_insecure_certs
30
30
 
31
31
  if saml_component
32
32
  Component::SAML.perform do |saml|
33
- saml.network = 'test'
33
+ saml.network = Runtime::Env.docker_network
34
34
  configure(gitlab, saml)
35
35
 
36
36
  saml.instance do
@@ -9,7 +9,7 @@ module Gitlab
9
9
  def perform(release, *rspec_args)
10
10
  Component::Gitlab.perform do |gitlab|
11
11
  gitlab.release = release
12
- gitlab.network = 'test'
12
+ gitlab.network = Runtime::Env.docker_network
13
13
 
14
14
  gitlab.omnibus_configuration << <<~OMNIBUS
15
15
  gitlab_rails['usage_ping_enabled'] = false;
@@ -28,7 +28,7 @@ module Gitlab
28
28
 
29
29
  Component::Gitlab.perform do |gitlab|
30
30
  gitlab.release = release
31
- gitlab.network = 'test'
31
+ gitlab.network = Runtime::Env.docker_network
32
32
  gitlab.name = gitlab_name
33
33
 
34
34
  Component::MailHog.perform do |mail_hog|
@@ -10,7 +10,7 @@ module Gitlab
10
10
 
11
11
  def initialize
12
12
  @spec_suite = 'Test::Instance::All'
13
- @network = 'test'
13
+ @network = Runtime::Env.docker_network
14
14
  @env = {}
15
15
  @tag = 'suggested_reviewer'
16
16
  @gitlab_name = 'gitlab-suggested-reviewer'
@@ -79,7 +79,7 @@ module Gitlab
79
79
  Component::Gitlab.perform do |gitlab|
80
80
  gitlab.release = release
81
81
  gitlab.volumes = volumes
82
- gitlab.network = 'test'
82
+ gitlab.network = Runtime::Env.docker_network
83
83
 
84
84
  if skip_setup
85
85
  gitlab.skip_server_hooks = true
@@ -82,9 +82,9 @@ module Gitlab
82
82
  # @return [String]
83
83
  def upgrade_path_yml
84
84
  @upgrade_path_yml ||= begin
85
- logger.info("Fetching gitlab upgrade path from 'gitlab-com/support/toolbox/upgrade-path' project")
85
+ logger.info("Fetching gitlab upgrade path from 'gitlab.com/gitlab-org/gitlab' project")
86
86
  HttpRequest.make_http_request(
87
- url: "https://gitlab.com/gitlab-com/support/toolbox/upgrade-path/-/raw/main/upgrade-path.yml"
87
+ url: "https://gitlab.com/gitlab-org/gitlab/-/raw/master/config/upgrade_path.yml"
88
88
  ).body
89
89
  end
90
90
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Gitlab
4
4
  module QA
5
- VERSION = '14.9.0'
5
+ VERSION = '14.11.0'
6
6
  end
7
7
  end
@@ -119,7 +119,6 @@ module RuboCop
119
119
  'GCS_CDN_BUCKET_NAME' => :gcs_cdn_bucket_name,
120
120
  'GCS_BUCKET_NAME' => :gcs_bucket_name,
121
121
  'SMOKE_ONLY' => :smoke_only,
122
- 'NO_ADMIN' => :no_admin,
123
122
  'CHROME_DISABLE_DEV_SHM' => :chrome_disable_dev_shm,
124
123
  'COLORIZED_LOGS' => :colorized_logs,
125
124
  'FIPS' => :fips,
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: 14.9.0
4
+ version: 14.11.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: 2024-05-02 00:00:00.000000000 Z
11
+ date: 2024-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '3.7'
117
+ version: '3.13'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '3.7'
124
+ version: '3.13'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: simplecov
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -409,7 +409,6 @@ files:
409
409
  - lib/gitlab/qa/component/staging.rb
410
410
  - lib/gitlab/qa/component/staging_ref.rb
411
411
  - lib/gitlab/qa/component/suggested_reviewer.rb
412
- - lib/gitlab/qa/component/telegraf.rb
413
412
  - lib/gitlab/qa/docker/command.rb
414
413
  - lib/gitlab/qa/docker/engine.rb
415
414
  - lib/gitlab/qa/docker/volumes.rb
@@ -442,7 +441,6 @@ files:
442
441
  - lib/gitlab/qa/scenario/test/instance/repository_storage.rb
443
442
  - lib/gitlab/qa/scenario/test/instance/smoke.rb
444
443
  - lib/gitlab/qa/scenario/test/instance/staging.rb
445
- - lib/gitlab/qa/scenario/test/instance/staging_geo.rb
446
444
  - lib/gitlab/qa/scenario/test/instance/staging_ref.rb
447
445
  - lib/gitlab/qa/scenario/test/instance/staging_ref_geo.rb
448
446
  - lib/gitlab/qa/scenario/test/integration/ai_gateway.rb
@@ -480,7 +478,6 @@ files:
480
478
  - lib/gitlab/qa/scenario/test/omnibus/image.rb
481
479
  - lib/gitlab/qa/scenario/test/omnibus/update_from_previous.rb
482
480
  - lib/gitlab/qa/scenario/test/omnibus/upgrade.rb
483
- - lib/gitlab/qa/scenario/test/sanity/version.rb
484
481
  - lib/gitlab/qa/service/cluster_provider/base.rb
485
482
  - lib/gitlab/qa/service/cluster_provider/k3d.rb
486
483
  - lib/gitlab/qa/service/kubernetes_cluster.rb
@@ -1,175 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'tempfile'
4
-
5
- module Gitlab
6
- module QA
7
- module Component
8
- # Component to collect docker metrics
9
- #
10
- class Telegraf < Base
11
- DOCKER_IMAGE = 'telegraf'
12
- DOCKER_IMAGE_TAG = '1.21-alpine'
13
- LOG_DIR = '/etc/telegraf/log'
14
-
15
- def initialize
16
- super
17
-
18
- @name = DOCKER_IMAGE
19
- @host_log_dir = "#{Runtime::Env.host_artifacts_dir}/#{@name}"
20
- @environment = Runtime::Env.variables.slice(
21
- 'QA_INFLUXDB_TOKEN',
22
- 'QA_INFLUXDB_URL',
23
- 'QA_RUN_TYPE',
24
- 'CI_JOB_NAME',
25
- 'CI_PIPELINE_ID'
26
- )
27
- end
28
-
29
- attr_reader :name, :host_log_dir, :telegraf_config
30
-
31
- # Start container
32
- #
33
- # @return [void]
34
- def start
35
- docker.run(image: image, tag: tag) do |command|
36
- set_command_args(command)
37
- set_volumes(command)
38
- set_environment(command)
39
- end
40
- end
41
-
42
- # Run prepare commands
43
- #
44
- # @return [void]
45
- def prepare
46
- @telegraf_config = File.open("#{Dir.mktmpdir(nil, ENV.fetch('CI_BUILDS_DIR', nil))}/telegraf.conf",
47
- 'w') do |file|
48
- file.write(config)
49
- file.path
50
- end
51
- FileUtils.mkdir_p(host_log_dir)
52
-
53
- prepare_docker_image
54
- prepare_docker_container
55
- end
56
-
57
- # Run teardown
58
- #
59
- # @return [void]
60
- def teardown
61
- return unless run_telegraf?
62
-
63
- super
64
- end
65
-
66
- private
67
-
68
- # Set custom run command arguments
69
- #
70
- # @param [Docker::Command] command
71
- # @return [void]
72
- def set_command_args(command)
73
- command << '-d'
74
- command << "--name #{name}"
75
- command << "--user root"
76
- command << "--entrypoint telegraf"
77
- end
78
-
79
- # Set volumes
80
- #
81
- # @param [Docker::Command] command
82
- # @return [void]
83
- def set_volumes(command)
84
- command.volume(host_log_dir, LOG_DIR)
85
- command.volume('/var/run/docker.sock', '/var/run/docker.sock')
86
- command.volume(telegraf_config, '/etc/telegraf/telegraf.conf', :ro)
87
- end
88
-
89
- # Set environment variables
90
- #
91
- # @param [Docker::Command] command
92
- # @return [void]
93
- def set_environment(command)
94
- environment.each { |k, v| command.env(k, v) }
95
- end
96
-
97
- # Run main entrypoint
98
- #
99
- # @return [void]
100
- def instance_no_teardown
101
- if run_telegraf?
102
- super
103
- else
104
- Runtime::Logger.debug("Skipping starting telegraf container!")
105
- yield self if block_given?
106
- end
107
- end
108
-
109
- # Should telegraf be started
110
- #
111
- # Run only on CI and skip if metrics explicitly disabled, run_type not set or influx params missing
112
- #
113
- # @return [Boolean]
114
- def run_telegraf?
115
- Runtime::Env.ci && Runtime::Env.qa_export_test_metrics? && Runtime::Env.qa_run_type && !missing_influx_config?
116
- end
117
-
118
- # Influxdb config params missing
119
- #
120
- # @return [Boolean]
121
- def missing_influx_config?
122
- environment.slice('QA_INFLUXDB_TOKEN', 'QA_INFLUXDB_URL').any? { |_k, v| v.blank? }
123
- end
124
-
125
- # Telegraf configuration
126
- #
127
- # @return [String]
128
- def config
129
- <<~CONFIG
130
- [global_tags]
131
- run_type = "${QA_RUN_TYPE}"
132
- pipeline_id = "${CI_PIPELINE_ID}"
133
- job_name = "${CI_JOB_NAME}"
134
-
135
- [agent]
136
- interval = "1s"
137
- round_interval = true
138
- metric_batch_size = 1000
139
- metric_buffer_limit = 10000
140
- collection_jitter = "0s"
141
- flush_interval = "10s"
142
- flush_jitter = "0s"
143
- precision = ""
144
- debug = true
145
- logtarget = "file"
146
- logfile = "#{LOG_DIR}/telegraf.log"
147
- hostname = ""
148
- omit_hostname = false
149
-
150
- [[outputs.influxdb_v2]]
151
- urls = ["${QA_INFLUXDB_URL}"]
152
- token = "${QA_INFLUXDB_TOKEN}"
153
- organization = "gitlab-qa"
154
- bucket = "test-env-stats"
155
-
156
- [[inputs.docker]]
157
- endpoint = "unix:///var/run/docker.sock"
158
- gather_services = false
159
- container_names = []
160
- source_tag = false
161
- container_name_include = []
162
- container_name_exclude = ["#{name}"]
163
- timeout = "5s"
164
- perdevice = false
165
- perdevice_include = []
166
- total = true
167
- total_include = ["cpu", "blkio", "network"]
168
- docker_label_include = []
169
- docker_label_exclude = []
170
- CONFIG
171
- end
172
- end
173
- end
174
- end
175
- end
@@ -1,32 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Gitlab
4
- module QA
5
- module Scenario
6
- module Test
7
- module Instance
8
- ##
9
- # Run test suite against staging.gitlab.com
10
- #
11
- class StagingGeo < DeploymentBase
12
- def initialize
13
- @suite = 'QA::EE::Scenario::Test::Geo'
14
- end
15
-
16
- def deployment_component
17
- Component::Staging
18
- end
19
-
20
- def non_rspec_args
21
- [
22
- '--primary-address', deployment_component::ADDRESS,
23
- '--secondary-address', deployment_component::GEO_SECONDARY_ADDRESS,
24
- '--without-setup'
25
- ]
26
- end
27
- end
28
- end
29
- end
30
- end
31
- end
32
- end