gitlab-qa 5.13.2 → 5.13.7

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: bd00b4dae2903d37b27ad2af74518a9ec7cc5a24de8d19e7b13c5e8f068360be
4
- data.tar.gz: 0bc24e9ae52c867a0489344796c10ff348d6ae3cd985f3eb4094cf4a9b0fcd21
3
+ metadata.gz: 80567a3f14ce823c574bf448dd57339aa9ac95d39514b2c18ec4f8d9094c5e95
4
+ data.tar.gz: 4aa694b95e7bc667a58d63d7ac4c2606dbbd3d9a5819cd49e160dfae60b919cc
5
5
  SHA512:
6
- metadata.gz: cd7accfbcca5ebecd1cd58665f44c22078ba1bd32c85eac5fd957152a91cad2ffe17530ff7ed237910800b274bab213adc4c8b04345d1e5de3e0be9820c3d6ae
7
- data.tar.gz: 7dfac98a63c655d4c9d4db054a37a7557bec4a36a88707bac33363407bcd25215139e864d4889cf6d9fc3636862373a44addcc49315f0021d5aa68b303da771d
6
+ metadata.gz: 1a9f28e68a1717e93f7df4dda6de613185b3175417092517d56338d35af67679eed4a8d074e6ee5b6efd1f9d425b761aec3d9a8803d9d993341a9a28b1abde4c
7
+ data.tar.gz: da4ca897e44bd8c398c42f431370b73bb482fdb032b059053b759eb0c97646500057961b8a378a789b39cf5ab093e00a4a8577c36fbb6ef9353ce9116b24f98a
@@ -42,6 +42,9 @@ make a few changes to your `gdk/gitlab/config/gitlab.yml` file.
42
42
  $ 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
