gitlab-qa 5.1.0 → 5.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gitlab/qa/runtime/env.rb +17 -4
- data/lib/gitlab/qa/slack/post_to_slack.rb +4 -3
- data/lib/gitlab/qa/support/http_request.rb +1 -1
- data/lib/gitlab/qa/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30e6e754d6c1e8272e5e82f3601895f64f1612a5f1ca8a2b7255d1276114dee4
|
4
|
+
data.tar.gz: b7c4ad654f11d2a7adbbb893cfbb4bf839fa9858bf97e87bfd3b89b3ae53525e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03516d22897b193f7748422519b52cfa70465cedeaf1ef405afdc88ea399ca748bb054723d67238bf0983c1fafbd23c469757ac4dc39b26481bc3813116407f7
|
7
|
+
data.tar.gz: 7df1fe3331bec065736ad9491d71c9eecdef50f2a7270dc0b94dbf6a72eff7ae9eb4d7575f976676f615a239fdca419a8155e8f4ab8e806864fdae56e061eafa
|
@@ -73,7 +73,8 @@ module Gitlab
|
|
73
73
|
'QA_CAN_TEST_ADMIN_FEATURES' => :qa_can_test_admin_features,
|
74
74
|
'MAILHOG_HOSTNAME' => :mailhog_hostname,
|
75
75
|
'SLACK_QA_CHANNEL' => :slack_qa_channel,
|
76
|
-
'
|
76
|
+
'CI_SLACK_WEBHOOK_URL' => :ci_slack_webhook_url,
|
77
|
+
'SLACK_ICON_EMOJI' => :slack_icon_emoji
|
77
78
|
}.freeze
|
78
79
|
|
79
80
|
ENV_VARIABLES.each_value do |accessor|
|
@@ -96,6 +97,18 @@ module Gitlab
|
|
96
97
|
ENV['CI_PROJECT_NAME']
|
97
98
|
end
|
98
99
|
|
100
|
+
def ci_slack_webhook_url
|
101
|
+
ENV['CI_SLACK_WEBHOOK_URL']
|
102
|
+
end
|
103
|
+
|
104
|
+
def slack_qa_channel
|
105
|
+
ENV['SLACK_QA_CHANNEL']
|
106
|
+
end
|
107
|
+
|
108
|
+
def slack_icon_emoji
|
109
|
+
ENV['SLACK_ICON_EMOJI']
|
110
|
+
end
|
111
|
+
|
99
112
|
def run_id
|
100
113
|
@run_id ||= "gitlab-qa-run-#{Time.now.strftime('%Y-%m-%d-%H-%M-%S')}-#{SecureRandom.hex(4)}"
|
101
114
|
end
|
@@ -165,10 +178,10 @@ module Gitlab
|
|
165
178
|
raise ArgumentError, "Please provide SLACK_QA_CHANNEL"
|
166
179
|
end
|
167
180
|
|
168
|
-
def
|
169
|
-
return unless ENV['
|
181
|
+
def require_ci_slack_webhook_url!
|
182
|
+
return unless ENV['CI_SLACK_WEBHOOK_URL'].to_s.strip.empty?
|
170
183
|
|
171
|
-
raise ArgumentError, "Please provide
|
184
|
+
raise ArgumentError, "Please provide CI_SLACK_WEBHOOK_URL"
|
172
185
|
end
|
173
186
|
|
174
187
|
def require_kubernetes_environment!
|
@@ -8,14 +8,15 @@ module Gitlab
|
|
8
8
|
|
9
9
|
def invoke!
|
10
10
|
Runtime::Env.require_slack_qa_channel!
|
11
|
-
Runtime::Env.
|
11
|
+
Runtime::Env.require_ci_slack_webhook_url!
|
12
12
|
|
13
13
|
params = {}
|
14
|
-
params['token'] = Runtime::Env.slack_qa_bot_token
|
15
14
|
params['channel'] = Runtime::Env.slack_qa_channel
|
15
|
+
params['username'] = "GitLab QA Bot"
|
16
|
+
params['icon_emoji'] = Runtime::Env.slack_icon_emoji
|
16
17
|
params['text'] = @message
|
17
18
|
|
18
|
-
url =
|
19
|
+
url = Runtime::Env.ci_slack_webhook_url
|
19
20
|
|
20
21
|
Support::HttpRequest.make_http_request(method: 'post', url: url, params: params)
|
21
22
|
end
|
@@ -9,7 +9,7 @@ module Gitlab
|
|
9
9
|
def self.make_http_request(method: 'get', url: nil, params: {}, headers: {}, show_response: false, fail_on_error: true)
|
10
10
|
raise "URL not defined for making request. Exiting..." unless url
|
11
11
|
|
12
|
-
res = HTTP.follow.method(method).call(url,
|
12
|
+
res = HTTP.follow.method(method).call(url, json: params, headers: headers)
|
13
13
|
|
14
14
|
if show_response
|
15
15
|
if res.content_type.mime_type == "application/json"
|
data/lib/gitlab/qa/version.rb
CHANGED
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: 5.1.
|
4
|
+
version: 5.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grzegorz Bizon
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: climate_control
|