Class: Gitlab::QA::Scenario::Test::Integration::Praefect

Inherits:
GitalyCluster show all
Defined in:
lib/gitlab/qa/scenario/test/integration/praefect.rb

Direct Known Subclasses

Chaos

Instance Attribute Summary collapse

Attributes inherited from GitalyCluster

#config, #name

Instance Method Summary collapse

Methods inherited from GitalyCluster

#perform

Methods inherited from Gitlab::QA::Scenario::Template

perform, #perform

Constructor Details

#initializePraefect

Returns a new instance of Praefect.



11
12
13
14
15
16
# File 'lib/gitlab/qa/scenario/test/integration/praefect.rb', line 11

def initialize
  super

  @tag = nil
  @env = { QA_PRAEFECT_REPOSITORY_STORAGE: 'default' }
end

Instance Attribute Details

#gitlab_nameObject (readonly)

Returns the value of attribute gitlab_name.



9
10
11
# File 'lib/gitlab/qa/scenario/test/integration/praefect.rb', line 9

def gitlab_name
  @gitlab_name
end

#spec_suiteObject (readonly)

Returns the value of attribute spec_suite.



9
10
11
# File 'lib/gitlab/qa/scenario/test/integration/praefect.rb', line 9

def spec_suite
  @spec_suite
end

Instance Method Details

#gitlab_omnibus_configurationObject

rubocop:disable Metrics/AbcSize



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/gitlab/qa/scenario/test/integration/praefect.rb', line 18

def gitlab_omnibus_configuration # rubocop:disable Metrics/AbcSize
  <<~OMNIBUS
    external_url 'http://#{config.gitlab_name}.#{config.network}';

    git_data_dirs({
      'default' => {
        'gitaly_address' => 'tcp://#{config.praefect_addr}:#{config.praefect_port}',
        'gitaly_token' => 'PRAEFECT_EXTERNAL_TOKEN'
      },
      'gitaly' => {
        'gitaly_address' => 'tcp://#{config.gitlab_name}.#{config.network}:8075',
        'path' => '/var/opt/gitlab/git-data'
      }
    });
    gitaly['enable'] = true;
    gitaly['configuration'] = {
      auth: {
        token: 'secret-token',
      },
      listen_addr: '0.0.0.0:8075',
      tls: {
        certificate_path: '/etc/gitlab/ssl/gitaly.test.crt',
        key_path: '/etc/gitlab/ssl/gitaly.test.key',
      },
      storage: [
        {
          name: 'gitaly',
          path: '/var/opt/gitlab/git-data/repositories',
        },
      ],
    };
    gitlab_rails['gitaly_token'] = 'secret-token';
    gitlab_shell['secret_token'] = 'GITLAB_SHELL_SECRET_TOKEN';
    prometheus['scrape_configs'] = [
      {
        'job_name' => 'praefect',
        'static_configs' => [
          'targets' => [
            '#{config.praefect_addr}:9652'
          ]
        ]
      },
      {
        'job_name' => 'praefect-gitaly',
        'static_configs' => [
          'targets' => [
            '#{config.primary_node_addr}:9236',
            '#{config.secondary_node_addr}:9236',
            '#{config.tertiary_node_addr}:9236'
          ]
        ]
      }
    ];
  OMNIBUS
end