testrailtagging 0.3.6.8 → 0.3.6.9

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
  SHA1:
3
- metadata.gz: d9f009ba3976701fa82d946346d030b94031d6f2
4
- data.tar.gz: 5ad488c40e11de6091230a008d046219c954b1fa
3
+ metadata.gz: c596a8ef0a36d045387d5a10853115248e0306e2
4
+ data.tar.gz: 596ef2e5d8d25972a0713a8ebdf80a8dcf53bd9e
5
5
  SHA512:
6
- metadata.gz: 67c05020b50585a06696d8a4f5afa0fb93c24be4d7efa9d8858241439b5186ae24c31358b075fdb31f392e689f051d6b2dd08750943400eebe577b48c69912d6
7
- data.tar.gz: e3630127311e5850c6b33b14f5ff831054f1c9d36f0a921730782aa2573cc35b153b40dd0ba8c5a0c8d9927470e1e8c0c5f5bf969bd63a9ad3cc59f4435551b1
6
+ metadata.gz: e29fae6a5d5a75551baa141c5240f7a940341ce84c9150a0477889ea723c4bf417474207a10d95d20cc04146ebd98de5c27fe6bf05d6e853eb3ab49809374ad1
7
+ data.tar.gz: 610dc1ba7b4bd10ae77b3869dfdbb8b5beaab65c5c157490f06fa0d0df8f78daa4df30f4c822965986a2cbeb65a887842ec3c8d65e21cfb1cae588971bf49e8a
data/README.md CHANGED
@@ -64,6 +64,12 @@ After checking out the repo, run `bin/setup` to install dependencies. You can al
64
64
 
65
65
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
66
66
 
67
+ To publish gem to rubygems.org
68
+ a) Once the code change is complete, increase the version number
69
+ b) After the code is merged, run `gem build testrailtagging.gemspec`
70
+ d) Create a profile at rubygems.org, run `gem push testrailtagging-0.3.6.x.gem`
71
+ see http://guides.rubygems.org/publishing/
72
+
67
73
  ## Contributing
68
74
 
69
75
  Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/testrailtagging. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
@@ -227,12 +227,13 @@ module TestCaseModifications
227
227
  # For example, if an rspec test example has a testrail_id of 123123 in file foo_spec.rb, it will update the test
228
228
  # case on test rail and update the spec location field with foo_spec.rb.
229
229
  # This will iterate over all the files in the regression_spec folder.
230
- def self.update_automated_status(dryrun:false)
231
- test_cases = TestRailOperations.get_test_rail_cases
230
+ def self.update_automated_status(suite_ids, dryrun:false)
231
+ test_cases = TestRailOperations.get_test_rail_cases_for_all_suites(suite_ids)
232
232
  regression_files = Dir["regression_spec/**/*_spec.rb"]
233
233
  spec_files = regression_files + Dir["spec/**/*_spec.rb"]
234
234
  # For keeping test cases that actually changed
235
235
  changed_cases = {}
236
+ orphaned_ids_count = 0
236
237
  # parse all the files looking for examples
237
238
  spec_files.each do |file|
238
239
  # puts "Rspec file: #{file}"
@@ -257,13 +258,16 @@ module TestCaseModifications
257
258
  tc.automated = true
258
259
  changed_cases[id] = tc
259
260
  end
261
+ else
262
+ puts "Test CaseID: #{id} not found in any testrail suite for project: #{TestRailOperations.project_id}"
263
+ orphaned_ids_count += 1
260
264
  end
261
265
  end
262
266
  end
263
267
  end
264
268
  end
265
269
 
266
- puts "\nTest Cases that will get modified"
270
+ puts "\nTest Cases that will get modified" if changed_cases.count > 0
267
271
  trclient = TestRailOperations.get_test_rail_client
268
272
  changed_cases.each do |id_key, tc_val|
269
273
  puts "Test Case: id: #{id_key}, #{tc_val.file}" if tc_val.file
@@ -273,6 +277,7 @@ module TestCaseModifications
273
277
  trclient.send_post_retry(url, data)
274
278
  end
275
279
  end
280
+ puts "Number of orphaned testcase IDs: #{orphaned_ids_count}"
276
281
  end
277
282
 
278
283
  # checks for duplicate test case ID's in the rspec tests
@@ -105,14 +105,15 @@ module TestRailOperations
105
105
  # The Values are the instance of TestCase.
106
106
  # Each TestCase instance corresponds to a test case in test rail.
107
107
  # return - A hash of TestCase instances
108
- def self.get_test_rail_cases
108
+ def self.get_test_rail_cases(suite_id = nil)
109
109
  trclient = get_test_rail_client
110
110
  screen_sizes = get_test_rail_screen_size_codes
111
111
  priorities = get_test_rail_priority_codes
112
112
  test_cases = {}
113
113
 
114
114
  # retrieve test cases
115
- testcases_url = "get_cases/#{self.project_id}&suite_id=#{self.suite_id}"
115
+ id_suite = suite_id ? suite_id : self.suite_id
116
+ testcases_url = "get_cases/#{self.project_id}&suite_id=#{id_suite}"
116
117
  response = trclient.send_get(testcases_url)
117
118
  response.each do |test_case|
118
119
  id = test_case["id"]
@@ -138,6 +139,16 @@ module TestRailOperations
138
139
  test_cases
139
140
  end
140
141
 
142
+ # Gets all the test cases for all the suites that we have for Bridge in Testrail
143
+ # suite_ids - An array of integers for each test suite under a testrail project
144
+ def self.get_test_rail_cases_for_all_suites(suite_ids)
145
+ result = {}
146
+ suite_ids.each do |id|
147
+ result.merge!(get_test_rail_cases(id))
148
+ end
149
+ result
150
+ end
151
+
141
152
  # Updates a testcase that corresponds to the provided
142
153
  # testrail_id. The testcase's reference field will be
143
154
  # linked to the provided Jira ticket, given in the format
data/lib/files/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Testrailtagging
2
- VERSION = "0.3.6.8"
2
+ VERSION = "0.3.6.9"
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.8
4
+ version: 0.3.6.9
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-01 00:00:00.000000000 Z
11
+ date: 2016-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler