swiftrail 0.1.2 → 0.1.4

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: 644bf67a0db0447a400e42b54b8e956941d6368ac8a0955ce93309117301c1fc
4
- data.tar.gz: a20f2a2931a777420512d0f739a9f4e3ce8817bb7fa0ce3164eb7b8c39768020
3
+ metadata.gz: 16867f3cde48106f2f2c5c39e42b24ba351abe8b82256a56fc75aa9379d2b220
4
+ data.tar.gz: d0efc036db3b3dc900703d4d7ddd1579354ce37c650fbbeb1ec3c79cf86a380d
5
5
  SHA512:
6
- metadata.gz: 9341f64cb2a50454c6c045da1839d86958a4d87d00b0b7793411d6d3a289602737d49da9ba0a2840da92093947dd6843dc297974f61dab443f533f5f71b98dea
7
- data.tar.gz: 1697f0c9be55a206d276e75f06efa1d2c2fe11ab4c80f11081582bfcef42c228862ac88e4487bc039cf8cc492396f474973139cdf4dde12bd067ff244b9dcbce
6
+ metadata.gz: 9c344c2dd8ae9ba5adf6ffc706d15b03e9383ccbebefada863317879a273ef5459a8e580133170cd2d158b59ef90b6be8a17dd099926cba99e3ff041f5ce718f
7
+ data.tar.gz: 6dba5e1eb620e566e01eceb9c248bfb935c298928c0107d6840f1da80ad2aa528a65e1ab585cb2f055db8fb0a68dc87b33d8dfc526130f0a05b10918a3783acc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- swiftrail (0.1.2)
4
+ swiftrail (0.1.4)
5
5
  nokogiri (~> 1.10)
6
6
  thor (~> 0.20)
7
7
 
data/README.md CHANGED
@@ -21,11 +21,11 @@ $ bundle
21
21
 
22
22
  Mandatory options for all of the commands are
23
23
 
24
- - `--test_classes=''` - regex for the path to swift tests
25
- - `--test_rail_username=''` - username for TestRail account
26
- - `--test_rail_password=''` - password for TestRail account
27
- - `--test_rail_url=''` - url for TestRail account
28
- - `--run_id=''` - run_id for which you want to run the command
24
+ - `--test_classes=''` - regex for the path to swift tests
25
+ - `--test_rail_username=''` - username for TestRail account
26
+ - `--test_rail_password=''` - password for TestRail account
27
+ - `--test_rail_url=''` - url for TestRail account
28
+ - `--run_id=''` - run_id for which you want to run the command
29
29
 
30
30
  When running report you additionaly have to pass location of the test_reports
31
31
  - `--test-reports=''`
@@ -69,7 +69,7 @@ class MyOtherTests: XCTestCase {
69
69
 
70
70
  To be able to report the results of the tests, you need to first generate xml junit reports. Once you have those, running
71
71
  ```
72
- swiftrail report --test-reports='path/to/test/reports' --run_id:123 (all the other options should also be listed)
72
+ swiftrail report --test-reports='path/to/test/reports' --run_id:123 (all the other options should also be included)
73
73
  ```
74
74
  will report the results to TestRail. Dependent on success/failure the tests on TestRail will be marked accordingly.
75
75
 
@@ -78,7 +78,7 @@ will report the results to TestRail. Dependent on success/failure the tests on T
78
78
  Coverage report will give you the percentage of test cases covered by your ui/unit/... tests.
79
79
 
80
80
  ```
81
- swiftrail coverage --run_id:123 (all the other options should also be listed)
81
+ swiftrail coverage --run_id:123 (all the other options should also be included)
82
82
  ```
83
83
 
84
84
  ### Lint
@@ -86,12 +86,12 @@ swiftrail coverage --run_id:123 (all the other options should also be listed)
86
86
  Lint will give you outadet case_ids that you have marked on your ui/unit tests, but no longer exist as test cases on TestRail.
87
87
 
88
88
  ```
89
- swiftrail lint --run_id:123 (all the other options should also be listed)
89
+ swiftrail lint --run_id:123 (all the other options should also be included)
90
90
  ```
91
91
 
92
92
  ## Contributing
93
93
 
94
- Bug reports and pull requests are welcome on GitHub at https://github.com/slavkokrucaj/swiftrail. 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.
94
+ Bug reports and pull requests are welcome on GitHub at https://github.com/slavkokrucaj/swift-rail. 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.
95
95
 
96
96
  ## License
97
97
 
@@ -99,4 +99,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
99
99
 
100
100
  ## Code of Conduct
101
101
 
102
- Everyone interacting in the Swiftrail project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/slavkokrucaj/swiftrail/blob/master/CODE_OF_CONDUCT.md).
102
+ Everyone interacting in the Swiftrail project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/slavkokrucaj/swift-rail/blob/master/CODE_OF_CONDUCT.md).
data/lib/swiftrail/cli.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'thor'
2
+ require 'json'
2
3
  require 'swiftrail'
3
4
  require 'swiftrail/config/reader'
4
5
 
@@ -29,13 +30,26 @@ module Swiftrail
29
30
  end
30
31
 
31
32
  desc 'coverage', 'Reports coverage of all the tests on testrail account'
33
+ method_option :output_folder, type: :string, desc: 'Ouptut folder for your results'
32
34
  def coverage
33
- puts(swiftrail_coverage.coverage_report(options[:run_id]))
35
+ results = swiftrail_coverage.coverage_report(options[:run_id])
36
+ if options[output_folder].nil?
37
+ puts(JSON.pretty_generate(results))
38
+ else
39
+ write(results, File.join(output_folder, 'coverage.swiftrail'))
40
+ end
41
+
34
42
  end
35
43
 
36
44
  desc 'lint', 'Reports case ids that are missing on testrail account'
45
+ method_option :output_folder, type: :string, desc: 'Ouptut folder for your results'
37
46
  def lint
38
- puts(swiftrail_lint.lint_report(options[:run_id]))
47
+ results = swiftrail_lint.lint_report(options[:run_id])
48
+ if options['output_folder'].nil?
49
+ puts(JSON.pretty_generate(results))
50
+ else
51
+ write(results, File.join(options['output_folder'], 'lint.swiftrail'))
52
+ end
39
53
  end
40
54
 
41
55
  private
@@ -67,5 +81,11 @@ module Swiftrail
67
81
  options['test_rail_url']
68
82
  )
69
83
  end
84
+
85
+ def write(hash, file)
86
+ File.open(file,"w") do |f|
87
+ f.write(JSON.pretty_generate(hash))
88
+ end
89
+ end
70
90
  end
71
91
  end
@@ -1,3 +1,3 @@
1
1
  module Swiftrail
2
- VERSION = '0.1.2'.freeze
2
+ VERSION = '0.1.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swiftrail
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Slavko Krucaj
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-14 00:00:00.000000000 Z
11
+ date: 2019-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri