gitlab-qa 5.4.3 → 5.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5b104344d3af630c69b69edb56915220bacf32e86a2b2d02159bef044112763d
4
- data.tar.gz: b98743c7f6c138379c2350e29295c5c0e48b6156319651032c3877d3da0e70d7
3
+ metadata.gz: 77fe1e1cf434c67aaf9d068460b8269e31c988a8c77e93ff3427545370849d9b
4
+ data.tar.gz: bd9b0dc5b3a89075336da34ea0ebb6882228a06fcb7320003f906cdf5e17004b
5
5
  SHA512:
6
- metadata.gz: 35ec93687d9dbbf06c8593b2de3080f2c75fe0f6110f2fa5c1c2b988c5b09efea5562073b38d455480f93172b574bc00fd2cc8a4971a74a76d719c9be43a5eb2
7
- data.tar.gz: ad0ad93bbcf79ba906c80b46de51a790459a124460ddeff922bdca63f2aa44b42ca1366ddaab0d471197605519203cbfe177acf939ae8e86d59c9db6a90a21f9
6
+ metadata.gz: 10e68578bdbe034db633daf9fe238a9f200590ade25e4018b9889a9ab6bd3b71d72131c27044f7d9c740965febca1e64fa5f68bb231e377b278b01b71a713aa0
7
+ data.tar.gz: 02d8e5f9e03dc50caa19418c8d8f008909498b1fb963ed09867474df95fee3eade6e1b002b359354df4e3396e0bdb2ab1cdb39c6fb185ea87c05e9464dbbd2a7
@@ -90,6 +90,7 @@ release:
90
90
  script:
91
91
  - 'echo "Running: exe/gitlab-qa ${QA_SCENARIO:=Test::Instance::Image} ${RELEASE:=$DEFAULT_RELEASE} -- $QA_TESTS $QA_RSPEC_TAGS $RSPEC_REPORT_OPTS"'
92
92
  - exe/gitlab-qa ${QA_SCENARIO:=Test::Instance::Image} ${RELEASE:=$DEFAULT_RELEASE} -- $QA_TESTS $QA_RSPEC_TAGS $RSPEC_REPORT_OPTS || test_run_exit_code=$?
93
+ - exe/gitlab-qa-report --update-screenshot-path "gitlab-qa-run-*/**/rspec-*.xml"
93
94
  - export GITLAB_QA_ACCESS_TOKEN="$GITLAB_QA_PRODUCTION_ACCESS_TOKEN"
94
95
  - if [ "$TOP_UPSTREAM_SOURCE_REF" == "master" ]; then exe/gitlab-qa-report --report-in-issues "gitlab-qa-run-*/**/rspec-*.xml" --project "$QA_TESTCASES_REPORTING_PROJECT"; fi
95
96
  - exit $test_run_exit_code
@@ -226,6 +227,44 @@ ee:instance-quarantine:
226
227
  variables:
227
228
  QA_RSPEC_TAGS: "--tag quarantine --tag ~orchestrated"
228
229
 
230
+ ce:docker:
231
+ extends:
232
+ - .test
233
+ - .high-capacity
234
+ - .ce-qa
235
+ - .rspec-report-opts
236
+ variables:
237
+ QA_RSPEC_TAGS: "--tag docker"
238
+
239
+ ce:docker-quarantine:
240
+ extends:
241
+ - .test
242
+ - .high-capacity
243
+ - .ce-qa
244
+ - .quarantine
245
+ - .rspec-report-opts
246
+ variables:
247
+ QA_RSPEC_TAGS: "--tag docker --tag quarantine"
248
+
249
+ ee:docker:
250
+ extends:
251
+ - .test
252
+ - .high-capacity
253
+ - .ee-qa
254
+ - .rspec-report-opts
255
+ variables:
256
+ QA_RSPEC_TAGS: "--tag docker"
257
+
258
+ ee:docker-quarantine:
259
+ extends:
260
+ - .test
261
+ - .high-capacity
262
+ - .ee-qa
263
+ - .quarantine
264
+ - .rspec-report-opts
265
+ variables:
266
+ QA_RSPEC_TAGS: "--tag docker --tag quarantine"
267
+
229
268
  ce:relative_url:
