rspec-sonarqube-formatter 1.0.1 → 1.1.0

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: 18abf270b6d19003f2e9930ebc83037e1f071b7ec451ab3fb41956ed83e3b8ea
4
- data.tar.gz: 93979f9fc568b961dbaa8e1b5a96108e39db5a00f773091f9a3ccc8905268b7f
3
+ metadata.gz: 93972356452ed71c7faa406e7bbf606ecd50f3e132b0e069275b512b31f600b1
4
+ data.tar.gz: a93154e5011e94d1d0803600e8b3e1ebad2681e8546d8f75619c193ef11f900c
5
5
  SHA512:
6
- metadata.gz: 06dde19cae5242ebf42bae5fc25373e30c68cc807b33cd2baf4fc58466ca0332209ca8890d0699417dbd9d2dc4c1cc93504d0f6451935c21623984cfb9d9ad2d
7
- data.tar.gz: 76fb13fd00d7ab2f4b8fbaae33021b9bb1af930dceb868c4a7ffde2d30c85f61221b346cb5b88b7aecfbce43d083f8bcc177793b130ff63a97d649eb4e87c1c6
6
+ metadata.gz: 7615b6c9602c81f122a17ca9721eb4fe2ab25d1a36793cfa931d68dc8e99a0eed4b1e0e6c9bc1ed7203037e098fb875e9e7f3503490434e9ce5c208c665e1fa3
7
+ data.tar.gz: 0de1ff8fffa56043ee5145981cda0b56e2bf04bd8c319a24e1efcafe9316a62725423f8e44c02b4b7dd852b47df47a0924f505ccc1c9bef4d922c5785ed8ee5a
data/.gitignore CHANGED
@@ -35,3 +35,4 @@ rubocop.json
35
35
  *.gem
36
36
  .bundle/
37
37
  cc-test-reporter
38
+ pkg/*
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rspec-sonarqube-formatter (1.0.1)
4
+ rspec-sonarqube-formatter (1.1.0)
5
5
  rspec (~> 3.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # RSpec SonarQube Formatter
2
2
 
3
- Rspec formatter to generates an xml file for SonarQube, using the generec-test-data format,
3
+ [RSpec 3](https://rspec.info/) formatter that generates an XML file for [SonarQube](https://www.sonarqube.org/) 6.2+, using
4
+ the [Generic Test Data](https://docs.sonarqube.org/latest/analysis/generic-test/) format.
4
5
 
5
6
  [![Gem Version](https://img.shields.io/gem/v/rspec-sonarqube-formatter)][rubygems]
6
7
  [![Downloads](https://img.shields.io/gem/dt/rspec-sonarqube-formatter)][rubygems]
@@ -19,12 +20,87 @@ Rspec formatter to generates an xml file for SonarQube, using the generec-test-d
19
20
  [sonarqube]: https://sonarcloud.io/dashboard?id=otherguy_rspec-sonarqube-formatter
20
21
  [license]: https://github.com/otherguy/rspec-sonarqube-formatter/blob/master/LICENSE.md
21
22
 
23
+ ## Features 🌈
22
24
 
23
- ## Development
25
+ This formatter generates an XML report that can be read by [SonarQube](https://www.sonarqube.org/) 6.2+.
26
+ Out of the box, SonarQube 6.2+ supports generic formats for test coverage and test execution import. Using the XML file
27
+ generated by this gem, you get an overview of test executions (`passed`, `skipped`, `failed`)
28
+ and the time in milliseconds it took to execute these.
24
29
 
30
+ [![Sonarcloud.io](documentation/sonarcloud.png)][sonarqube]️
31
+
32
+ ## Installation 🚀
33
+
34
+ Add the gem to your application's `Gemfile`:
35
+
36
+ ```ruby
37
+ # RSpec formatters
38
+ gem 'rspec-sonarqube-formatter', '~> 1.0', require: false
39
+ ```
40
+
41
+ Then, update your bundle:
42
+
43
+ $ bundle install
44
+
45
+ Or install it manually using:
46
+
47
+ $ gem install rspec-sonarqube-formatter
48
+
49
+
50
+ ## Usage 🛠
51
+
52
+ Add the following code to your `spec_helper.rb`:
53
+
54
+ ```ruby
55
+ RSpec.configure do |c|
56
+ c.formatter = 'documentation'
57
+ c.add_formatter('RspecSonarqubeFormatter', 'out/test-report.xml')
58
+ ...
59
+ end
60
+ ```
61
+
62
+ Alternatively, edit your `.rspec` file to define your formatters there:
63
+
64
+ ```bash
65
+ # .rspec
66
+ --require spec_helper
67
+ --color
68
+ --format RspecSonarqubeFormatter
69
+ --out out/test-report.xml
70
+ --format documentation
71
+ ```
72
+
73
+ To make SonarQube read the test report, specify the path to the generated XML in your
74
+ [`sonar-project.properties`](sonar-project.properties) or configure it in the SonarQube GUI.
75
+
76
+ ```bash
77
+ # sonar-project.properties
78
+ sonar.testExecutionReportPaths=out/test-report.xml
79
+ ```
80
+
81
+ ## Inspiration 💅
82
+
83
+ The only [existing formatter](https://github.com/witjoh/rspec_sonar_formatter) does not work out of the box and is not
84
+ published to [RubyGems.org](https://rubygems.org/gems/rspec-sonarqube-formatter), so I created my own.
85
+
86
+ Thank you to [`@witjoh`](https://github.com/witjoh) for the original work ♥️!
87
+
88
+
89
+ ## Contributing 🚧
90
+
91
+ Bug reports and pull requests are welcome on GitHub at [`otherguy/rspec-sonarqube-formatter`](https://github.com/otherguy/rspec-sonarqube-formatter).
92
+
93
+ After checking out the repository, you need to install dependencies:
94
+
95
+ ```bash
25
96
  gem install bundler -v 2.0.2
26
97
  bundle install
98
+ ```
99
+
100
+ Then, run `bundle exec rake spec` to run the test suite.
101
+
102
+ To install this gem on your local machine, run `bundle exec rake install`.
27
103
 
104
+ Please check your contributions with RuboCop by running `bundle exec rubocop`.
28
105
 
29
- Tests:
30
- bundle exec rake spec
106
+ Releases are built from tags automatically on [Travis][travis] and pushed to [RubyGems.org][rubygems].
Binary file
@@ -30,7 +30,7 @@ class RspecSonarqubeFormatter
30
30
  end
31
31
 
32
32
  def example_started(_notification)
33
- @output.puts ''
33
+ # Do nothing
34
34
  end
35
35
 
36
36
  def example_passed(notification)
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
7
7
  spec.name = 'rspec-sonarqube-formatter'
8
8
 
9
9
  # rubocop:disable Gemspec/DuplicatedAssignment
10
- spec.version = '1.0.0-pre'
10
+ spec.version = '1.0.0-local'
11
11
  spec.version = ENV.fetch('TRAVIS_TAG') { spec.version }.to_s if ENV['TRAVIS']
12
12
  # rubocop:enable Gemspec/DuplicatedAssignment
13
13
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-sonarqube-formatter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Graf
@@ -132,6 +132,7 @@ files:
132
132
  - LICENSE.md
133
133
  - README.md
134
134
  - Rakefile
135
+ - documentation/sonarcloud.png
135
136
  - lib/rspec_sonarqube_formatter.rb
136
137
  - rspec-sonarqube-formatter.gemspec
137
138
  - sonar-project.properties