testrailtagging 0.3.6.9 → 0.3.7

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
  SHA1:
3
- metadata.gz: c596a8ef0a36d045387d5a10853115248e0306e2
4
- data.tar.gz: 596ef2e5d8d25972a0713a8ebdf80a8dcf53bd9e
3
+ metadata.gz: d3acaba01eab6b37fc87b8447823b2be644f3863
4
+ data.tar.gz: a7a692757ab0637b137943a1f97d4c8cf4541812
5
5
  SHA512:
6
- metadata.gz: e29fae6a5d5a75551baa141c5240f7a940341ce84c9150a0477889ea723c4bf417474207a10d95d20cc04146ebd98de5c27fe6bf05d6e853eb3ab49809374ad1
7
- data.tar.gz: 610dc1ba7b4bd10ae77b3869dfdbb8b5beaab65c5c157490f06fa0d0df8f78daa4df30f4c822965986a2cbeb65a887842ec3c8d65e21cfb1cae588971bf49e8a
6
+ metadata.gz: ac04be9e95ed0dcf8a027b80b132e37a349fcaaa72ca4d2f850162371578c4a3be77d3d6c6016609d3ed50b83a2956469d0ecc138a8a01387af248c490a32e56
7
+ data.tar.gz: f279a180c9fa138820c34a3af5512c805f318b0ef53fd57d8a94a3924d9a39ecc6c0aa9e84b9188d993406b16a0a48ad2392c8621db33ecbce7c174f01cde6e3
@@ -280,6 +280,42 @@ module TestCaseModifications
280
280
  puts "Number of orphaned testcase IDs: #{orphaned_ids_count}"
281
281
  end
282
282
 
283
+ # Inspects all request specs and checks if their associated testcase is marked as
284
+ # run once on testrail. If they are not, then the testcases on testrail get
285
+ # marked as run once
286
+ def self.update_run_once(suite_ids)
287
+ test_cases = TestRailOperations.get_test_rail_cases_for_all_suites(suite_ids)
288
+ spec_files = Dir["spec/**/*_spec.rb"].reject { |f| f.include? "spec/features/" }
289
+
290
+ request_specs = []
291
+ # parse all the files looking for examples
292
+ spec_files.each do |file|
293
+ # puts "Rspec file: #{file}"
294
+ File.open(file).each do |line|
295
+ if line.match("testrail_id")
296
+ testrail_ids = get_example_testrail_ids(line)
297
+ testrail_ids.each do |id|
298
+ # puts " id: #{id}"
299
+ tc = test_cases[id]
300
+ if tc && tc.file
301
+ unless tc.run_once
302
+ request_specs << tc
303
+ end
304
+ end
305
+ end
306
+ end
307
+ end
308
+ end
309
+
310
+ trclient = TestRailOperations.get_test_rail_client
311
+ request_specs.each do |tc|
312
+ puts "Marking Test Case as run_once: #{tc.id}"
313
+ url = "update_case/#{tc.id}"
314
+ data = { "custom_run_once" => true }
315
+ trclient.send_post_retry(url, data)
316
+ end
317
+ end
318
+
283
319
  # checks for duplicate test case ID's in the rspec tests
284
320
  def self.check_duplicates
285
321
  regression_files = Dir["regression_spec/**/*_spec.rb"]
data/lib/files/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Testrailtagging
2
- VERSION = "0.3.6.9"
2
+ VERSION = "0.3.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testrailtagging
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6.9
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Johnson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-09 00:00:00.000000000 Z
11
+ date: 2016-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  version: '0'
126
126
  requirements: []
127
127
  rubyforge_project:
128
- rubygems_version: 2.4.5
128
+ rubygems_version: 2.2.2
129
129
  signing_key:
130
130
  specification_version: 4
131
131
  summary: Utilities for working with testrail.