43
43
  ```
44
44
 
45
+ **Note:** The hostname of the URL provided to `gitlab-qa` must match the hostname configured for GDK.
46
+ 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.
47
+
45
48
  ### Running EE tests
46
49
 
47
50
  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).
@@ -28,60 +28,56 @@ For more details on the internals, please read the
28
28
 
29
29
  ## Supported GitLab environment variables
30
30
 
31
- * `GITLAB_USERNAME` - username to use when signing into GitLab
32
- * `GITLAB_PASSWORD` - password to use when signing into GitLab
33
- * `GITLAB_FORKER_USERNAME` - username to use for forking a project
34
- * `GITLAB_FORKER_PASSWORD` - password to use for forking a project
35
- * `GITLAB_QA_USERNAME_1` - username available in environments where signup is disabled
36
- * `GITLAB_QA_PASSWORD_1` - password for `GITLAB_QA_USERNAME_1` available in environments where signup is disabled (e.g. staging.gitlab.com)
37
- * `GITLAB_QA_USERNAME_2` - another username available in environments where signup is disabled
38
- * `GITLAB_QA_PASSWORD_2` - password for `GITLAB_QA_USERNAME_2` available in environments where signup is disabled (e.g. staging.gitlab.com)
39
- * `GITLAB_QA_USERNAME_3` - another username available in environments where signup is disabled
40
- * `GITLAB_QA_PASSWORD_3` - password for `GITLAB_QA_USERNAME_3` available in environments where signup is disabled (e.g. staging.gitlab.com)
41
- * `GITLAB_QA_USERNAME_4` - another username available in environments where signup is disabled
42
- * `GITLAB_QA_PASSWORD_4` - password for `GITLAB_QA_USERNAME_4` available in environments where signup is disabled (e.g. staging.gitlab.com)
43
- * `GITLAB_QA_USERNAME_5` - another username available in environments where signup is disabled
44
- * `GITLAB_QA_PASSWORD_5` - password for `GITLAB_QA_USERNAME_5` available in environments where signup is disabled (e.g. staging.gitlab.com)
45
- * `GITLAB_QA_USERNAME_6` - another username available in environments where signup is disabled
46
- * `GITLAB_QA_PASSWORD_6` - password for `GITLAB_QA_USERNAME_6` available in environments where signup is disabled (e.g. staging.gitlab.com)
47
- * `GITLAB_LDAP_USERNAME` - LDAP username to use when signing into GitLab
48
- * `GITLAB_LDAP_PASSWORD` - LDAP password to use when signing into GitLab
49
- * `GITLAB_ADMIN_USERNAME` - Admin username to use when adding a license
50
- * `GITLAB_ADMIN_PASSWORD` - Admin password to use when adding a license
51
- * `GITLAB_SANDBOX_NAME` - The sandbox group name the test suite is going to use (default: `gitlab-qa-sandbox`)
52
- * `GITLAB_QA_ACCESS_TOKEN` - A valid personal access token with the `api` scope.
53
- This is used for API access during tests, and is used in the
54
- [`Test::Instance::Staging`](#testinstancestaging) scenario to retrieve the
55
- version that staging is currently running. An existing token that is valid on
56
- staging can be found in the shared 1Password vault.
57
- * `GITLAB_QA_ADMIN_ACCESS_TOKEN` - A valid personal access token with the `api` scope
58
- from a user with admin access. Used for API access as an admin during tests.
59
- * `EE_LICENSE` - Enterprise Edition license
60
- * `QA_ARTIFACTS_DIR` - Path to a directory where artifacts (logs and screenshots)
61
- for failing tests will be saved (default: `/tmp/gitlab-qa`)
62
- * `DOCKER_HOST` - Docker host to run tests against (default: `http://localhost`)
63
- * `CHROME_HEADLESS` - when running locally, set to `false` to allow Chrome tests to be visible - watch your tests being run
64
- * `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
65
- * `QA_PRAEFECT_REPOSITORY_STORAGE` - the name of repository storage using Praefect.
66
- * `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"
67
- * `QA_DEBUG` - set to `true` to verbosely log page object actions. Note: if enabled be aware that sensitive data might be logged. If an input element has a QA selector with `password` in the name, data entered into the input element will be masked. If the element doesn't have `password` in its name it won't be masked.
68
- * `QA_LOG_PATH` - path to output debug logging to. If not set logging will be output to STDOUT
69
- * `QA_CAN_TEST_GIT_PROTOCOL_V2` - set to `false` to skip tests that require Git protocol v2 if your environment doesn't support it.
70
- * `QA_CAN_TEST_ADMIN_FEATURES` - set to `false` to skip tests that require admin access.
71
- * `QA_CAN_TEST_PRAEFECT` - set to `false` to skip tests that require Praefect to be running.
72
- * `QA_DISABLE_RSPEC_RETRY` - set to `true` to turn off retrying tests on failure.
73
- * `QA_SIMULATE_SLOW_CONNECTION` - set to `true` to configure Chrome's network settings to simulate a slow connection.
74
- * `QA_SLOW_CONNECTION_LATENCY_MS` - the additional latency (in ms) of the simulated slow connection (default 2000 ms).
75
- * `QA_SLOW_CONNECTION_THROUGHPUT_KBPS` - the maximum throughput (in kbps) of the simulated slow connection (default 32 kbps).
76
- * `QA_SKIP_PULL` - set to `true` to skip pulling docker images (e.g., to use one you built locally).
77
- * `GITHUB_USERNAME` - Username for authenticating with GitHub.
78
- * `GITHUB_PASSWORD` - Password for authenticating with GitHub.
79
- * `GITLAB_QA_LOOP_RUNNER_MINUTES` - Minutes to run and repeat a spec while using the '--loop' option; default value is 1 minute.
80
- * `CI_SERVER_PERSONAL_ACCESS_TOKEN` - Personal access token of the server that is running the CI pipeline. This is used for pulling CI_RUNNER information in certain tests.
81
- * `GEO_MAX_FILE_REPLICATION_TIME` - maximum time that a test will wait for a replicated file to appear on a Geo secondary node (default 120 seconds)
82
- * `GEO_MAX_DB_REPLICATION_TIME` - maximum time that a test will wait for database data to appear on a Geo secondary node (default 120 seconds)
83
- * `JIRA_ADMIN_USERNAME` - Username for authenticating with Jira server as admin.
84
- * `JIRA_ADMIN_PASSWORD` - Password for authenticating with Jira server as admin.
31
+ | Variable | Default | Description | Required |
32
+ |-----------------------|-----------|-----------------------|----------|
33
+ | `GITLAB_USERNAME` | `root` | Username to use when signing into GitLab. | Yes|
34
+ | `GITLAB_PASSWORD` | `5iveL!fe` | Password to use when signing into GitLab. | Yes|
35
+ | `GITLAB_FORKER_USERNAME`|- | Username to use for forking a project. | Yes|
36
+ | `GITLAB_FORKER_PASSWORD`|- | Password to use for forking a project. | Yes|
37
+ | `GITLAB_QA_USERNAME_1` |- | Username available in environments where signup is disabled. | No|
38
+ | `GITLAB_QA_PASSWORD_1` |- | Password for `GITLAB_QA_USERNAME_1` available in environments where signup is disabled (e.g. staging.gitlab.com). | No|
39
+ | `GITLAB_QA_USERNAME_2` |- | Another username available in environments where signup is disabled. | No|
40
+ | `GITLAB_QA_PASSWORD_2` |- | Password for `GITLAB_QA_USERNAME_2` available in environments where signup is disabled (e.g. staging.gitlab.com). | No|
41
+ | `GITLAB_QA_USERNAME_3` |- | Another username available in environments where signup is disabled. | No|
42
+ | `GITLAB_QA_PASSWORD_3` |- | Password for `GITLAB_QA_USERNAME_3` available in environments where signup is disabled (e.g. staging.gitlab.com). | No|
43
+ | `GITLAB_QA_USERNAME_4` |- | Another username available in environments where signup is disabled. | No|
44
+ | `GITLAB_QA_PASSWORD_4` |- | Password for `GITLAB_QA_USERNAME_4` available in environments where signup is disabled (e.g. staging.gitlab.com). | No|
45
+ | `GITLAB_QA_USERNAME_5` |- | Another username available in environments where signup is disabled. | No|
46
+ | `GITLAB_QA_PASSWORD_5` |- | Password for `GITLAB_QA_USERNAME_5` available in environments where signup is disabled (e.g. staging.gitlab.com). | No|
47
+ | `GITLAB_QA_USERNAME_6` |- | Another username available in environments where signup is disabled. | No|
48
+ | `GITLAB_QA_PASSWORD_6` |- | Password for `GITLAB_QA_USERNAME_6` available in environments where signup is disabled (e.g. staging.gitlab.com). | No|
49
+ | `GITLAB_LDAP_USERNAME` |- | LDAP username to use when signing into GitLab. | No|
50
+ | `GITLAB_LDAP_PASSWORD` |- | LDAP password to use when signing into GitLab. | No|
51
+ | `GITLAB_ADMIN_USERNAME` |- | Admin username to use when adding a license. | No|
52
+ | `GITLAB_ADMIN_PASSWORD` |- | Admin password to use when adding a license. | No|
53
+ | `GITLAB_SANDBOX_NAME` | `gitlab-qa-sandbox` | The sandbox group name the test suite is going to use. | No|
54
+ | `GITLAB_QA_ACCESS_TOKEN`|- | A valid personal access token with the `api` scope. This is used for API access during tests, and is used in the version that staging is currently running. An existing token that is valid on [`Test::Instance::Staging`](#testinstancestaging) scenario to retrieve the staging can be found in the shared 1Password vault. |No|
55
+ | `GITLAB_QA_ADMIN_ACCESS_TOKEN` |- | A valid personal access token with the `api` scope from a user with admin access. Used for API access as an admin during tests. | No|
56
+ | `EE_LICESEN` |- | Enterprise Edition license. | No|
57
+ | `QA_ARTIFACTS_DIR` |`/tmp/gitlab-qa`| Path to a directory where artifacts (logs and screenshots) for failing tests will be saved. | No|
58
+ | `DOCKER_HOST` |`http://localhost`| Docker host to run tests against. | No|
59
+ | `CHROME_HEADLESS` |- | When running locally, set to `false` to allow Chrome tests to be visible - watch your tests being run. | No|
60
+ | `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|
61
+ | `QA_PRAEFECT_REPOSITORY_STORAGE` |- | The name of repository storage using Praefect. Note: Admin access is required to change repository storage. | No|
62
+ | `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|
63
+ | `QA_DEBUG` |- | Set to `true` to verbosely log page object actions. Note: if enabled be aware that sensitive data might be logged. If an input element has a QA selector with `password` in the name, data entered into the input element will be masked. If the element doesn't have `password` in its name it won't be masked. | No|
64
+ | `QA_LOG_PATH` |- | Path to output debug logging to. If not set logging will be output to STDOUT. | No|
65
+ | `QA_CAN_TEST_GIT_PROTOCOL_V2` | `true` | Set to `false` to skip tests that require Git protocol v2 if your environment doesn't support it. | No|
66
+ | `QA_CAN_TEST_ADMIN_FEATURES` | `true` | Set to `false` to skip tests that require admin access. | No|
67
+ | `QA_CAN_TEST_PRAEFECT` | `true` | Set to `false` to skip tests that require Praefect to be running. | No|
68
+ | `QA_DISABLE_RSPEC_RETRY` |- | Set to `true` to turn off retrying tests on failure. | No|
69
+ | `QA_SIMULATE_SLOW_CONNECTION` |- | Set to `true` to configure Chrome's network settings to simulate a slow connection. | No|
70
+ | `QA_SLOW_CONNECTION_LATENCY_MS` | `2000` | The additional latency (in ms) of the simulated slow connection. | No|
71
+ | `QA_SLOW_CONNECTION_THROUGHPUT_KBPS` | `32` | The maximum throughput (in kbps) of the simulated slow connection. | No|
72
+ | `QA_SKIP_PULL` | `false` | Set to `true` to skip pulling docker images (e.g., to use one you built locally). | No|
73
+ | `GITHUB_USERNAME` |- | Username for authenticating with GitHub. | No|
74
+ | `GITHUB_PASSWORD` |- | Password for authenticating with GitHub. | No|
75
+ | `GITLAB_QA_LOOP_RUNNER_MINUTES` | `1` | Minutes to run and repeat a spec while using the '--loop' option; default value is 1 minute. | No|
76
+ | `CI_SERVER_PERSONAL_ACCESS_TOKEN` |- | Personal access token of the server that is running the CI pipeline. This is used for pulling CI_RUNNER information in certain tests. | No|
77
+ | `GEO_MAX_FILE_REPLICATION_TIME` | `120` | Maximum time that a test will wait for a replicated file to appear on a Geo secondary node. | No|
78
+ | `GEO_MAX_DB_REPLICATION_TIME` | `120` | Maximum time that a test will wait for database data to appear on a Geo secondary node. | No|
79
+ | `JIRA_ADMIN_USERNAME` |- | Username for authenticating with Jira server as admin. | No|
80
+ | `JIRA_ADMIN_PASSWORD` |- | Password for authenticating with Jira server as admin. | No|
85
81
 
86
82
  ## [Supported Remote Grid environment variables](./running_against_remote_grid.md)
87
83
 
@@ -6,6 +6,7 @@ module Gitlab
6
6
 
7
7
  module Runtime
8
8
  autoload :Env, 'gitlab/qa/runtime/env'
9
+ autoload :Scenario, 'gitlab/qa/runtime/scenario'
9
10
  autoload :TokenFinder, 'gitlab/qa/runtime/token_finder'
10
11
  end
11
12
 
@@ -63,6 +64,7 @@ module Gitlab
63
64
  end
64
65
 
65
66
  module Component
67
+ autoload :Base, 'gitlab/qa/component/base'
66
68
  autoload :Gitlab, 'gitlab/qa/component/gitlab'
67
69
  autoload :InternetTunnel, 'gitlab/qa/component/internet_tunnel'
68
70
  autoload :LDAP, 'gitlab/qa/component/ldap'
@@ -0,0 +1,131 @@
1
+ module Gitlab
2
+ module QA
3
+ module Component
4
+ class Base
5
+ include Scenario::Actable
6
+
7
+ attr_reader :docker
8
+ attr_accessor :volumes, :network, :environment
9
+ attr_writer :name, :exec_commands
10
+
11
+ def initialize
12
+ @docker = Docker::Engine.new
13
+ @environment = {}
14
+ @volumes = {}
15
+ @network_aliases = []
16
+
17
+ self.exec_commands = []
18
+ end
19
+
20
+ def add_network_alias(name)
21
+ @network_aliases.push(name)
22
+ end
23
+
24
+ def name
25
+ raise NotImplementedError, "#{self.class.name} must specify a default name"
26
+ end
27
+
28
+ def hostname
29
+ "#{name}.#{network}"
30
+ end
31
+
32
+ def image
33
+ return self.class.const_get('DOCKER_IMAGE') if self.class.const_defined?('DOCKER_IMAGE')
34
+
35
+ raise NotImplementedError, "#{self.class.name} must specify a docker image as DOCKER_IMAGE"
36
+ end
37
+
38
+ def tag
39
+ return self.class.const_get('DOCKER_IMAGE_TAG') if self.class.const_defined?('DOCKER_IMAGE_TAG')
40
+
41
+ raise NotImplementedError, "#{self.class.name} must specify a docker image tag as DOCKER_IMAGE_TAG"
42
+ end
43
+
44
+ def instance
45
+ prepare
46
+ start
47
+ reconfigure
48
+ wait_until_ready
49
+ process_exec_commands
50
+
51
+ yield self if block_given?
52
+ ensure
53
+ teardown
54
+ end
55
+
56
+ alias_method :launch_and_teardown_instance, :instance
57
+
58
+ def prepare
59
+ prepare_docker_image
60
+ prepare_network
61
+ end
62
+
63
+ def prepare_docker_image
64
+ return if Runtime::Env.skip_pull?
65
+
66
+ pull
67
+ end
68
+
69
+ def prepare_network
70
+ return if docker.network_exists?(network)
71
+
72
+ docker.network_create(network)
73
+ end
74
+
75
+ def start # rubocop:disable Metrics/AbcSize
76
+ docker.run(image, tag) do |command|
77
+ command << "-d"
78
+ command << "--name #{name}"
79
+ command << "--net #{network}"
80
+ command << "--hostname #{hostname}"
81
+
82
+ @volumes.to_h.each do |to, from|
83
+ command.volume(to, from, 'Z')
84
+ end
85
+
86
+ command.volume(File.join(Runtime::Env.host_artifacts_dir, name, 'logs'), '/var/log/gitlab', 'Z')
87
+
88
+ @environment.to_h.each do |key, value|
89
+ command.env(key, value)
90
+ end
91
+
92
+ @network_aliases.to_a.each do |network_alias|
93
+ command << "--network-alias #{network_alias}"
94
+ end
95
+ end
96
+ end
97
+
98
+ def restart
99
+ assert_name!
100
+
101
+ docker.restart(name)
102
+ end
103
+
104
+ def teardown
105
+ assert_name!
106
+
107
+ return unless docker.running?(name)
108
+
109
+ docker.stop(name)
110
+ docker.remove(name)
111
+ end
112
+
113
+ def pull
114
+ docker.pull(image, tag)
115
+ end
116
+
117
+ def process_exec_commands
118
+ exec_commands.each { |command| docker.exec(name, command) }
119
+ end
120
+
121
+ private
122
+
123
+ attr_reader :exec_commands, :wait_until_ready, :reconfigure
124
+
125
+ def assert_name!
126
+ raise 'Invalid instance name!' unless name
127
+ end
128
+ end
129
+ end
130
+ end
131
+ end
@@ -1,41 +1,19 @@
1
1
  module Gitlab
2
2
  module QA
3
3
  module Component
4
- class Elasticsearch
5
- include Scenario::Actable
6
-
7
- ELASTIC_IMAGE = 'docker.elastic.co/elasticsearch/elasticsearch'.freeze
8
-
9
- attr_reader :docker
10
- attr_accessor :environment, :network
11
- attr_writer :name
12
-
13
- def initialize
14
- @docker = Docker::Engine.new
15
- @environment = {}
16
- end
4
+ class Elasticsearch < Base
5
+ DOCKER_IMAGE = 'docker.elastic.co/elasticsearch/elasticsearch'.freeze
17
6
 
18
7
  def name
19
8
  @name ||= "elastic68"
20
9
  end
21
10
 
22
- def instance
23
- prepare
24
- start
25
- yield self
26
- ensure
27
- teardown
28
- end
29
-
30
- def prepare
31
- @docker.pull(ELASTIC_IMAGE, Runtime::Env.elastic_version)
32
- return if @docker.network_exists?(network)
33
-
34
- @docker.network_create(network)
11
+ def tag
12
+ Runtime::Env.elastic_version
35
13
  end
36
14
 
37
15
  def start
38
- @docker.run(ELASTIC_IMAGE, Runtime::Env.elastic_version) do |command|
16
+ @docker.run(image, tag) do |command|
39
17
  command << "-d"
40
18
  command << "--name #{name}"
41
19
  command << "--net #{network}"
@@ -45,11 +23,6 @@ module Gitlab
45
23
  command.env("discovery.type", "single-node")
46
24
  end
47
25
  end
48
-
49
- def teardown
50
- @docker.stop(name)
51
- @docker.remove(name)
52
- end
53
26
  end
54
27
  end
55
28
  end
@@ -7,13 +7,12 @@ require 'openssl'
7
7
  module Gitlab
8
8
  module QA
9
9
  module Component
10
- class Gitlab
10
+ class Gitlab < Base
11
11
  extend Forwardable
12
- include Scenario::Actable
13
12
 
14
- attr_reader :release, :docker
15
- attr_accessor :volumes, :network, :environment, :tls, :disable_animations
16
- attr_writer :name, :relative_path, :exec_commands, :skip_check
13
+ attr_reader :release
14
+ attr_accessor :tls, :disable_animations, :skip_availability_check
15
+ attr_writer :name, :relative_path
17
16
 
18
17
  def_delegators :release, :tag, :image, :edition
19
18
 
@@ -21,17 +20,14 @@ module Gitlab
21
20
  SSL_PATH = '/etc/gitlab/ssl'.freeze
22
21
 
23
22
  def initialize
24
- @docker = Docker::Engine.new
25
- @environment = {}
26
- @volumes = {}
27
- @network_aliases = []
23
+ super
24
+
28
25
  @disable_animations = true
29
- @skip_check = false
26
+ @skip_availability_check = false
30
27
 
31
28
  @volumes[CERTIFICATES_PATH] = SSL_PATH
32
29
 
33
30
  self.release = 'CE'
34
- self.exec_commands = []
35
31
  end
36
32
 
37
33
  def omnibus_config=(config)
@@ -48,10 +44,6 @@ module Gitlab
48
44
  @environment['ELASTIC_URL'] = url
49
45
  end
50
46
 
51
- def add_network_alias(name)
52
- @network_aliases.push(name)
53
- end
54
-
55
47
  def release=(release)
56
48
  @release = QA::Release.new(release)
57
49
  end
@@ -72,10 +64,6 @@ module Gitlab
72
64
  tls ? '443' : '80'
73
65
  end
74
66
 
75
- def hostname
76
- "#{name}.#{network}"
77
- end
78
-
79
67
  def relative_path
80
68
  @relative_path ||= ''
81
69
  end
@@ -84,24 +72,16 @@ module Gitlab
84
72
  Runtime::Env.accept_insecure_certs = 'true'
85
73
  end
86
74
 
87
- def instance
88
- prepare
89
- start
90
- reconfigure
91
- wait unless @skip_check
92
- process_exec_commands
75
+ def prepare
76
+ prepare_gitlab_omnibus_config
93
77
 
94
- yield self if block_given?
95
- ensure
96
- teardown
78
+ super
97
79
  end
98
80
 
99
- alias_method :launch_and_teardown_instance, :instance
81
+ def pull
82
+ docker.login(**release.login_params) if release.login_params
100
83
 
101
- def prepare
102
- prepare_gitlab_omnibus_config
103
- prepare_docker_image
104
- prepare_network
84
+ super
105
85
  end
106
86
 
107
87
  def prepare_gitlab_omnibus_config
@@ -109,18 +89,6 @@ module Gitlab
109
89
  set_formless_login_token
110
90
  end
111
91
 
112
- def prepare_docker_image
113
- return if Runtime::Env.skip_pull?
114
-
115
- @docker.pull(image, tag)
116
- end
117
-
118
- def prepare_network
119
- return if @docker.network_exists?(network)
120
-
121
- @docker.network_create(network)
122
- end
123
-
124
92
  def setup_disable_animations
125
93
  @environment['GITLAB_OMNIBUS_CONFIG'] = "gitlab_rails['gitlab_disable_animations'] = true; #{@environment['GITLAB_OMNIBUS_CONFIG'] || ''}"
126
94
  end
@@ -128,17 +96,6 @@ module Gitlab
128
96
  def start # rubocop:disable Metrics/AbcSize
129
97
  ensure_configured!
130
98
 
131
- if release.dev_gitlab_org?
132
- Docker::Command.execute(
133
- [
134
- 'login',
135
- '--username gitlab-qa-bot',
136
- %(--password "#{Runtime::Env.dev_access_token_variable}"),
137
- QA::Release::DEV_REGISTRY
138
- ]
139
- )
140
- end
141
-
142
99
  docker.run(image, tag) do |command|
143
100
  command << "-d -p #{port}"
144
101
  command << "--name #{name}"
@@ -170,18 +127,9 @@ module Gitlab
170
127
  end
171
128
  end
172
129
 
173
- def restart
174
- @docker.restart(name)
175
- end
176
-
177
- def teardown
178
- raise 'Invalid instance name!' unless name
179
-
180
- @docker.stop(name)
181
- @docker.remove(name)
182
- end
183
-
184
130
  def wait
131
+ return if skip_availability_check
132
+
185
133
  if Availability.new(name, relative_path: relative_path, scheme: scheme, protocol_port: port.to_i).check(180)
186
134
  sleep 12 # TODO, handle that better
187
135
  puts ' -> GitLab is available.'
@@ -190,10 +138,6 @@ module Gitlab
190
138
  end
191
139
  end
192
140
 
193
- def pull
194
- @docker.pull(@release.image, @release.tag)
195
- end
196
-
197
141
  def sha_version
198
142
  json = @docker.read_file(
199
143
  @release.image, @release.tag,
@@ -204,14 +148,8 @@ module Gitlab
204
148
  manifest['software']['gitlab-rails']['locked_version']
205
149
  end
206
150
 
207
- def process_exec_commands
208
- exec_commands.each { |command| @docker.exec(name, command) }
209
- end
210
-
211
151
  private
212
152
 
213
- attr_reader :exec_commands
214
-
215
153
  def ensure_configured!
216
154
  raise 'Please configure an instance first!' unless [name, release, network].all?
217
155
  end