230
269
  extends:
231
270
  - .test
@@ -90,6 +90,7 @@ module Gitlab
90
90
  autoload :PrepareStageReports, 'gitlab/qa/report/prepare_stage_reports'
91
91
  autoload :ResultsInIssues, 'gitlab/qa/report/results_in_issues'
92
92
  autoload :SummaryTable, 'gitlab/qa/report/summary_table'
93
+ autoload :UpdateScreenshotPath, 'gitlab/qa/report/update_screenshot_path'
93
94
  end
94
95
 
95
96
  module Slack
@@ -0,0 +1,39 @@
1
+ require 'nokogiri'
2
+
3
+ module Gitlab
4
+ module QA
5
+ module Report
6
+ class UpdateScreenshotPath
7
+ def initialize(files:)
8
+ @files = files
9
+ end
10
+
11
+ REGEX = %r{(?<gitlab_qa_run>gitlab-qa-run-.*?(?=\/))\/(?<gitlab_ce_ee_qa>gitlab-(ee|ce)-qa-.*?(?=\/))}
12
+
13
+ def invoke!
14
+ Dir.glob(@files).each do |rspec_report_file|
15
+ report = rewrite_each_screenshot_path(rspec_report_file)
16
+
17
+ File.write(rspec_report_file, report)
18
+
19
+ puts "Saved #{rspec_report_file}"
20
+ end
21
+ end
22
+
23
+ private
24
+
25
+ def rewrite_each_screenshot_path(rspec_report_file)
26
+ report = Nokogiri::XML(File.open(rspec_report_file))
27
+
28
+ match_data = rspec_report_file.match(REGEX)
29
+
30
+ report.xpath('//system-out').each do |system_out|
31
+ system_out.content = system_out.content.gsub(File.join(Docker::Volumes::QA_CONTAINER_WORKDIR, 'tmp'), "#{match_data[:gitlab_qa_run]}/#{match_data[:gitlab_ce_ee_qa]}")
32
+ end
33
+
34
+ report.to_s
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -40,6 +40,11 @@ module Gitlab
40
40
  slack_options[:message] = slack_options[:message] + "\n\n" + Gitlab::QA::Report::SummaryTable.create(input_files: files)
41
41
  end
42
42
 
43
+ opts.on('--update-screenshot-path FILES', "Update the path to screenshots to container's host") do |files|
44
+ report_options[:update_screenshot_path] = true
45
+ report_options[:files] = files
46
+ end
47
+
43
48
  opts.on_tail('-v', '--version', 'Show the version') do
44
49
  require 'gitlab/qa/version'
45
50
  puts "#{$PROGRAM_NAME} : #{VERSION}"
@@ -76,6 +81,14 @@ module Gitlab
76
81
 
77
82
  exit
78
83
  end
84
+
85
+ if report_options[:update_screenshot_path]
86
+ report_options.delete(:update_screenshot_path)
87
+
88
+ Gitlab::QA::Report::UpdateScreenshotPath.new(**report_options).invoke!
89
+
90
+ exit
91
+ end
79
92
  else
80
93
  puts options
81
94
  exit 1
@@ -1,5 +1,5 @@
1
1
  module Gitlab
2
2
  module QA
3
- VERSION = '5.4.3'.freeze
3
+ VERSION = '5.5.0'.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: 5.4.3
4
+ version: 5.5.0
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-04-07 00:00:00.000000000 Z
11
+ date: 2020-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control
@@ -256,6 +256,7 @@ files:
256
256
  - lib/gitlab/qa/report/prepare_stage_reports.rb
257
257
  - lib/gitlab/qa/report/results_in_issues.rb
258
258
  - lib/gitlab/qa/report/summary_table.rb
259
+ - lib/gitlab/qa/report/update_screenshot_path.rb
259
260
  - lib/gitlab/qa/reporter.rb
260
261
  - lib/gitlab/qa/runner.rb
261
262
  - lib/gitlab/qa/runtime/env.rb